Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv22588/src
Modified Files:
AudacityHeaders.h Makefile.in Menus.cpp Menus.h Project.cpp
Project.h Theme.cpp TrackPanel.cpp
Removed Files:
ControlToolBar.cpp ControlToolBar.h EditToolBar.cpp
EditToolBar.h MeterToolBar.cpp MeterToolBar.h MixerToolBar.cpp
MixerToolBar.h SelectionBar.cpp SelectionBar.h ToolBar.cpp
ToolBar.h ToolsToolBar.cpp ToolsToolBar.h
TranscriptionToolBar.cpp TranscriptionToolBar.h
Log Message:
Updated toolbars to:
1) Include top and bottom docks
2) Include the SelectionBar as a new toolbar
3) Update the "blue meanie" to be a bit more informatative
4) Include ability to resize the meter bar while docked
5) And probably added a few critters along the way :-)
--- MeterToolBar.h DELETED ---
Index: Makefile.in
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Makefile.in,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- Makefile.in 6 Sep 2006 13:08:57 -0000 1.110
+++ Makefile.in 16 Sep 2006 05:54:35 -0000 1.111
@@ -21,7 +21,7 @@
EXTRAOBJS = @EXTRAOBJS@
EXTRATARGETS = @EXTRATARGETS@
LIBS = @LIBS@
-DIRS=blockfile commands effects effects/ladspa effects/nyquist export import
prefs widgets xml
+DIRS=blockfile commands effects effects/ladspa effects/nyquist export import
prefs toolbars widgets xml
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
@@ -50,10 +50,8 @@
BatchCommands.o \
BatchProcessDialog.o \
Benchmark.o \
- ControlToolBar.o \
Dependencies.o \
Envelope.o \
- EditToolBar.o \
FFT.o \
FileNames.o \
FreqWindow.o \
@@ -68,9 +66,7 @@
Legacy.o \
Matrix.o \
Menus.o \
- MeterToolBar.o \
Mix.o \
- MixerToolBar.o \
NoteTrack.o \
PitchName.o \
PlatformCompatibility.o \
@@ -78,7 +74,6 @@
Project.o \
Resample.o \
RingBuffer.o \
- SelectionBar.o \
Shuttle.o \
ShuttleGui.o \
ShuttlePrefs.o \
@@ -88,13 +83,10 @@
Theme.o \
TimeDialog.o \
TimeTrack.o \
- ToolBar.o \
- ToolsToolBar.o \
Track.o \
TrackArtist.o \
TrackPanel.o \
TrackPanelAx.o \
- TranscriptionToolBar.o \
UndoManager.o \
UploadDialog.o \
VoiceKey.o \
@@ -163,11 +155,22 @@
prefs/QualityPrefs.o \
prefs/SpectrumPrefs.o \
prefs/ThemePrefs.o \
+ toolbars/ControlToolBar.o \
+ toolbars/EditToolBar.o \
+ toolbars/MeterToolBar.o \
+ toolbars/MixerToolBar.o \
+ toolbars/SelectionBar.o \
+ toolbars/ToolBar.o \
+ toolbars/ToolDock.o \
+ toolbars/ToolManager.o \
+ toolbars/ToolsToolBar.o \
+ toolbars/TranscriptionToolBar.o \
widgets/treebook.o \
widgets/AButton.o \
widgets/ASlider.o \
widgets/AttachableScrollBar.o \
widgets/ExpandingToolBar.o \
+ widgets/Grabber.o \
widgets/Grid.o \
widgets/ImageRoll.o \
widgets/Meter.o \
Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.325
retrieving revision 1.326
diff -u -d -r1.325 -r1.326
--- TrackPanel.cpp 29 Aug 2006 23:01:53 -0000 1.325
+++ TrackPanel.cpp 16 Sep 2006 05:54:36 -0000 1.326
@@ -189,8 +189,6 @@
#include "AColor.h"
#include "AudacityApp.h"
#include "AudioIO.h"
-#include "ControlToolBar.h"
-#include "ToolsToolBar.h"
#include "Envelope.h"
#include "LabelTrack.h"
#include "NoteTrack.h"
@@ -202,11 +200,13 @@
#include "WaveTrack.h"
#include "TimeTrack.h"
#include "Experimental.h"
-#include "MeterToolBar.h"
-
#include "TrackPanelAx.h"
+#include "toolbars/ToolManager.h"
+#include "toolbars/ControlToolBar.h"
+#include "toolbars/ToolsToolBar.h"
+
#include "widgets/ASlider.h"
#include "widgets/Ruler.h"
#include "Theme.h"
--- ToolsToolBar.h DELETED ---
--- MeterToolBar.cpp DELETED ---
--- EditToolBar.cpp DELETED ---
--- SelectionBar.cpp DELETED ---
Index: Theme.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Theme.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Theme.cpp 11 Jul 2006 08:14:13 -0000 1.24
+++ Theme.cpp 16 Sep 2006 05:54:36 -0000 1.25
@@ -62,8 +62,8 @@
#include <wx/mstream.h>
#include "Project.h"
-#include "ToolBar.h"
-#include "ControlToolBar.h"
+#include "toolbars/ToolBar.h"
+#include "toolbars/ControlToolBar.h"
#include "ImageManipulation.h"
#include "Theme.h"
#include "AllThemeResources.h" // can remove this later, only needed for
'XPMS_RETIRED'.
--- MixerToolBar.h DELETED ---
--- ToolBar.cpp DELETED ---
--- ControlToolBar.h DELETED ---
--- TranscriptionToolBar.h DELETED ---
--- ToolBar.h DELETED ---
Index: Menus.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.cpp,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -d -r1.273 -r1.274
--- Menus.cpp 13 Sep 2006 09:50:20 -0000 1.273
+++ Menus.cpp 16 Sep 2006 05:54:35 -0000 1.274
@@ -77,12 +77,10 @@
#include "BatchProcessDialog.h"
#include "BatchCommands.h"
-#include "ControlToolBar.h"
-#include "EditToolBar.h"
-#include "MeterToolBar.h"
-#include "MixerToolBar.h"
-#include "ToolsToolBar.h"
-#include "TranscriptionToolBar.h"
+#include "toolbars/ToolManager.h"
+#include "toolbars/ControlToolBar.h"
+#include "toolbars/ToolsToolBar.h"
+
#include "Experimental.h"
#include "PlatformCompatibility.h"
#include "FileNames.h"
@@ -155,9 +153,9 @@
ZoomInAvailableFlag = 0x00000800,
ZoomOutAvailableFlag = 0x00001000,
StereoRequiredFlag = 0x00002000, //lda
- ToolBarDockHasFocus = 0x00004000, //lll
+ TopDockHasFocus = 0x00004000, //lll
TrackPanelHasFocus = 0x00008000, //lll
- SelectionBarHasFocus = 0x00010000, //lll
+ BotDockHasFocus = 0x00010000, //lll
LabelsSelectedFlag = 0x00020000,
AudioIOBusyFlag = 0x00040000, //lll
PlayRegionLockedFlag = 0x00080000, //msmeyer
@@ -580,6 +578,7 @@
c->AddItem(wxT("ShowEditTB"), _("Show Edit Toolbar"),
FN(OnShowEditToolBar));
c->AddItem(wxT("ShowMeterTB"), _("Show Meter Toolbar"),
FN(OnShowMeterToolBar));
c->AddItem(wxT("ShowMixerTB"), _("Show Mixer Toolbar"),
FN(OnShowMixerToolBar));
+ c->AddItem(wxT("ShowSelectionTB"), _("Show Selection Toolbar"),
FN(OnShowSelectionToolBar));
c->AddItem(wxT("ShowToolsTB"), _("Show Tools Toolbar"),
FN(OnShowToolsToolBar));
c->AddItem(wxT("ShowTranscriptionTB"), _("Show Transcription Toolbar"),
FN(OnShowTranscriptionToolBar));
c->EndSubMenu();
@@ -1021,21 +1020,17 @@
{
wxWindow *w = FindFocus();
- while( w )
- {
- if( w == mToolBarDock )
- {
- return ToolBarDockHasFocus;
+ while (w) {
+ if (w == mToolManager->GetTopDock()) {
+ return TopDockHasFocus;
}
- if( w == mTrackPanel )
- {
+ if (w == mTrackPanel) {
return TrackPanelHasFocus;
}
- if( w == mSelectionBar )
- {
- return SelectionBarHasFocus;
+ if (w == mToolManager->GetBotDock()) {
+ return BotDockHasFocus;
}
w = w->GetParent();
@@ -1164,30 +1159,34 @@
void AudacityProject::ModifyToolbarMenus()
{
- mCommandManager.Modify( wxT("ShowControlTB"),
- mToolBarDock->IsVisible( ControlBarID ) ?
- _("Hide Control Toolbar") :
- _("Show Control Toolbar") );
- mCommandManager.Modify( wxT("ShowEditTB"),
- mToolBarDock->IsVisible( EditBarID ) ?
- _("Hide Edit Toolbar") :
- _("Show Edit Toolbar") );
- mCommandManager.Modify( wxT("ShowMeterTB"),
- mToolBarDock->IsVisible( MeterBarID ) ?
- _("Hide Meter Toolbar") :
- _("Show Meter Toolbar") );
- mCommandManager.Modify( wxT("ShowMixerTB"),
- mToolBarDock->IsVisible( MixerBarID ) ?
- _("Hide Mixer Toolbar") :
- _("Show Mixer Toolbar") );
- mCommandManager.Modify( wxT("ShowToolsTB"),
- mToolBarDock->IsVisible( ToolsBarID ) ?
- _("Hide Tools Toolbar") :
- _("Show Tools Toolbar") );
- mCommandManager.Modify( wxT("ShowTranscriptionTB"),
- mToolBarDock->IsVisible( TranscriptionBarID ) ?
- _("Hide Transcription Toolbar") :
- _("Show Transcription Toolbar") );
+ mCommandManager.Modify(wxT("ShowControlTB"),
+ mToolManager->IsVisible(ControlBarID ) ?
+ _("Hide Control Toolbar") :
+ _("Show Control Toolbar"));
+ mCommandManager.Modify(wxT("ShowEditTB"),
+ mToolManager->IsVisible(EditBarID) ?
+ _("Hide Edit Toolbar") :
+ _("Show Edit Toolbar"));
+ mCommandManager.Modify(wxT("ShowMeterTB"),
+ mToolManager->IsVisible(MeterBarID) ?
+ _("Hide Meter Toolbar") :
+ _("Show Meter Toolbar"));
+ mCommandManager.Modify(wxT("ShowMixerTB"),
+ mToolManager->IsVisible(MixerBarID) ?
+ _("Hide Mixer Toolbar") :
+ _("Show Mixer Toolbar"));
+ mCommandManager.Modify(wxT("ShowSelectionTB"),
+ mToolManager->IsVisible(SelectionBarID) ?
+ _("Hide Selection Toolbar") :
+ _("Show Selection Toolbar"));
+ mCommandManager.Modify(wxT("ShowToolsTB"),
+ mToolManager->IsVisible(ToolsBarID) ?
+ _("Hide Tools Toolbar") :
+ _("Show Tools Toolbar"));
+ mCommandManager.Modify(wxT("ShowTranscriptionTB"),
+ mToolManager->IsVisible(TranscriptionBarID) ?
+ _("Hide Transcription Toolbar") :
+ _("Show Transcription Toolbar"));
}
void AudacityProject::UpdateMenus()
@@ -1215,7 +1214,7 @@
// Now, go through each toolbar, and call EnableDisableButtons()
for( int i = 0; i < ToolBarCount; i++ )
{
- mToolBarDock->GetToolBar( i )->EnableDisableButtons();
+ mToolManager->GetToolBar( i )->EnableDisableButtons();
}
}
@@ -1327,10 +1326,9 @@
if( !MakeReadyToPlay() )
return;
- ControlToolBar *toolbar = GetControlToolBar();
double pos = mTrackPanel->GetMostRecentXPos();
mLastPlayMode = oneSecondPlay;
- toolbar->PlayPlayRegion(pos - 0.5, pos + 0.5);
+ GetControlToolBar()->PlayPlayRegion(pos - 0.5, pos + 0.5);
}
@@ -1346,7 +1344,6 @@
if( !MakeReadyToPlay() )
return;
- ControlToolBar *toolbar = GetControlToolBar();
double pos = mTrackPanel->GetMostRecentXPos();
double t0,t1;
@@ -1373,7 +1370,7 @@
// only when playing a short region, less than or equal to a second.
// mLastPlayMode = ((t1-t0) > 1.0) ? normalPlay : oneSecondPlay;
- toolbar->PlayPlayRegion(t0, t1);
+ GetControlToolBar()->PlayPlayRegion(t0, t1);
}
void AudacityProject::OnPlayLooped()
@@ -1383,8 +1380,7 @@
// Now play in a loop
// Will automatically set mLastPlayMode
- ControlToolBar *toolbar = GetControlToolBar();
- toolbar->PlayCurrentRegion(true);
+ GetControlToolBar()->PlayCurrentRegion(true);
}
void AudacityProject::OnPlayCutPreview()
@@ -1393,8 +1389,7 @@
return;
// Play with cut preview
- ControlToolBar *toolbar = GetControlToolBar();
- toolbar->PlayCurrentRegion(false, true);
+ GetControlToolBar()->PlayCurrentRegion(false, true);
}
void AudacityProject::OnPlayStop()
@@ -1419,41 +1414,37 @@
void AudacityProject::OnStop()
{
- ControlToolBar *toolbar = GetControlToolBar();
wxCommandEvent evt;
if (gAudioIO->IsStreamActive())
- toolbar->OnStop(evt);
+ GetControlToolBar()->OnStop(evt);
}
void AudacityProject::OnPause()
{
- ControlToolBar *toolbar = GetControlToolBar();
wxCommandEvent evt;
- toolbar->OnPause(evt);
+ GetControlToolBar()->OnPause(evt);
}
void AudacityProject::OnRecord()
{
- ControlToolBar *toolbar = GetControlToolBar();
wxCommandEvent evt;
- toolbar->OnRecord(evt);
+ GetControlToolBar()->OnRecord(evt);
}
void AudacityProject::OnStopSelect()
{
- ControlToolBar *toolbar = GetControlToolBar();
- wxCommandEvent evt;
+ wxCommandEvent evt;
- if (gAudioIO->IsStreamActive()) {
- mViewInfo.sel0 = gAudioIO->GetStreamTime();
- if( mViewInfo.sel1 < mViewInfo.sel0 ) {
- mViewInfo.sel1 = mViewInfo.sel0;
- }
- toolbar->OnStop(evt);
- }
+ if (gAudioIO->IsStreamActive()) {
+ mViewInfo.sel0 = gAudioIO->GetStreamTime();
+ if( mViewInfo.sel1 < mViewInfo.sel0 ) {
+ mViewInfo.sel1 = mViewInfo.sel0;
+ }
+ GetControlToolBar()->OnStop(evt);
+ }
ModifyState();
}
@@ -1553,18 +1544,16 @@
void AudacityProject::OnSkipStart()
{
- ControlToolBar *toolbar = GetControlToolBar();
wxCommandEvent evt;
- toolbar->OnRewind(evt);
+ GetControlToolBar()->OnRewind(evt);
}
void AudacityProject::OnSkipEnd()
{
- ControlToolBar *toolbar = GetControlToolBar();
wxCommandEvent evt;
- toolbar->OnFF(evt);
+ GetControlToolBar()->OnFF(evt);
}
void AudacityProject::OnSeekLeftShort()
@@ -1729,16 +1718,16 @@
{
switch( GetFocusedFrame() )
{
- case ToolBarDockHasFocus:
+ case TopDockHasFocus:
mTrackPanel->SetFocus();
break;
case TrackPanelHasFocus:
- mSelectionBar->SetFocus();
+ mToolManager->GetBotDock()->SetFocus();
break;
- case SelectionBarHasFocus:
- mToolBarDock->SetFocus();
+ case BotDockHasFocus:
+ mToolManager->GetTopDock()->SetFocus();
break;
}
}
@@ -1747,15 +1736,15 @@
{
switch( GetFocusedFrame() )
{
- case ToolBarDockHasFocus:
- mSelectionBar->SetFocus();
+ case TopDockHasFocus:
+ mToolManager->GetBotDock()->SetFocus();
break;
case TrackPanelHasFocus:
- mToolBarDock->SetFocus();
+ mToolManager->GetTopDock()->SetFocus();
break;
- case SelectionBarHasFocus:
+ case BotDockHasFocus:
mTrackPanel->SetFocus();
break;
}
@@ -3356,37 +3345,43 @@
void AudacityProject::OnShowControlToolBar()
{
- mToolBarDock->ShowHide( ControlBarID );
+ mToolManager->ShowHide( ControlBarID );
ModifyToolbarMenus();
}
void AudacityProject::OnShowEditToolBar()
{
- mToolBarDock->ShowHide( EditBarID );
+ mToolManager->ShowHide( EditBarID );
ModifyToolbarMenus();
}
void AudacityProject::OnShowMeterToolBar()
{
- mToolBarDock->ShowHide( MeterBarID );
+ mToolManager->ShowHide( MeterBarID );
ModifyToolbarMenus();
}
void AudacityProject::OnShowMixerToolBar()
{
- mToolBarDock->ShowHide( MixerBarID );
+ mToolManager->ShowHide( MixerBarID );
+ ModifyToolbarMenus();
+}
+
+void AudacityProject::OnShowSelectionToolBar()
+{
+ mToolManager->ShowHide( SelectionBarID );
ModifyToolbarMenus();
}
void AudacityProject::OnShowToolsToolBar()
{
- mToolBarDock->ShowHide( ToolsBarID );
+ mToolManager->ShowHide( ToolsBarID );
ModifyToolbarMenus();
}
void AudacityProject::OnShowTranscriptionToolBar()
{
- mToolBarDock->ShowHide( TranscriptionBarID );
+ mToolManager->ShowHide( TranscriptionBarID );
ModifyToolbarMenus();
}
Index: AudacityHeaders.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityHeaders.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- AudacityHeaders.h 16 Jul 2006 00:39:10 -0000 1.4
+++ AudacityHeaders.h 16 Sep 2006 05:54:35 -0000 1.5
@@ -45,9 +45,7 @@
#include "AudacityApp.h"
#include "AudioIO.h"
#include "BlockFile.h"
-#include "ControlToolBar.h"
#include "DirManager.h"
-#include "EditToolBar.h"
#include "Envelope.h"
#include "FFT.h"
#include "FileFormats.h"
@@ -56,7 +54,6 @@
#include "Internat.h"
#include "LabelTrack.h"
#include "Mix.h"
-#include "MixerToolBar.h"
#include "NoteTrack.h"
#include "Prefs.h"
#include "Project.h"
@@ -65,7 +62,6 @@
#include "Sequence.h"
#include "TimeDialog.h"
#include "TimeTrack.h"
-#include "ToolBar.h"
#include "Track.h"
#include "UndoManager.h"
#include "ViewInfo.h"
Index: Menus.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Menus.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- Menus.h 5 Sep 2006 23:44:22 -0000 1.87
+++ Menus.h 16 Sep 2006 05:54:35 -0000 1.88
@@ -210,6 +210,7 @@
void OnShowEditToolBar();
void OnShowMeterToolBar();
void OnShowMixerToolBar();
+void OnShowSelectionToolBar();
void OnShowToolsToolBar();
void OnShowTranscriptionToolBar();
Index: Project.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- Project.h 9 Aug 2006 00:59:55 -0000 1.106
+++ Project.h 16 Sep 2006 05:54:36 -0000 1.107
@@ -20,7 +20,6 @@
#include "Audacity.h"
-#include "SelectionBar.h"
#include "DirManager.h"
#include "UndoManager.h"
#include "ViewInfo.h"
@@ -29,6 +28,7 @@
#include "commands/CommandManager.h"
#include "effects/Effect.h"
#include "xml/XMLTagHandler.h"
+#include "toolbars/SelectionBar.h"
#include <wx/defs.h>
#include <wx/dnd.h>
@@ -51,12 +51,13 @@
class wxProgressDialog;
class wxPanel;
-class ToolBarDock;
+class ToolManager;
class Toolbar;
class ControlToolBar;
class EditToolBar;
class MeterToolBar;
class MixerToolBar;
+class SelectionToolBar;
class ToolsToolBar;
class TranscriptionToolBar;
@@ -208,6 +209,7 @@
bool HandleKeyUp(wxKeyEvent & event);
void HandleResize();
+ void UpdateLayout();
// Other commands
@@ -263,6 +265,7 @@
EditToolBar *GetEditToolBar();
MeterToolBar *GetMeterToolBar();
MixerToolBar *GetMixerToolBar();
+ SelectionBar *GetSelectionBar();
ToolsToolBar *GetToolsToolBar();
TranscriptionToolBar *GetTranscriptionToolBar();
@@ -371,11 +374,7 @@
long mLastStatusUpdateTime;
long mLastUpdateUITime;
- SelectionBar *mSelectionBar;
wxStatusBar *mStatusBar;
- wxPoint mToolBarHotspot;
-
- wxGenericDragImage *mDrag;
AdornedRulerPanel *mRuler;
TrackPanel *mTrackPanel;
@@ -396,7 +395,7 @@
wxString mProgressMessage;
public:
- ToolBarDock *mToolBarDock;
+ ToolManager *mToolManager;
private:
int mAudioIOToken;
--- ToolsToolBar.cpp DELETED ---
--- TranscriptionToolBar.cpp DELETED ---
--- ControlToolBar.cpp DELETED ---
--- EditToolBar.h DELETED ---
--- SelectionBar.h DELETED ---
Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -d -r1.278 -r1.279
--- Project.cpp 9 Sep 2006 09:51:18 -0000 1.278
+++ Project.cpp 16 Sep 2006 05:54:35 -0000 1.279
@@ -99,14 +99,8 @@
#include "AutoRecovery.h"
#include "AudacityApp.h"
#include "AColor.h"
-#include "SelectionBar.h"
#include "AudioIO.h"
#include "Dependencies.h"
-#include "ControlToolBar.h"
-#include "ToolsToolBar.h"
-#include "EditToolBar.h"
-#include "MeterToolBar.h"
-#include "TranscriptionToolBar.h"
#include "FreqWindow.h"
#include "HistoryWindow.h"
#include "Internat.h"
@@ -114,11 +108,9 @@
#include "LabelTrack.h"
#include "Legacy.h"
#include "Mix.h"
-#include "MixerToolBar.h"
#include "NoteTrack.h"
#include "Prefs.h"
#include "Tags.h"
-#include "ToolBar.h"
#include "Track.h"
#include "TrackPanel.h"
#include "WaveTrack.h"
@@ -137,6 +129,14 @@
#include "Theme.h"
#include "AllThemeResources.h"
+#include "toolbars/ToolManager.h"
+#include "toolbars/ControlToolBar.h"
+#include "toolbars/EditToolBar.h"
+#include "toolbars/MeterToolBar.h"
+#include "toolbars/MixerToolBar.h"
+#include "toolbars/SelectionBar.h"
+#include "toolbars/ToolsToolBar.h"
+#include "toolbars/TranscriptionToolBar.h"
using std::cout;
@@ -144,9 +144,6 @@
double AudacityProject::msClipLen = 0.0;
AudacityProject *AudacityProject::msClipProject = NULL;
-
-const int grabberWidth=10;
-
#ifdef __WXMAC__
# ifndef __UNIX__
# include <Files.h>
@@ -462,7 +459,7 @@
mAutoScrolling(false),
mActive(true),
mHistoryWindow(NULL),
- mToolBarDock(NULL),
+ mToolManager(NULL),
mAudioIOToken(-1),
mIsDeleting(false),
mTracksFitVerticallyZoomed(false), //lda
@@ -482,8 +479,6 @@
mStatusBar = CreateStatusBar();
- mDrag = NULL;
-
#if wxUSE_DRAG_AND_DROP
SetDropTarget(new AudacityDropTarget(this));
#endif
@@ -520,9 +515,6 @@
mViewInfo.sbarScreen = 1;
mViewInfo.sbarTotal = 1;
- // Selection bar is used by UpdatePrefs(), so set it to a known value
- mSelectionBar = NULL;
-
UpdatePrefs();
// Some extra information
@@ -545,10 +537,12 @@
//
//
- // Create the ToolBarDock
+ // Create the ToolDock
//
- mToolBarDock = new ToolBarDock( this );
- mToolBarDock->LayoutToolBars();
+ mToolManager = new ToolManager( this );
+ GetSelectionBar()->SetListener(this);
+ GetSelectionBar()->SetRate(mRate);
+ mToolManager->LayoutToolBars();
// Fix the sliders on the mixer toolbar so that the tip windows
// actually pop-up on top of everything else. Sorry for the hack -
@@ -569,16 +563,6 @@
&mViewInfo );
//
- // Create the selection bar
- //
- mSelectionBar = new SelectionBar(this,
- wxID_ANY,
- wxDefaultPosition,
- wxDefaultSize,
- mRate,
- this);
-
- //
// Create the TrackPanel and the scrollbars
//
wxWindow * pPage;
@@ -604,10 +588,10 @@
#endif
wxBoxSizer *bs = new wxBoxSizer( wxVERTICAL );
- bs->Add( mToolBarDock, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP );
+ bs->Add( mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_LEFT |
wxALIGN_TOP );
bs->Add( mRuler, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTRE );
bs->Add( pPage, 1, wxEXPAND | wxALIGN_LEFT );
- bs->Add( mSelectionBar, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_BOTTOM );
+ bs->Add( mToolManager->GetBotDock(), 0, wxEXPAND | wxALIGN_LEFT |
wxALIGN_BOTTOM );
SetAutoLayout( true );
SetSizer( bs );
bs->Layout();
@@ -637,7 +621,7 @@
// will be given the focus even if we try to SetFocus(). By
// making the TrackPanel that first window, we resolve several
// keyboard focus problems.
- pPage->MoveBeforeInTabOrder(mToolBarDock);
+ pPage->MoveBeforeInTabOrder(mToolManager->GetTopDock());
bs = (wxBoxSizer *) pPage->GetSizer();
@@ -668,7 +652,7 @@
bs->Add( hs, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_BOTTOM );
// Lay it out
- pPage->SetAutoLayout( true );
+ pPage->SetAutoLayout(true);
pPage->Layout();
#ifdef EXPERIMENTAL_NOTEBOOK
@@ -837,8 +821,8 @@
mDefaultFormat = (sampleFormat) gPrefs->
Read(wxT("/SamplingRate/DefaultProjectSampleFormat"), floatSample);
- if( mSelectionBar )
- mSelectionBar->SetRate(mRate);
+ if( GetSelectionBar() )
+ GetSelectionBar()->SetRate(mRate);
if( GetMixerToolBar() )
GetMixerToolBar()->UpdatePrefs();
@@ -1107,10 +1091,19 @@
if (mViewInfo.vpos < 0)
mViewInfo.vpos = 0;
+ bool oldhstate;
+ bool oldvstate;
+ bool newhstate = mViewInfo.screen < mViewInfo.total;
+ bool newvstate = panelHeight < totalHeight;
+
#ifdef __WXGTK__
+ oldhstate = mHsbar->IsShown();
+ oldvstate = mVsbar->IsShown();
mHsbar->Show(mViewInfo.screen < mViewInfo.total);
mVsbar->Show(panelHeight < totalHeight);
#else
+ oldhstate = mHsbar->IsEnabled();
+ oldvstate = mVsbar->IsEnabled();
mHsbar->Enable(mViewInfo.screen < mViewInfo.total);
mVsbar->Enable(panelHeight < totalHeight);
#endif
@@ -1143,33 +1136,44 @@
}
UpdateMenus();
+
+ if (oldhstate != newhstate || oldvstate != newvstate) {
+ UpdateLayout();
+ }
}
-void AudacityProject::HandleResize()
+void AudacityProject::UpdateLayout()
{
if (!mTrackPanel)
return;
- FixScrollbars();
-
- mToolBarDock->LayoutToolBars();
+ mToolManager->LayoutToolBars();
Layout();
- mSelectionBar->Refresh( false );
-
// Retrieve size of this projects window
wxSize mainsz = GetSize();
// Retrieve position of the track panel to use as the size of the top
// third of the window
- wxPoint tppos = ClientToScreen( mTrackPanel->GetParent()->GetPosition() );
+ wxPoint tppos = ClientToScreen(mTrackPanel->GetParent()->GetPosition());
- // Retrieve position of selection bar to use as the size of the bottom
+ // Retrieve position of bottom dock to use as the size of the bottom
// third of the window
- wxPoint sbpos = ClientToScreen( mSelectionBar->GetPosition() );
+ wxPoint sbpos = ClientToScreen(mToolManager->GetBotDock()->GetPosition());
// The "+ 50" is the minimum height of the TrackPanel
- SetSizeHints( 250, ( mainsz.y - sbpos.y ) + tppos.y + 50, 20000, 20000 );
+ SetSizeHints(250, (mainsz.y - sbpos.y) + tppos.y + 50, 20000, 20000);
+}
+
+
+void AudacityProject::HandleResize()
+{
+ if (!mTrackPanel)
+ return;
+
+ FixScrollbars();
+
+ UpdateLayout();
}
@@ -1209,7 +1213,7 @@
{
HandleResize();
- event.Skip( false ); /* No need to propagate any further */
+ event.Skip(false); /* No need to propagate any further */
}
void AudacityProject::OnScroll(wxScrollEvent & event)
@@ -1405,7 +1409,7 @@
// We were playing or recording audio, but we've stopped the stream.
wxCommandEvent dummyEvent;
- this->GetControlToolBar()->OnStop(dummyEvent);
+ GetControlToolBar()->OnStop(dummyEvent);
if (gAudioIO->GetNumCaptureChannels() > 0) {
// Tracks are buffered during recording. This flushes
@@ -1905,7 +1909,7 @@
if (!wxStrcmp(attr, wxT("rate"))) {
Internat::CompatibleToDouble(value, &mRate);
- mSelectionBar->SetRate(mRate);
+ GetSelectionBar()->SetRate(mRate);
}
} // while
@@ -2312,7 +2316,7 @@
if (AudioIO::GetSupportedSampleRates().Index((int)newRate) !=
wxNOT_FOUND)
{
mRate = newRate;
- mSelectionBar->SetRate(mRate);
+ GetSelectionBar()->SetRate(mRate);
}
}
@@ -2656,12 +2660,14 @@
////////////////////////////////////////////////////////////
// This fetches a pointer to the control toolbar. It may
-// either be embedded in the current window or floating out
-// in the open.
+// either be docked or floating out in the open.
////////////////////////////////////////////////////////////
ControlToolBar *AudacityProject::GetControlToolBar()
{
- return mToolBarDock ? mToolBarDock->GetControlToolBar() : NULL;
+ return (ControlToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(ControlBarID) :
+ NULL);
}
//JKC: same as above *except* this a virtual function that
@@ -2681,27 +2687,50 @@
EditToolBar *AudacityProject::GetEditToolBar()
{
- return mToolBarDock ? mToolBarDock->GetEditToolBar() : NULL;
+ return (EditToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(EditBarID) :
+ NULL);
}
MeterToolBar *AudacityProject::GetMeterToolBar()
{
- return mToolBarDock ? mToolBarDock->GetMeterToolBar() : NULL;
+ return (MeterToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(MeterBarID) :
+ NULL);
}
MixerToolBar *AudacityProject::GetMixerToolBar()
{
- return mToolBarDock ? mToolBarDock->GetMixerToolBar() : NULL;
+ return (MixerToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(MixerBarID) :
+ NULL);
}
-ToolsToolBar *AudacityProject::GetToolsToolBar()
+SelectionBar *AudacityProject::GetSelectionBar()
{
- return mToolBarDock ? mToolBarDock->GetToolsToolBar() : NULL;
+ return (SelectionBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(SelectionBarID) :
+ NULL);
}
+ToolsToolBar *AudacityProject::GetToolsToolBar()
+{
+ return (ToolsToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(ToolsBarID) :
+ NULL);
+}
+
TranscriptionToolBar *AudacityProject::GetTranscriptionToolBar()
{
- return mToolBarDock ? mToolBarDock->GetTranscriptionToolBar() : NULL;
+ return (TranscriptionToolBar *)
+ (mToolManager ?
+ mToolManager->GetToolBar(TranscriptionBarID) :
+ NULL);
}
void AudacityProject::SetStop(bool bStopped)
@@ -2928,10 +2957,10 @@
mRuler->SetPlayRegion(mViewInfo.sel0, mViewInfo.sel1);
}
- mSelectionBar->SetTimes(mViewInfo.sel0, mViewInfo.sel1, audioTime);
+ GetSelectionBar()->SetTimes(mViewInfo.sel0, mViewInfo.sel1, audioTime);
if( mSnapTo ) {
- mViewInfo.sel0 = mSelectionBar->GetLeftTime();
- mViewInfo.sel1 = mSelectionBar->GetRightTime();
+ mViewInfo.sel0 = GetSelectionBar()->GetLeftTime();
+ mViewInfo.sel1 = GetSelectionBar()->GetRightTime();
}
}
--- MixerToolBar.cpp DELETED ---
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs