mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 17:19:43 +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:
parent
814ed57a68
commit
6539d693b3
@ -1919,6 +1919,31 @@ void AudacityProject::OnActivate(wxActivateEvent & event)
|
|||||||
mTrackPanel->SetFocus();
|
mTrackPanel->SetFocus();
|
||||||
#endif
|
#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
|
// Under Windows, focus can be "lost" when returning to
|
||||||
// Audacity from a different application.
|
// Audacity from a different application.
|
||||||
//
|
//
|
||||||
@ -4142,14 +4167,6 @@ EditToolBar *AudacityProject::GetEditToolBar()
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
MeterToolBar *AudacityProject::GetMeterToolBar()
|
|
||||||
{
|
|
||||||
return (MeterToolBar *)
|
|
||||||
(mToolManager ?
|
|
||||||
mToolManager->GetToolBar(MeterBarID) :
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
MixerToolBar *AudacityProject::GetMixerToolBar()
|
MixerToolBar *AudacityProject::GetMixerToolBar()
|
||||||
{
|
{
|
||||||
return (MixerToolBar *)
|
return (MixerToolBar *)
|
||||||
|
@ -373,7 +373,6 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
|||||||
|
|
||||||
DeviceToolBar *GetDeviceToolBar();
|
DeviceToolBar *GetDeviceToolBar();
|
||||||
EditToolBar *GetEditToolBar();
|
EditToolBar *GetEditToolBar();
|
||||||
MeterToolBar *GetMeterToolBar();
|
|
||||||
MixerToolBar *GetMixerToolBar();
|
MixerToolBar *GetMixerToolBar();
|
||||||
SelectionBar *GetSelectionBar();
|
SelectionBar *GetSelectionBar();
|
||||||
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
||||||
|
@ -68,6 +68,7 @@ MeterToolBar::MeterToolBar(int WhichMeters)
|
|||||||
|
|
||||||
MeterToolBar::~MeterToolBar()
|
MeterToolBar::~MeterToolBar()
|
||||||
{
|
{
|
||||||
|
MeterToolBars::RemoveMeters(mPlayMeter, mRecordMeter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -220,6 +221,16 @@ bool MeterToolBar::Expose( bool show )
|
|||||||
return ToolBar::Expose( 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()
|
wxSize MeterToolBar::GetDockedSize()
|
||||||
{
|
{
|
||||||
const int tbs = toolbarSingle + toolbarGap;
|
const int tbs = toolbarSingle + toolbarGap;
|
||||||
|
@ -45,6 +45,7 @@ class MeterToolBar:public ToolBar {
|
|||||||
|
|
||||||
virtual void OnSize(wxSizeEvent & event);
|
virtual void OnSize(wxSizeEvent & event);
|
||||||
virtual bool Expose( bool show );
|
virtual bool Expose( bool show );
|
||||||
|
virtual void Activate( bool active );
|
||||||
|
|
||||||
int GetInitialWidth() {return (mWhichMeters ==
|
int GetInitialWidth() {return (mWhichMeters ==
|
||||||
(kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.
|
(kWithRecordMeter + kWithPlayMeter)) ? 338 : 460;} // Separate bars used to be smaller.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user