本文整理汇总了C++中LabelTrack::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelTrack::SetName方法的具体用法?C++ LabelTrack::SetName怎么用?C++ LabelTrack::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelTrack
的用法示例。
在下文中一共展示了LabelTrack::SetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Process
bool EffectFindClipping::Process()
{
LabelTrack *l = NULL;
Track *original = NULL;
TrackListOfKindIterator iter(Track::Label, mTracks);
for (Track *t = iter.First(); t; t = iter.Next()) {
if (t->GetName() == wxT("Clipping")) {
l = (LabelTrack *) t;
// copy LabelTrack here, so it can be undone on cancel
l->Copy(l->GetStartTime(), l->GetEndTime(), &original);
original->SetOffset(l->GetStartTime());
original->SetName(wxT("Clipping"));
break;
}
}
if (!l) {
l = mFactory->NewLabelTrack();
l->SetName(_("Clipping"));
mTracks->Add((Track *) l);
}
int count = 0;
// JC: Only process selected tracks.
SelectedTrackListOfKindIterator waves(Track::Wave, mTracks);
WaveTrack *t = (WaveTrack *) waves.First();
while (t) {
double trackStart = t->GetStartTime();
double trackEnd = t->GetEndTime();
double t0 = mT0 < trackStart ? trackStart : mT0;
double t1 = mT1 > trackEnd ? trackEnd : mT1;
if (t1 > t0) {
sampleCount start = t->TimeToLongSamples(t0);
sampleCount end = t->TimeToLongSamples(t1);
sampleCount len = (sampleCount)(end - start);
if (!ProcessOne(l, count, t, start, len)) {
//put it back how it was
mTracks->Remove((Track *) l);
if(original) {
mTracks->Add((Track *) original);
}
return false;
}
}
count++;
t = (WaveTrack *) waves.Next();
}
return true;
}
示例2: 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
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;
}
}
wxASSERT(t);
if (!t)
return false;
// Add the label to it
((LabelTrack *) t)->AddLabel(rd.selectedRegion, rd.title);
((LabelTrack *) t)->Unselect();
}
return true;
}
示例3: Process
bool VampEffect::Process()
{
if (!mPlugin) return false;
TrackListIterator iter(mWaveTracks);
int count = 0;
WaveTrack *left = (WaveTrack *)iter.First();
bool multiple = false;
int prevTrackChannels = 0;
TrackListIterator scooter(iter);
if (left->GetLinked()) scooter.Next();
if (scooter.Next()) {
// if there is another track beyond this one and any linked one,
// then we're processing more than one track. That means we
// should use the originating track name in each new label
// track's name, to make clear which is which
multiple = true;
}
while (left) {
sampleCount lstart, rstart;
sampleCount len;
GetSamples(left, &lstart, &len);
WaveTrack *right = NULL;
int channels = 1;
if (left->GetLinked()) {
right = (WaveTrack *)iter.Next();
channels = 2;
GetSamples(right, &rstart, &len);
}
size_t step = mPlugin->getPreferredStepSize();
size_t block = mPlugin->getPreferredBlockSize();
bool initialiseRequired = true;
if (block == 0) {
if (step != 0) block = step;
else block = 1024;
}
if (step == 0) {
step = block;
}
if (prevTrackChannels > 0) {
// Plugin has already been initialised, so if the number of
// channels remains the same, we only need to do a reset.
// Otherwise we need to re-construct the whole plugin,
// because a Vamp plugin can't be re-initialised.
if (prevTrackChannels == channels) {
mPlugin->reset();
initialiseRequired = false;
} else {
//!!! todo: retain parameters previously set
Init();
}
}
if (initialiseRequired) {
if (!mPlugin->initialise(channels, step, block)) {
wxMessageBox(_("Sorry, Vamp Plug-in failed to initialize."));
return false;
}
}
LabelTrack *ltrack = mFactory->NewLabelTrack();
if (!multiple) {
ltrack->SetName(GetEffectName());
} else {
ltrack->SetName(wxString::Format(wxT("%s: %s"),
left->GetName().c_str(),
GetEffectName().c_str()));
}
mTracks->Add(ltrack);
float **data = new float*[channels];
for (int c = 0; c < channels; ++c) data[c] = new float[block];
sampleCount originalLen = len;
sampleCount ls = lstart;
sampleCount rs = rstart;
while (len) {
int request = block;
if (request > len) request = len;
if (left) left->Get((samplePtr)data[0], floatSample, ls, request);
if (right) right->Get((samplePtr)data[1], floatSample, rs, request);
if (request < (int)block) {
//.........这里部分代码省略.........