1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 23:33:49 +01:00

GetProjectPanel analogous to GetProjectFrame breaks dependencies...

... in places that need the TrackPanel but only to invoke common wxWindow
methods on it.

This eliminates direct use of TrackPanel by Scrubbing and ProjectWindow
This commit is contained in:
Paul Licameli
2019-07-03 13:51:53 -04:00
parent 7597080418
commit 1e4812f470
6 changed files with 59 additions and 23 deletions

View File

@@ -1081,3 +1081,14 @@ int ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels) {
int iRecMins = (int)round(dRecTime / 60.0);
return iRecMins;
}
/// This was moved here to eliminate dependency of Scrubbing.cpp on
/// TrackPanel, but perhaps a better home should be found for it in future
#include "tracks/ui/Scrubbing.h"
static const AudacityProject::AttachedObjects::RegisteredFactory sOverlayKey{
[]( AudacityProject &parent ){
auto result = std::make_shared< ScrubbingOverlay >( &parent );
TrackPanel::Get( parent ).AddOverlay( result );
return result;
}
};