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:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user