1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

ViewInfo does not depend on AudioIOBase...

... ViewInfo should only be concerned with screen geometry.

(And so it won't depend on AudioIO (even higher level) after stream time moves
there.)

PlaybackScroller receives the timer event directly (not from ViewInfo) and
caches playback position instead.  Then, as before, it propagates the event
to PlayIndicatorOverlay.
This commit is contained in:
Paul Licameli
2020-12-17 11:58:31 -05:00
parent aa8e4eef06
commit d92a68f076
5 changed files with 18 additions and 32 deletions

View File

@@ -174,13 +174,13 @@ void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
}
}
else {
// Calculate the horizontal position of the indicator
const double playPos = viewInfo.mRecentStreamTime;
auto &window = ProjectWindow::Get( *mProject );
auto &scroller = window.GetPlaybackScroller();
// Calculate the horizontal position of the indicator
const double playPos = scroller.GetRecentStreamTime();
using Mode = ProjectWindow::PlaybackScroller::Mode;
const Mode mode =
window.GetPlaybackScroller().GetMode();
const Mode mode = scroller.GetMode();
const bool pinned = ( mode == Mode::Pinned || mode == Mode::Right );
// Use a small tolerance to avoid flicker of play head pinned all the way