void LabelDialog::OnChangeTrack(wxGridEvent &event, int row, RowData *rd) { wxString val = mGrid->GetCellValue(row, Col_Track); // User selected the "New..." choice so ask for a new name if (mTrackNames.Index(val) == 0) { wxTextEntryDialog d(this, _("New Label Track"), _("Enter track name"), _("Label Track")); // User canceled so repopulating the grid will set the track // name to the orignal value if (d.ShowModal() == wxID_CANCEL) { TransferDataToWindow(); return; } // Force generation of a new track name rd->index = 0; TrackName(rd->index, d.GetValue()); } else { // Remember the tracks index rd->index = mTrackNames.Index(val); } // Repopulate the grid TransferDataToWindow(); return; }
void LabelDialog::AddLabels(LabelTrack *t) { wxString lab; int tndx = 0; int i; // Add a new track name TrackName(tndx, t->GetName()); // Add each label in the track for (i = 0; i < t->GetNumLabels(); i++) { const LabelStruct *ls = t->GetLabel(i); RowData *rd = new RowData(); rd->index = tndx; rd->stime = ls->t; rd->etime = ls->t1; rd->title = ls->title; mData.Add(rd); if (i == t->getSelectedIndex()) { mInitialRow = mData.GetCount() - 1; } } }
bool LabelDialog::TransferDataToWindow() { int cnt = mData.size(); int i; // Set the editor parameters. Do this each time since they may change // due to NEW tracks and change in NumericTextCtrl format. Rate won't // change but might as well leave it here. mChoiceEditor->SetChoices(mTrackNames); mTimeEditor->SetFormat(mFormat); mTimeEditor->SetRate(mRate); // Disable redrawing until we're done mGrid->BeginBatch(); // Delete all rows if (mGrid->GetNumberRows()) { mGrid->DeleteRows(0, mGrid->GetNumberRows()); } // Add the exact number that we'll need mGrid->InsertRows(0, cnt); // Populate the rows for (i = 0; i < cnt; i++) { RowData &rd = mData[i]; // Set the cell contents mGrid->SetCellValue(i, Col_Track, TrackName(rd.index)); mGrid->SetCellValue(i, Col_Label, rd.title); mGrid->SetCellValue(i, Col_Stime, wxString::Format(wxT("%g"), rd.selectedRegion.t0())); mGrid->SetCellValue(i, Col_Etime, wxString::Format(wxT("%g"), rd.selectedRegion.t1())); // PRL: to do: -- populate future additional selection fields // and write event code to update them from controls } // Autosize all the rows mGrid->AutoSizeRows(true); // Resize the track name column. Use a wxChoice to determine the maximum // width needed. wxChoice tc(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, mTrackNames); mGrid->SetColSize(Col_Track, tc.GetSize().x); mGrid->SetColMinimalWidth(Col_Track, tc.GetSize().x); // Autosize the time columns and set their minimal widths mGrid->AutoSizeColumn(Col_Stime); mGrid->AutoSizeColumn(Col_Etime); // We're done, so allow the grid to redraw mGrid->EndBatch(); return true; }
} string MP3MediaSubSession::SDPLines() { string sdp; sdp += "m=" + mediaType_ + RTSP::SP + Utility::ToString(portNum_) + RTSP::SP + "RTP/AVP " + Utility::ToString(payloadType_) + RTSP::CRLF; sdp += "c=IN IP4 " + destinationAddr_ + "/255\r\n"; sdp += "a=control:" + TrackName() + RTSP::CRLF;
string H264MediaSubSession::SDPLines() { string sdp; string pt = Utility::ToString(payloadType_); sdp += "m=" + mediaType_ + RTSP::SP + Utility::ToString(portNum_) + RTSP::SP + "RTP/AVP " + pt + RTSP::CRLF; sdp += "c=IN IP4 " + destinationAddr_ + "/255\r\n"; sdp += "a=rtpmap:" + pt + " H264/90000\r\n"; sdp += "a=fmtp:" + pt + " packetization-mode=1" + mediaSource_->GetConfig() + RTSP::CRLF; sdp += "a=control:" + TrackName() + RTSP::CRLF; return sdp; }
void LabelDialog::AddLabels(LabelTrack *t) { wxString lab; int tndx = 0; int i; // Add a NEW track name TrackName(tndx, t->GetName()); // Add each label in the track for (i = 0; i < t->GetNumLabels(); i++) { const LabelStruct *ls = t->GetLabel(i); mData.push_back(RowData(tndx, ls->title, ls->selectedRegion)); } }
void LabelDialog::AddLabels(LabelTrack *t) { wxString lab; int tndx = 0; int i; // Add a NEW track name TrackName(tndx, t->GetName()); // If editor was invoked for one label, add that one only, else add all. if (!mSelectedTrack || mSelectedTrack == t) { for (i = 0; i < t->GetNumLabels(); i++) { const LabelStruct *ls = t->GetLabel(i); if (mIndex < 0 || mIndex == i) mData.push_back(RowData(tndx, ls->title, ls->selectedRegion)); } } }