1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Fix for bug #783

This should correct the crash and will also correct
the problem where one project's playback/capture was
being metered in another project if multiple projects
were open.
This commit is contained in:
lllucius 2014-12-08 04:53:53 +00:00
parent 814ed57a68
commit 6539d693b3
4 changed files with 37 additions and 9 deletions

View File

@ -1919,6 +1919,31 @@ void AudacityProject::OnActivate(wxActivateEvent & event)
mTrackPanel->SetFocus();
#endif
if (mToolManager)
{
MeterToolBar *tb;
tb = (MeterToolBar *) mToolManager->GetToolBar(MeterBarID);
if (tb->IsVisible())
{
tb->Activate(mActive);
}
else
{
tb = (MeterToolBar *) mToolManager->GetToolBar(RecordMeterBarID);
if (tb->IsVisible())
{
tb->Activate(mActive);
}
tb = (MeterToolBar *) mToolManager->GetToolBar(PlayMeterBarID);
if (tb->IsVisible())
{
tb->Activate(mActive);
}
}
}
// Under Windows, focus can be "lost" when returning to
// Audacity from a different application.
//
@ -4142,14 +4167,6 @@ EditToolBar *AudacityProject::GetEditToolBar()
NULL);
}
MeterToolBar *AudacityProject::GetMeterToolBar()
{
return (MeterToolBar *)
(mToolManager ?
mToolManager->GetToolBar(MeterBarID) :
NULL);
}
MixerToolBar *AudacityProject::GetMixerToolBar()
{
return (MixerToolBar *)

View File

@ -373,7 +373,6 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
DeviceToolBar *GetDeviceToolBar();
EditToolBar *GetEditToolBar();
MeterToolBar *GetMeterToolBar();
MixerToolBar *GetMixerToolBar();
SelectionBar *GetSelectionBar();
#ifdef EXPERIMENTAL_SPECTRAL_EDITING

View File

@ -68,6 +68,7 @@ MeterToolBar::MeterToolBar(int WhichMeters)
MeterToolBar::~MeterToolBar()
{
MeterToolBars::RemoveMeters(mPlayMeter, mRecordMeter);
}
@ -220,6 +221,16 @@ bool MeterToolBar::Expose( bool show )
return ToolBar::Expose( show );
}
void MeterToolBar::Activate( bool active )
{
if( active )
MeterToolBars::AddMeters( mPlayMeter, mRecordMeter );
else
MeterToolBars::RemoveMeters( mPlayMeter, mRecordMeter );
gAudioIO->SetMeters(mRecordMeter, mPlayMeter);
}
wxSize MeterToolBar::GetDockedSize()
{
const int tbs = toolbarSingle + toolbarGap;

View File

@ -45,6 +45,7 @@ class MeterToolBar:public ToolBar {
virtual void OnSize(wxSizeEvent & event);
virtual bool Expose( bool show );
virtual void Activate( bool active );
int GetInitialWidth() {return (mWhichMeters ==
(kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.