mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-23 23:03:55 +02:00
Now have three varieties of the Meter Toolbar.
We have separate record and play meters. The original kind of meter is now called a combined meter. I've kept it because it can be useful when undocked if you do want both meters. I've also fixed it so that if made very narrow the meters stack vertically just as they already did horizontally.
This commit is contained in:
@@ -404,7 +404,9 @@ ToolManager::ToolManager( AudacityProject *parent )
|
||||
// Create all of the toolbars
|
||||
mBars[ ToolsBarID ] = new ToolsToolBar();
|
||||
mBars[ TransportBarID ] = new ControlToolBar();
|
||||
mBars[ MeterBarID ] = new MeterToolBar();
|
||||
mBars[ RecordMeterBarID ] = new MeterToolBar( kWithRecordMeter );
|
||||
mBars[ PlayMeterBarID ] = new MeterToolBar( kWithPlayMeter );
|
||||
mBars[ MeterBarID ] = new MeterToolBar( kWithPlayMeter | kWithRecordMeter );
|
||||
mBars[ EditBarID ] = new EditToolBar();
|
||||
mBars[ MixerBarID ] = new MixerToolBar();
|
||||
mBars[ TranscriptionBarID ] = new TranscriptionToolBar();
|
||||
@@ -467,7 +469,7 @@ void ToolManager::Reset()
|
||||
gAudioIO->SetMeters( NULL, NULL );
|
||||
|
||||
// Disconnect all docked bars
|
||||
for( ndx = 0; ndx < ToolBarCount; ndx++ )
|
||||
for( ndx = 0; ndx < ToolBarCount; ndx++ )
|
||||
{
|
||||
wxWindow *parent;
|
||||
ToolDock *dock;
|
||||
@@ -491,6 +493,10 @@ void ToolManager::Reset()
|
||||
wxCommandEvent e;
|
||||
bar->GetEventHandler()->ProcessEvent(e);
|
||||
}
|
||||
else if( ndx == MeterBarID )
|
||||
{
|
||||
dock = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
dock = mTopDock;
|
||||
@@ -504,14 +510,32 @@ void ToolManager::Reset()
|
||||
bar->SetSize(bar->GetBestFittingSize());
|
||||
}
|
||||
#endif
|
||||
dock->Dock( bar );
|
||||
|
||||
Expose( ndx, true );
|
||||
|
||||
if( parent )
|
||||
if( dock != NULL )
|
||||
{
|
||||
parent->Destroy();
|
||||
dock->Dock( bar );
|
||||
Expose( ndx, true );
|
||||
if( parent )
|
||||
parent->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Maybe construct a new floater
|
||||
// this happens if we are bouncing it out of a dock.
|
||||
if( parent == NULL ) {
|
||||
wxPoint pt = wxPoint( 10, 10 );
|
||||
wxWindow * pWnd = new ToolFrame( mParent, this, bar, pt );
|
||||
bar->Reparent( pWnd );
|
||||
// Put it near center of screen/window.
|
||||
// The adjustments help prevent it straddling two screens,
|
||||
// and if there multiple toobars the ndx means they won't overlap too much.
|
||||
pWnd->Centre( wxCENTER_ON_SCREEN );
|
||||
pWnd->Move( pWnd->GetPosition() + wxSize( ndx * 10 - 200, ndx * 10 ));
|
||||
}
|
||||
bar->SetDocked( NULL, false );
|
||||
bar->Expose( false );
|
||||
}
|
||||
|
||||
}
|
||||
// TODO:??
|
||||
// If audio was playing, we stopped the VU meters,
|
||||
@@ -571,6 +595,7 @@ void ToolManager::ReadConfig()
|
||||
gPrefs->Read( wxT("W"), &width[ ndx ], -1 );
|
||||
gPrefs->Read( wxT("H"), &height[ ndx ], -1 );
|
||||
|
||||
bar->SetVisible( show[ ndx ] );
|
||||
// Docked or floating?
|
||||
if( dock )
|
||||
{
|
||||
@@ -851,6 +876,13 @@ void ToolManager::ShowHide( int type )
|
||||
}
|
||||
}
|
||||
|
||||
void ToolManager::Hide( int type )
|
||||
{
|
||||
if( !IsVisible( type ) )
|
||||
return;
|
||||
ShowHide( type );
|
||||
}
|
||||
|
||||
//
|
||||
// Set the visible/hidden state of a toolbar
|
||||
//
|
||||
|
Reference in New Issue
Block a user