1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-08 04:32:00 +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

@@ -1590,8 +1590,9 @@ void ProjectWindow::TP_DisplaySelection()
auto &viewInfo = ViewInfo::Get( project );
const auto &selectedRegion = viewInfo.selectedRegion;
double audioTime;
auto &playRegion = ViewInfo::Get( project ).playRegion;
if (!gAudioIO->IsBusy() && project.IsPlayRegionLocked())
if (!gAudioIO->IsBusy() && playRegion.Locked())
ruler.SetPlayRegion( selectedRegion.t0(), selectedRegion.t1() );
else
// Cause ruler redraw anyway, because we may be zooming or scrolling
@@ -1599,10 +1600,8 @@ void ProjectWindow::TP_DisplaySelection()
if (gAudioIO->IsBusy())
audioTime = gAudioIO->GetStreamTime();
else {
double playEnd;
project.GetPlayRegion(&audioTime, &playEnd);
}
else
audioTime = playRegion.GetStart();
SelectionBar::Get( project ).SetTimes(selectedRegion.t0(),
selectedRegion.t1(), audioTime);