1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 15:39:27 +02:00

Eliminate GetActiveProject from MixerBoard, Snap, Meter

This commit is contained in:
Paul Licameli 2020-01-06 14:04:10 -05:00
parent 0c2c6c5da3
commit 32d2d2390f
3 changed files with 8 additions and 9 deletions

View File

@ -303,7 +303,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
mMeter.Release();
if (GetWave()) {
mMeter =
safenew MeterPanel(GetActiveProject(), // AudacityProject* project,
safenew MeterPanel(mProject, // AudacityProject* project,
this, -1, // wxWindow* parent, wxWindowID id,
false, // bool isInput
ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
@ -1462,7 +1462,7 @@ void MixerBoardFrame::OnSize(wxSizeEvent & WXUNUSED(event))
void MixerBoardFrame::OnKeyEvent(wxKeyEvent & event)
{
AudacityProject *project = GetActiveProject();
AudacityProject *project = mMixerBoard->mProject;
auto &commandManager = CommandManager::Get( *project );
commandManager.FilterKeyEvent(project, event, true);
}

View File

@ -54,7 +54,7 @@ SnapManager::SnapManager(const TrackList *tracks,
mPixelTolerance = pixelTolerance;
mNoTimeSnap = noTimeSnap;
mProject = GetActiveProject();
mProject = tracks->GetOwner();
wxASSERT(mProject);
mSnapTo = 0;
@ -333,7 +333,7 @@ SnapResults SnapManager::Snap
// Find where it would snap time to the grid
mConverter.ValueToControls(
t,
ProjectSettings::Get( *GetActiveProject() ).GetSnapTo() == SNAP_NEAREST
ProjectSettings::Get( *mProject ).GetSnapTo() == SNAP_NEAREST
);
mConverter.ControlsToValue();
results.timeSnappedTime = mConverter.GetValue();

View File

@ -758,14 +758,14 @@ void MeterPanel::OnMouse(wxMouseEvent &evt)
#if wxUSE_TOOLTIPS // Not available in wxX11
if (evt.Leaving()){
ProjectStatus::Get( *GetActiveProject() ).Set({});
ProjectStatus::Get( *mProject ).Set({});
}
else if (evt.Entering()) {
// Display the tooltip in the status bar
wxToolTip * pTip = this->GetToolTip();
if( pTip ) {
auto tipText = Verbatim( pTip->GetTip() );
ProjectStatus::Get( *GetActiveProject() ).Set(tipText);
ProjectStatus::Get( *mProject ).Set(tipText);
}
}
#endif
@ -1875,7 +1875,7 @@ void MeterPanel::StartMonitoring()
}
if (start && !gAudioIO->IsBusy()){
AudacityProject *p = GetActiveProject();
AudacityProject *p = mProject;
if (p){
gAudioIO->StartMonitoring( DefaultPlayOptions( *p ) );
}
@ -1994,8 +1994,7 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
// Dialog is a child of the project, rather than of the toolbar.
// This determines where it pops up.
wxDialogWrapper dlg( FindProjectFrame( GetActiveProject() ),
wxID_ANY, title );
wxDialogWrapper dlg( FindProjectFrame( mProject ), wxID_ANY, title);
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
S.StartVerticalLay();