1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-04 21:50:51 +01:00

Play region and its lock are stored together in ViewInfo

This commit is contained in:
Paul Licameli
2019-01-25 23:39:29 -05:00
parent 0a843806f8
commit 63b93fd2d1
11 changed files with 165 additions and 146 deletions

View File

@@ -487,11 +487,11 @@ void TranscriptionToolBar::PlayAtSpeed(bool looped, bool cutPreview)
}
// Get the current play region
double playRegionStart, playRegionEnd;
p->GetPlayRegion(&playRegionStart, &playRegionEnd);
const auto &viewInfo = ViewInfo::Get( *p );
const auto &playRegion = viewInfo.playRegion;
// Start playing
if (playRegionStart < 0)
if (playRegion.GetStart() < 0)
return;
if (bFixedSpeedPlay)
{
@@ -504,8 +504,8 @@ void TranscriptionToolBar::PlayAtSpeed(bool looped, bool cutPreview)
: options.playLooped ? PlayMode::loopedPlay
: PlayMode::normalPlay;
auto &bar = ControlToolBar::Get( *p );
bar.PlayPlayRegion
(SelectedRegion(playRegionStart, playRegionEnd),
bar.PlayPlayRegion(
SelectedRegion(playRegion.GetStart(), playRegion.GetEnd()),
options,
mode);
}
@@ -513,7 +513,7 @@ void TranscriptionToolBar::PlayAtSpeed(bool looped, bool cutPreview)
{
auto &scrubber = Scrubber::Get( *p );
scrubber.StartSpeedPlay(GetPlaySpeed(),
playRegionStart, playRegionEnd);
playRegion.GetStart(), playRegion.GetEnd());
}
}