1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-23 23:03:55 +02:00

Fewer C-style pointer casts of tracks; comments justify static_cast

This commit is contained in:
Paul Licameli
2016-09-15 09:54:38 -04:00
parent 837173e9ad
commit 88611a4530
18 changed files with 223 additions and 164 deletions

View File

@@ -231,7 +231,7 @@ bool EffectChangeSpeed::Process()
if (t->GetKind() == Track::Label) {
if (t->GetSelected() || t->IsSyncLockSelected())
{
if (!ProcessLabelTrack(t)) {
if (!ProcessLabelTrack(static_cast<LabelTrack*>(t))) {
bGoodResult = false;
break;
}
@@ -453,13 +453,11 @@ bool EffectChangeSpeed::TransferDataFromWindow()
// Labels are time-scaled linearly inside the affected region, and labels after
// the region are shifted along according to how the region size changed.
bool EffectChangeSpeed::ProcessLabelTrack(Track *t)
bool EffectChangeSpeed::ProcessLabelTrack(LabelTrack *lt)
{
SetTimeWarper(std::make_unique<RegionTimeWarper>(mT0, mT1,
std::make_unique<LinearTimeWarper>(mT0, mT0,
mT1, mT0 + (mT1-mT0)*mFactor)));
LabelTrack *lt = (LabelTrack*)t;
if (lt == NULL) return false;
lt->WarpLabels(*GetTimeWarper());
return true;
}