本文整理汇总了C++中LabelTrack::GetStartTime方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelTrack::GetStartTime方法的具体用法?C++ LabelTrack::GetStartTime怎么用?C++ LabelTrack::GetStartTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelTrack
的用法示例。
在下文中一共展示了LabelTrack::GetStartTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}