本文整理汇总了C++中LabelTrack::DeleteLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelTrack::DeleteLabel方法的具体用法?C++ LabelTrack::DeleteLabel怎么用?C++ LabelTrack::DeleteLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelTrack
的用法示例。
在下文中一共展示了LabelTrack::DeleteLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransferDataFromWindow
bool LabelDialog::TransferDataFromWindow()
{
int cnt = mData.size();
int i;
TrackListIterator iter(mTracks);
Track *t;
int tndx = 0;
// Clear all label tracks of labels
for (t = iter.First(); t; t = iter.Next()) {
if (t->GetKind() == Track::Label) {
LabelTrack *lt = (LabelTrack *)t;
tndx++;
for (i = lt->GetNumLabels() - 1; i >= 0 ; i--) {
lt->DeleteLabel(i);
}
}
}
// Create any added tracks
while (tndx < (int)mTrackNames.GetCount() - 1) {
// Extract the name
wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
// Create the NEW track and add to track list
auto newTrack = mFactory.NewLabelTrack();
newTrack->SetName(name);
mTracks->Add(std::move(newTrack));
tndx++;
}
// Repopulate with updated labels
for (i = 0; i < cnt; i++) {
RowData &rd = mData[i];
// Look for track with matching index
tndx = 1;
for (t = iter.First(); t; t = iter.Next()) {
if (t->GetKind() == Track::Label && rd.index == tndx++) {
break;
}
}
wxASSERT(t);
if (!t)
return false;
// Add the label to it
((LabelTrack *) t)->AddLabel(rd.selectedRegion, rd.title);
((LabelTrack *) t)->Unselect();
}
return true;
}
示例2: TransferDataFromWindow
bool LabelDialog::TransferDataFromWindow()
{
int cnt = mData.GetCount();
int i;
TrackListIterator iter(mTracks);
Track *t;
int tndx = 0;
// Clear all label tracks of labels
for (t = iter.First(); t; t = iter.Next()) {
if (t->GetKind() == Track::Label) {
LabelTrack *lt = (LabelTrack *)t;
tndx++;
for (i = lt->GetNumLabels() - 1; i >= 0 ; i--) {
lt->DeleteLabel(i);
}
}
}
// Create any added tracks
while (tndx < (int)mTrackNames.GetCount() - 1) {
// Extract the name
wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
// Create the new track and add to track list
LabelTrack *newTrack = new LabelTrack(mDirManager);
newTrack->SetName(name);
mTracks->Add(newTrack);
tndx++;
}
// Repopulate with updated labels
for (i = 0; i < cnt; i++) {
RowData *rd = mData[i];
// Look for track with matching index
tndx = 1;
for (t = iter.First(); t; t = iter.Next()) {
if (t->GetKind() == Track::Label && rd->index == tndx++) {
break;
}
}
// Add the label to it
if (!rd->title.IsEmpty()) {
((LabelTrack *) t)->AddLabel(rd->stime, rd->etime, rd->title);
((LabelTrack *) t)->Unselect();
}
}
return true;
}