mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
Each toolbar registers its menu item
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "../Audacity.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
#include "../Menus.h"
|
||||
#include "../TrackPanel.h"
|
||||
@@ -43,141 +42,6 @@ void OnResetToolBars(const CommandContext &context)
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowTransportToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide(TransportBarID);
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowTimeToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( TimeBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowToolsToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( ToolsBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowRecordMeterToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
if( !toolManager.IsVisible( RecordMeterBarID ) )
|
||||
{
|
||||
toolManager.Expose( MeterBarID, false );
|
||||
}
|
||||
toolManager.ShowHide( RecordMeterBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowPlayMeterToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
if( !toolManager.IsVisible( PlayMeterBarID ) )
|
||||
{
|
||||
toolManager.Expose( MeterBarID, false );
|
||||
}
|
||||
|
||||
toolManager.ShowHide( PlayMeterBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void OnShowMeterToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
if( !toolManager.IsVisible( MeterBarID ) )
|
||||
{
|
||||
toolManager.Expose( PlayMeterBarID, false );
|
||||
toolManager.Expose( RecordMeterBarID, false );
|
||||
}
|
||||
toolManager.ShowHide( MeterBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnShowMixerToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( MixerBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowEditToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( EditBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowTranscriptionToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( TranscriptionBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowScrubbingToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( ScrubbingBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowDeviceToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( DeviceBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
void OnShowSelectionToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( SelectionBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
|
||||
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
||||
void OnShowSpectralSelectionToolBar(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &toolManager = ToolManager::Get( project );
|
||||
|
||||
toolManager.ShowHide( SpectralSelectionBarID );
|
||||
MenuManager::Get(project).ModifyToolbarMenus(project);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Handler to set the select tool active
|
||||
void OnSelectTool(const CommandContext &context)
|
||||
{
|
||||
@@ -278,83 +142,7 @@ BaseItemSharedPtr ToolbarsMenu()
|
||||
FN(OnResetToolBars), AlwaysEnabledFlag )
|
||||
),
|
||||
|
||||
Section( "Other",
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
with the big buttons on it (play record etc)*/
|
||||
Command( wxT("ShowTransportTB"), XXO("&Transport Toolbar"),
|
||||
FN(OnShowTransportToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( TransportBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows a toolbar
|
||||
that has some tools in it*/
|
||||
Command( wxT("ShowToolsTB"), XXO("T&ools Toolbar"),
|
||||
FN(OnShowToolsToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( ToolsBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
with the recording level meters*/
|
||||
Command( wxT("ShowRecordMeterTB"), XXO("&Recording Meter Toolbar"),
|
||||
FN(OnShowRecordMeterToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( RecordMeterBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
with the playback level meter*/
|
||||
Command( wxT("ShowPlayMeterTB"), XXO("&Playback Meter Toolbar"),
|
||||
FN(OnShowPlayMeterToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( PlayMeterBarID ) ) )
|
||||
|
||||
/* --i18nhint: Clicking this menu item shows the toolbar
|
||||
which has sound level meters*/
|
||||
//Command( wxT("ShowMeterTB"), XXO("Co&mbined Meter Toolbar"),
|
||||
// FN(OnShowMeterToolBar), AlwaysEnabledFlag,
|
||||
// Options{}.CheckTest( ToolbarCheckFn( MeterBarID ) ) )
|
||||
|
||||
,
|
||||
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
with the mixer*/
|
||||
Command( wxT("ShowMixerTB"), XXO("Mi&xer Toolbar"),
|
||||
FN(OnShowMixerToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( MixerBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar for editing*/
|
||||
Command( wxT("ShowEditTB"), XXO("&Edit Toolbar"),
|
||||
FN(OnShowEditToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( EditBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
for transcription (currently just vary play speed)*/
|
||||
Command( wxT("ShowTranscriptionTB"), XXO("Pla&y-at-Speed Toolbar"),
|
||||
FN(OnShowTranscriptionToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( TranscriptionBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
that enables Scrub or Seek playback and Scrub Ruler*/
|
||||
Command( wxT("ShowScrubbingTB"), XXO("Scru&b Toolbar"),
|
||||
FN(OnShowScrubbingToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( ScrubbingBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
that manages devices*/
|
||||
Command( wxT("ShowDeviceTB"), XXO("&Device Toolbar"),
|
||||
FN(OnShowDeviceToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( DeviceBarID ) ) ),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
for selecting a time range of audio*/
|
||||
Command( wxT("ShowSelectionTB"), XXO("&Selection Toolbar"),
|
||||
FN(OnShowSelectionToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( SelectionBarID ) ) )
|
||||
#ifdef EXPERIMENTAL_TIMER_TOOLBAR
|
||||
,
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
for viewing actual time of the cursor*/
|
||||
Command( wxT("ShowTimeToolBarTB"), XXO("&Time Toolbar"),
|
||||
FN(OnShowTimeToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( TimeBarID ) ) )
|
||||
#endif
|
||||
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
||||
,
|
||||
Command( wxT("ShowSpectralSelectionTB"),
|
||||
/* i18n-hint: Clicking this menu item shows the toolbar
|
||||
for selecting a frequency range of audio*/
|
||||
XXO("Spe&ctral Selection Toolbar"),
|
||||
FN(OnShowSpectralSelectionToolBar), AlwaysEnabledFlag,
|
||||
Options{}.CheckTest( ToolbarCheckFn( SpectralSelectionBarID ) ) )
|
||||
#endif
|
||||
)
|
||||
Section( "Other" )
|
||||
)
|
||||
) ) };
|
||||
return menu;
|
||||
|
||||
Reference in New Issue
Block a user