mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-31 19:44:54 +02: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:
@@ -1660,7 +1660,7 @@ void ProjectWindow::TP_HandleResize()
|
||||
ProjectWindow::PlaybackScroller::PlaybackScroller(AudacityProject *project)
|
||||
: mProject(project)
|
||||
{
|
||||
ViewInfo::Get( *mProject ).Bind(EVT_TRACK_PANEL_TIMER,
|
||||
mProject->Bind(EVT_TRACK_PANEL_TIMER,
|
||||
&PlaybackScroller::OnTimer,
|
||||
this);
|
||||
}
|
||||
@@ -1670,9 +1670,12 @@ void ProjectWindow::PlaybackScroller::OnTimer(wxCommandEvent &event)
|
||||
// Let other listeners get the notification
|
||||
event.Skip();
|
||||
|
||||
auto gAudioIO = AudioIOBase::Get();
|
||||
mRecentStreamTime = gAudioIO->GetStreamTime();
|
||||
|
||||
auto cleanup = finally([&]{
|
||||
// Propagate the message to other listeners bound to this
|
||||
this->ProcessEvent( event );
|
||||
this->SafelyProcessEvent( event );
|
||||
});
|
||||
|
||||
if(!ProjectAudioIO::Get( *mProject ).IsAudioActive())
|
||||
@@ -1692,7 +1695,7 @@ void ProjectWindow::PlaybackScroller::OnTimer(wxCommandEvent &event)
|
||||
|
||||
auto &viewInfo = ViewInfo::Get( *mProject );
|
||||
auto &trackPanel = GetProjectPanel( *mProject );
|
||||
const int posX = viewInfo.TimeToPosition(viewInfo.mRecentStreamTime);
|
||||
const int posX = viewInfo.TimeToPosition(mRecentStreamTime);
|
||||
auto width = viewInfo.GetTracksUsableWidth();
|
||||
int deltaX;
|
||||
switch (mMode)
|
||||
|
||||
Reference in New Issue
Block a user