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:
parent
814ed57a68
commit
6539d693b3
@ -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 *)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user