1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-16 07:47:58 +01:00

Moved mixer board update code out of class AudacityProject...

... And we don't need GetMixerBoard() any more
This commit is contained in:
Paul Licameli
2018-02-17 17:33:35 -05:00
parent 723cecbeac
commit 012ea76132
4 changed files with 22 additions and 21 deletions

View File

@@ -937,7 +937,8 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
void MixerBoard::UpdatePrefs()
{
mProject->RecreateMixerBoard();
// Destroys this:
static_cast<MixerBoardFrame*>(GetParent())->Recreate( mProject );
// Old approach modified things in situ.
// However with a theme change there is so much to modify, it is easier
@@ -1450,4 +1451,22 @@ void MixerBoardFrame::OnKeyEvent(wxKeyEvent & event)
project->GetCommandManager()->FilterKeyEvent(project, event, true);
}
void MixerBoardFrame::Recreate( AudacityProject *pProject )
{
wxPoint pos = mMixerBoard->GetPosition();
wxSize siz = mMixerBoard->GetSize();
wxSize siz2 = this->GetSize();
//wxLogDebug("Got rid of board %p", mMixerBoard );
mMixerBoard->Destroy();
mMixerBoard = NULL;
mMixerBoard = safenew MixerBoard(pProject, this, pos, siz);
//wxLogDebug("Created NEW board %p", mMixerBoard );
mMixerBoard->UpdateTrackClusters();
mMixerBoard->SetSize( siz );
this->SetSize( siz2 );
}