Audacity  2.2.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
AudacityProject Class Referencefinal

AudacityProject provides the main window, with tools and tracks contained within it. More...

#include <Project.h>

Inheritance diagram for AudacityProject:
TrackPanelListener SelectionBarListener SpectralSelectionBarListener XMLTagHandler AudioIOListener

Classes

struct  FoundClip
 
struct  FoundClipBoundary
 
struct  FoundTrack
 
class  OnEffectFlags
 
class  PlaybackScroller
 

Public Types

enum  MoveChoice { OnMoveUpID, OnMoveDownID, OnMoveTopID, OnMoveBottomID }
 
typedef void(WaveTrack::* EditFunction )(double, double)
 
typedef std::unique_ptr< Track >
(WaveTrack::* 
EditDestFunction )(double, double)
 

Public Member Functions

 AudacityProject (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
 
virtual ~AudacityProject ()
 
virtual void ApplyUpdatedTheme ()
 
AudioIOStartStreamOptions GetDefaultPlayOptions ()
 
AudioIOStartStreamOptions GetSpeedPlayOptions ()
 
TrackListGetTracks ()
 
const TrackListGetTracks () const
 
size_t GetTrackCount () const
 
UndoManagerGetUndoManager ()
 
sampleFormat GetDefaultFormat ()
 
double GetRate () const
 
bool ZoomInAvailable () const
 
bool ZoomOutAvailable () const
 
const SelectedRegionGetSelection () const
 
SelectedRegionGetSelection ()
 
double GetSel0 () const
 
double GetSel1 () const
 
const ZoomInfoGetZoomInfo () const
 
const ViewInfoGetViewInfo () const
 
ViewInfoGetViewInfo ()
 
std::shared_ptr< TrackGetFirstVisible ()
 
void GetPlayRegion (double *playRegionStart, double *playRegionEnd)
 
bool IsPlayRegionLocked ()
 
void SetSel0 (double)
 
void SetSel1 (double)
 
bool Clipboard ()
 
wxString GetName ()
 
const std::shared_ptr
< DirManager > & 
GetDirManager ()
 
TrackFactoryGetTrackFactory ()
 
AdornedRulerPanelGetRulerPanel ()
 
const TagsGetTags ()
 
int GetAudioIOToken () const
 
bool IsAudioActive () const
 
void SetAudioIOToken (int token)
 
bool IsActive () override
 
void OpenFile (const wxString &fileName, bool addtohistory=true)
 
bool WarnOfLegacyFile ()
 
bool Import (const wxString &fileName, WaveTrackArray *pTrackArray=NULL)
 
void ZoomAfterImport (Track *pTrack)
 
std::vector< std::shared_ptr
< Track > > 
AddImportedTracks (const wxString &fileName, TrackHolders &&newTracks)
 
bool Save ()
 
bool SaveAs (bool bWantSaveCopy=false, bool bLossless=false)
 
bool SaveAs (const wxString &newFileName, bool bWantSaveCopy=false, bool addToHistory=true)
 
bool SaveCopyWaveTracks (const wxString &strProjectPathName, bool bLossless=false)
 
void Clear ()
 
const wxString & GetFileName ()
 
bool GetDirty ()
 
void SetProjectTitle (int number=-1)
 
wxPanel * GetTopPanel ()
 
TrackPanelGetTrackPanel ()
 
const TrackPanelGetTrackPanel () const
 
SelectionStateGetSelectionState ()
 
bool GetIsEmpty ()
 
bool GetTracksFitVerticallyZoomed ()
 
void SetTracksFitVerticallyZoomed (bool flag)
 
bool GetShowId3Dialog ()
 
void SetShowId3Dialog (bool flag)
 
bool GetNormalizeOnLoad ()
 
void SetNormalizeOnLoad (bool flag)
 
void SetMissingAliasFileDialog (wxDialog *dialog)
 Sets the wxDialog that is being displayed Used by the custom dialog warning constructor and destructor. More...
 
wxDialog * GetMissingAliasFileDialog ()
 returns a pointer to the wxDialog if it is displayed, NULL otherwise. More...
 
bool SaveFromTimerRecording (wxFileName fnFile)
 
bool ExportFromTimerRecording (wxFileName fnFile, int iFormat, int iSubFormat, int iFilterIndex)
 
int GetOpenProjectCount ()
 
bool IsProjectSaved ()
 
void ResetProjectToEmpty ()
 
bool ProjectHasTracks ()
 
int GetEstimatedRecordingMinsLeftOnDisk (long lCaptureChannels=0)
 
wxString GetHoursMinsString (int iMinutes)
 
CommandFlag GetUpdateFlags (bool checkActive=false)
 
int DoAddLabel (const SelectedRegion &region, bool preserveFocus=false)
 
int DialogForLabelName (const wxString &initialValue, wxString &value)
 
void OnStop (const CommandContext &context)
 
void OnPause (const CommandContext &context)
 
void OnRecord (const CommandContext &context)
 
void OnRecord2ndChoice (const CommandContext &context)
 
void OnStopSelect (const CommandContext &context)
 
void OnSkipStart (const CommandContext &context)
 
void OnSkipEnd (const CommandContext &context)
 
void OnSeekLeftShort (const CommandContext &context)
 
void OnSeekRightShort (const CommandContext &context)
 
void OnSeekLeftLong (const CommandContext &context)
 
void OnSeekRightLong (const CommandContext &context)
 
bool MakeReadyToPlay (bool loop=false, bool cutpreview=false)
 
void OnPlayStop (const CommandContext &context)
 
bool DoPlayStopSelect (bool click, bool shift)
 
void OnPlayStopSelect (const CommandContext &context)
 
void OnPlayOneSecond (const CommandContext &context)
 
void OnPlayToSelection (const CommandContext &context)
 
void OnPlayBeforeSelectionStart (const CommandContext &context)
 
void OnPlayAfterSelectionStart (const CommandContext &context)
 
void OnPlayBeforeSelectionEnd (const CommandContext &context)
 
void OnPlayAfterSelectionEnd (const CommandContext &context)
 
void OnPlayBeforeAndAfterSelectionStart (const CommandContext &context)
 
void OnPlayBeforeAndAfterSelectionEnd (const CommandContext &context)
 
void OnPlayLooped (const CommandContext &context)
 
void OnPlayCutPreview (const CommandContext &context)
 
void OnTrackPan (const CommandContext &context)
 
void OnTrackPanLeft (const CommandContext &context)
 
void OnTrackPanRight (const CommandContext &context)
 
void OnTrackGain (const CommandContext &context)
 
void OnTrackGainInc (const CommandContext &context)
 
void OnTrackGainDec (const CommandContext &context)
 
void OnTrackMenu (const CommandContext &context)
 
void OnTrackMute (const CommandContext &context)
 
void OnTrackSolo (const CommandContext &context)
 
void OnTrackClose (const CommandContext &context)
 
void OnTrackMoveUp (const CommandContext &context)
 
void OnTrackMoveDown (const CommandContext &context)
 
void OnTrackMoveTop (const CommandContext &context)
 
void OnTrackMoveBottom (const CommandContext &context)
 
void MoveTrack (Track *target, MoveChoice choice)
 Move a track up, down, to top or to bottom. More...
 
void OnInputDevice (const CommandContext &context)
 
void OnOutputDevice (const CommandContext &context)
 
void OnAudioHost (const CommandContext &context)
 
void OnInputChannels (const CommandContext &context)
 
void OnOutputGain (const CommandContext &context)
 
void OnInputGain (const CommandContext &context)
 
void OnOutputGainInc (const CommandContext &context)
 
void OnOutputGainDec (const CommandContext &context)
 
void OnInputGainInc (const CommandContext &context)
 
void OnInputGainDec (const CommandContext &context)
 
void OnPlayAtSpeed (const CommandContext &context)
 
void OnPlayAtSpeedLooped (const CommandContext &context)
 
void OnPlayAtSpeedCutPreview (const CommandContext &context)
 
void OnSetPlaySpeed (const CommandContext &context)
 
void OnPlaySpeedInc (const CommandContext &context)
 
void OnPlaySpeedDec (const CommandContext &context)
 
void OnPrevTrack (bool shift)
 
void OnNextTrack (bool shift)
 
void OnCursorUp (const CommandContext &context)
 
void OnCursorDown (const CommandContext &context)
 
void OnFirstTrack (const CommandContext &context)
 
void OnLastTrack (const CommandContext &context)
 
void OnShiftUp (const CommandContext &context)
 
void OnShiftDown (const CommandContext &context)
 
void OnToggle (const CommandContext &context)
 
void HandleListSelection (Track *t, bool shift, bool ctrl, bool modifyState)
 
void OnCursorLeft (const CommandContext &context)
 
void OnCursorRight (const CommandContext &context)
 
void OnSelExtendLeft (const CommandContext &context)
 
void OnSelExtendRight (const CommandContext &context)
 
void OnSelContractLeft (const CommandContext &context)
 
void OnSelContractRight (const CommandContext &context)
 
void DoClipLeftOrRight (bool right, bool keyUp)
 
void OnClipLeft (const CommandContext &context)
 
void OnClipRight (const CommandContext &context)
 
void OnCursorShortJumpLeft (const CommandContext &context)
 
void OnCursorShortJumpRight (const CommandContext &context)
 
void OnCursorLongJumpLeft (const CommandContext &context)
 
void OnCursorLongJumpRight (const CommandContext &context)
 
void OnSelSetExtendLeft (const CommandContext &context)
 
void OnSelSetExtendRight (const CommandContext &context)
 
void OnSetLeftSelection (const CommandContext &context)
 
void OnSetRightSelection (const CommandContext &context)
 
void OnSelToStart (const CommandContext &context)
 
void OnSelToEnd (const CommandContext &context)
 
void OnMoveToNextLabel (const CommandContext &context)
 
void OnMoveToPrevLabel (const CommandContext &context)
 
void OnMoveToLabel (bool next)
 
void OnZeroCrossing (const CommandContext &context)
 
void OnLockPlayRegion (const CommandContext &context)
 
void OnUnlockPlayRegion (const CommandContext &context)
 
double GetTime (const Track *t)
 
void OnSortTime (const CommandContext &context)
 
void OnSortName (const CommandContext &context)
 
void OnSnapToOff (const CommandContext &context)
 
void OnSnapToNearest (const CommandContext &context)
 
void OnSnapToPrior (const CommandContext &context)
 
void OnFullScreen (const CommandContext &context)
 
void OnMacMinimize (const CommandContext &context)
 
void OnMacMinimizeAll (const CommandContext &context)
 
void OnMacZoom (const CommandContext &context)
 
void OnMacBringAllToFront (const CommandContext &context)
 
void OnNew (const CommandContext &context)
 
void OnOpen (const CommandContext &context)
 
void OnProjectReset (const CommandContext &context)
 
void OnClose (const CommandContext &context)
 
void OnSave (const CommandContext &context)
 
void OnSaveAs (const CommandContext &context)
 
void OnSaveCopy (const CommandContext &context)
 
void OnCheckDependencies (const CommandContext &context)
 
void OnExport (const wxString &Format)
 
void OnExportAudio (const CommandContext &context)
 
void OnExportMp3 (const CommandContext &context)
 
void OnExportWav (const CommandContext &context)
 
void OnExportOgg (const CommandContext &context)
 
void OnExportSelection (const CommandContext &context)
 
void OnExportMultiple (const CommandContext &context)
 
void OnExportLabels (const CommandContext &context)
 
void OnExportMIDI (const CommandContext &context)
 
void OnPreferences (const CommandContext &context)
 
void OnReloadPreferences (const CommandContext &context)
 
void OnPageSetup (const CommandContext &context)
 
void OnPrint (const CommandContext &context)
 
void OnExit (const CommandContext &context)
 
void OnUndo (const CommandContext &context)
 
void OnRedo (const CommandContext &context)
 
void OnCut (const CommandContext &context)
 
void OnSplitCut (const CommandContext &context)
 
void OnCopy (const CommandContext &context)
 
void OnPaste (const CommandContext &context)
 
void OnPasteNewLabel (const CommandContext &context)
 
void OnPasteOver (const CommandContext &context)
 
void OnTrim (const CommandContext &context)
 
void OnDelete (const CommandContext &context)
 
void OnSplitDelete (const CommandContext &context)
 
void OnSilence (const CommandContext &context)
 
void OnSplit (const CommandContext &context)
 
void OnSplitNew (const CommandContext &context)
 
void OnJoin (const CommandContext &context)
 
void OnDisjoin (const CommandContext &context)
 
void OnDuplicate (const CommandContext &context)
 
void OnCutLabels (const CommandContext &context)
 
void OnSplitCutLabels (const CommandContext &context)
 
void OnCopyLabels (const CommandContext &context)
 
void OnDeleteLabels (const CommandContext &context)
 
void OnSplitDeleteLabels (const CommandContext &context)
 
void OnSilenceLabels (const CommandContext &context)
 
void OnSplitLabels (const CommandContext &context)
 
void OnJoinLabels (const CommandContext &context)
 
void OnDisjoinLabels (const CommandContext &context)
 
void OnSelectTimeAndTracks (bool bAllTime, bool bAllTracks)
 
void OnSelectAllTime (const CommandContext &context)
 
void OnSelectAllTracks (const CommandContext &context)
 
void OnSelectAll (const CommandContext &context)
 
void OnSelectSomething (const CommandContext &context)
 
void OnSelectNone (const CommandContext &context)
 
void OnToggleSpectralSelection (const CommandContext &context)
 
void DoNextPeakFrequency (bool up)
 
void OnNextHigherPeakFrequency (const CommandContext &context)
 
void OnNextLowerPeakFrequency (const CommandContext &context)
 
void OnSelectCursorEnd (const CommandContext &context)
 
void OnSelectStartCursor (const CommandContext &context)
 
void OnSelectTrackStartToEnd (const CommandContext &context)
 
void OnSelectPrevClipBoundaryToCursor (const CommandContext &context)
 
void OnSelectCursorToNextClipBoundary (const CommandContext &context)
 
void OnSelectClipBoundary (bool next)
 
FoundClip FindNextClip (const WaveTrack *wt, double t0, double t1)
 
FoundClip FindPrevClip (const WaveTrack *wt, double t0, double t1)
 
int FindClips (double t0, double t1, bool next, std::vector< FoundClip > &results)
 
bool ChannelsHaveSameClipBoundaries (const WaveTrack *wt)
 
void OnSelectPrevClip (const CommandContext &context)
 
void OnSelectNextClip (const CommandContext &context)
 
void OnSelectClip (bool next)
 
void OnSelectCursorStoredCursor (const CommandContext &context)
 
void OnSelectSyncLockSel (const CommandContext &context)
 
void OnZoomIn (const CommandContext &context)
 
void OnZoomOut (const CommandContext &context)
 
void OnZoomToggle (const CommandContext &context)
 
void OnZoomNormal (const CommandContext &context)
 
void OnZoomFit (const CommandContext &context)
 
void OnZoomFitV (const CommandContext &context)
 
void DoZoomFitV ()
 
void OnZoomSel (const CommandContext &context)
 
void OnGoSelStart (const CommandContext &context)
 
void OnGoSelEnd (const CommandContext &context)
 
void OnExpandAllTracks (const CommandContext &context)
 
void OnCollapseAllTracks (const CommandContext &context)
 
void OnPanTracks (float PanValue)
 
void OnPanLeft (const CommandContext &context)
 
void OnPanRight (const CommandContext &context)
 
void OnPanCenter (const CommandContext &context)
 
void OnMuteAllTracks (const CommandContext &context)
 
void OnUnmuteAllTracks (const CommandContext &context)
 
void OnShowClipping (const CommandContext &context)
 
void OnShowExtraMenus (const CommandContext &context)
 
void OnHistory (const CommandContext &context)
 
void OnKaraoke (const CommandContext &context)
 
void OnMixerBoard (const CommandContext &context)
 
void OnPlotSpectrum (const CommandContext &context)
 
void OnContrast (const CommandContext &context)
 
void OnShowTransportToolBar (const CommandContext &context)
 
void OnShowDeviceToolBar (const CommandContext &context)
 
void OnShowEditToolBar (const CommandContext &context)
 
void OnShowMeterToolBar (const CommandContext &context)
 
void OnShowRecordMeterToolBar (const CommandContext &context)
 
void OnShowPlayMeterToolBar (const CommandContext &context)
 
void OnShowMixerToolBar (const CommandContext &context)
 
void OnShowSelectionToolBar (const CommandContext &context)
 
void OnShowSpectralSelectionToolBar (const CommandContext &context)
 
void OnShowScrubbingToolBar (const CommandContext &context)
 
void OnShowToolsToolBar (const CommandContext &context)
 
void OnShowTranscriptionToolBar (const CommandContext &context)
 
void OnResetToolBars (const CommandContext &context)
 
void OnSoundActivated (const CommandContext &context)
 
void OnToggleSoundActivated (const CommandContext &context)
 
void OnTogglePinnedHead (const CommandContext &context)
 
void OnTogglePlayRecording (const CommandContext &context)
 
void OnToggleSWPlaythrough (const CommandContext &context)
 
void OnRescanDevices (const CommandContext &context)
 
void OnPunchAndRoll (const CommandContext &context)
 
void OnImport (const CommandContext &context)
 
void OnImportLabels (const CommandContext &context)
 
void OnImportMIDI (const CommandContext &context)
 
void OnImportRaw (const CommandContext &context)
 
void OnEditMetadata (const CommandContext &context)
 
bool DoEditMetadata (const wxString &title, const wxString &shortUndoDescription, bool force)
 
void OnMixAndRender (const CommandContext &context)
 
void OnMixAndRenderToNewTrack (const CommandContext &context)
 
void HandleMixAndRender (bool toNewTrack)
 
void OnSelectionSave (const CommandContext &context)
 
void OnSelectionRestore (const CommandContext &context)
 
void OnCursorPositionStore (const CommandContext &context)
 
void OnCursorTrackStart (const CommandContext &context)
 
void OnCursorTrackEnd (const CommandContext &context)
 
void OnCursorSelStart (const CommandContext &context)
 
void OnCursorSelEnd (const CommandContext &context)
 
FoundClipBoundary FindNextClipBoundary (const WaveTrack *wt, double time)
 
FoundClipBoundary FindPrevClipBoundary (const WaveTrack *wt, double time)
 
double AdjustForFindingStartTimes (const std::vector< const WaveClip * > &clips, double time)
 
double AdjustForFindingEndTimes (const std::vector< const WaveClip * > &clips, double time)
 
int FindClipBoundaries (double time, bool next, std::vector< FoundClipBoundary > &results)
 
void OnCursorNextClipBoundary (const CommandContext &context)
 
void OnCursorPrevClipBoundary (const CommandContext &context)
 
void OnCursorClipBoundary (bool next)
 
void OnAlignNoSync (const CommandContext &context)
 
void OnAlign (const CommandContext &context)
 
void HandleAlign (int index, bool moveSel)
 
void OnNewWaveTrack (const CommandContext &context)
 
void OnNewStereoTrack (const CommandContext &context)
 
void OnNewLabelTrack (const CommandContext &context)
 
void OnNewTimeTrack (const CommandContext &context)
 
void OnTimerRecord (const CommandContext &context)
 
void OnRemoveTracks (const CommandContext &context)
 
void OnMoveSelectionWithTracks (const CommandContext &context)
 
void OnSyncLock (const CommandContext &context)
 
void OnAddLabel (const CommandContext &context)
 
void OnAddLabelPlaying (const CommandContext &context)
 
void DoEditLabels (LabelTrack *lt=nullptr, int index=-1)
 
void OnEditLabels (const CommandContext &context)
 
void OnToggleTypeToCreateLabel (const CommandContext &context)
 
bool DoEffect (const PluginID &ID, const CommandContext &context, int flags)
 
void OnEffect (const CommandContext &context)
 
void OnRepeatLastEffect (const CommandContext &context)
 
bool DoAudacityCommand (const PluginID &ID, const CommandContext &, int flags)
 
void OnApplyMacroDirectly (const CommandContext &context)
 
void OnApplyMacrosPalette (const CommandContext &context)
 
void OnManageMacros (const CommandContext &context)
 
void OnStereoToMono (const CommandContext &context)
 
void OnAudacityCommand (const CommandContext &context)
 
void OnManagePluginsMenu (EffectType Type)
 
void OnManageGenerators (const CommandContext &context)
 
void OnManageEffects (const CommandContext &context)
 
void OnManageAnalyzers (const CommandContext &context)
 
void OnManageTools (const CommandContext &context)
 
void OnAbout (const CommandContext &context)
 
void OnQuickHelp (const CommandContext &context)
 
void OnManual (const CommandContext &context)
 
void OnCheckForUpdates (const CommandContext &context)
 
void MayCheckForUpdates ()
 
void OnShowLog (const CommandContext &context)
 
void OnHelpWelcome (const CommandContext &context)
 
void OnBenchmark (const CommandContext &context)
 
void OnSimulateRecordingErrors (const CommandContext &context)
 
void OnDetectUpstreamDropouts (const CommandContext &context)
 
void OnScreenshot (const CommandContext &context)
 
void OnAudioDeviceInfo (const CommandContext &context)
 
void OnSeparator (const CommandContext &context)
 
void NextOrPrevFrame (bool next)
 
void PrevFrame (const CommandContext &context)
 
void NextFrame (const CommandContext &context)
 
void PrevWindow (const CommandContext &context)
 
void NextWindow (const CommandContext &context)
 
void OnResample (const CommandContext &context)
 
CommandManagerGetCommandManager ()
 
const CommandManagerGetCommandManager () const
 
void RebuildMenuBar ()
 
void RebuildOtherMenus ()
 
void MayStartMonitoring ()
 
void OnMenu (wxCommandEvent &event)
 
void OnUpdateUI (wxUpdateUIEvent &event)
 
void MacShowUndockedToolbars (bool show)
 
void OnActivate (wxActivateEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnIconize (wxIconizeEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void OnShow (wxShowEvent &event)
 
void OnMove (wxMoveEvent &event)
 
void DoScroll ()
 
void OnScroll (wxScrollEvent &event)
 
void OnCloseWindow (wxCloseEvent &event)
 
void OnTimer (wxTimerEvent &event)
 
void OnToolBarUpdate (wxCommandEvent &event)
 
void OnOpenAudioFile (wxCommandEvent &event)
 
void OnODTaskUpdate (wxCommandEvent &event)
 Handles the redrawing necessary for tasks as they partially update in the background. More...
 
void OnODTaskComplete (wxCommandEvent &event)
 
void HandleResize ()
 
void UpdateLayout ()
 
double GetScreenEndTime () const
 
void ZoomInByFactor (double ZoomFactor)
 
void ZoomOutByFactor (double ZoomFactor)
 
int GetProjectNumber ()
 
void UpdateMenus (bool checkActive=true)
 
void UpdatePrefs ()
 
void UpdatePrefsVariables ()
 
void RedrawProject (const bool bForceWaveTracks=false)
 
void RefreshCursor ()
 
void SelectNone ()
 
void SelectAllIfNone ()
 
void StopIfPaused ()
 
void Zoom (double level)
 
void ZoomBy (double multiplier)
 
void Rewind (bool shift)
 
void SkipEnd (bool shift)
 
void EditByLabel (EditFunction action, bool bSyncLockedTracks)
 
void EditClipboardByLabel (EditDestFunction action)
 
bool IsSyncLocked ()
 
void SetSyncLock (bool flag)
 
void DoTrackMute (Track *pTrack, bool exclusive)
 
void DoTrackSolo (Track *pTrack, bool exclusive)
 
void SetTrackGain (WaveTrack *track, LWSlider *slider)
 
void SetTrackPan (WaveTrack *track, LWSlider *slider)
 
void RemoveTrack (Track *toRemove)
 Removes the specified track. Called from HandleClosing. More...
 
void HandleTrackMute (Track *t, const bool exclusive)
 
void HandleTrackSolo (Track *t, const bool alternate)
 
void SetSnapTo (int snap)
 
int GetSnapTo () const
 
void SetSelectionFormat (const NumericFormatId &format)
 
const NumericFormatIdGetSelectionFormat () const
 
void SetFrequencySelectionFormatName (const NumericFormatId &format)
 
const NumericFormatIdGetFrequencySelectionFormatName () const
 
void SetBandwidthSelectionFormatName (const NumericFormatId &format)
 
const NumericFormatIdGetBandwidthSelectionFormatName () const
 
void OnScrollLeft ()
 
void OnScrollRight ()
 
void OnScrollLeftButton (wxScrollEvent &event)
 
void OnScrollRightButton (wxScrollEvent &event)
 
void FinishAutoScroll ()
 
void FixScrollbars ()
 
bool MayScrollBeyondZero () const
 
double ScrollingLowerBoundTime () const
 
double PixelWidthBeforeTime (double scrollto) const
 
void SetHorizontalThumb (double scrollto)
 
wxSize GetTPTracksUsableArea ()
 
void RefreshTPTrack (Track *pTrk, bool refreshbacking=true)
 
void TP_DisplaySelection () override
 
void TP_DisplayStatusMessage (const wxString &msg) override
 
ToolsToolBarTP_GetToolsToolBar () override
 
void TP_PushState (const wxString &longDesc, const wxString &shortDesc, UndoPush flags) override
 
void TP_ModifyState (bool bWantsAutoSave) override
 
void TP_RedrawScrollbars () override
 
void TP_ScrollLeft () override
 
void TP_ScrollRight () override
 
void TP_ScrollWindow (double scrollto) override
 
bool TP_ScrollUpDown (int delta) override
 
void TP_HandleResize () override
 
ControlToolBarGetControlToolBar ()
 
DeviceToolBarGetDeviceToolBar ()
 
EditToolBarGetEditToolBar ()
 
MixerToolBarGetMixerToolBar ()
 
ScrubbingToolBarGetScrubbingToolBar ()
 
SelectionBarGetSelectionBar ()
 
SpectralSelectionBarGetSpectralSelectionBar ()
 
ToolsToolBarGetToolsToolBar ()
 
const ToolsToolBarGetToolsToolBar () const
 
TranscriptionToolBarGetTranscriptionToolBar ()
 
MeterPanelGetPlaybackMeter ()
 
void SetPlaybackMeter (MeterPanel *playback)
 
MeterPanelGetCaptureMeter ()
 
void SetCaptureMeter (MeterPanel *capture)
 
LyricsWindowGetLyricsWindow ()
 
MixerBoardGetMixerBoard ()
 
wxStatusBar * GetStatusBar ()
 
double AS_GetRate () override
 
void AS_SetRate (double rate) override
 
int AS_GetSnapTo () override
 
void AS_SetSnapTo (int snap) override
 
const NumericFormatIdAS_GetSelectionFormat () override
 
void AS_SetSelectionFormat (const NumericFormatId &format) override
 
void AS_ModifySelection (double &start, double &end, bool done) override
 
double SSBL_GetRate () const override
 
const NumericFormatIdSSBL_GetFrequencySelectionFormatName () override
 
void SSBL_SetFrequencySelectionFormatName (const NumericFormatId &formatName) override
 
const NumericFormatIdSSBL_GetBandwidthSelectionFormatName () override
 
void SSBL_SetBandwidthSelectionFormatName (const NumericFormatId &formatName) override
 
void SSBL_ModifySpectralSelection (double &bottom, double &top, bool done) override
 
void SetStateTo (unsigned int n)
 
bool HandleXMLTag (const wxChar *tag, const wxChar **attrs) override
 
XMLTagHandlerHandleXMLChild (const wxChar *tag) override
 
void WriteXML (XMLWriter &xmlFile, bool bWantSaveCopy)
 
void WriteXMLHeader (XMLWriter &xmlFile) const
 
void OnAudioIORate (int rate) override
 
void OnAudioIOStartRecording () override
 
void OnAudioIOStopRecording () override
 
void OnAudioIONewBlockFiles (const AutoSaveFile &blockFileLog) override
 
bool ReportIfActionNotAllowed (const wxString &Name, CommandFlag &flags, CommandFlag flagsRqd, CommandFlag mask)
 
bool TryToMakeActionAllowed (CommandFlag &flags, CommandFlag flagsRqd, CommandFlag mask)
 
bool UndoAvailable ()
 
bool RedoAvailable ()
 
void PushState (const wxString &desc, const wxString &shortDesc)
 
void PushState (const wxString &desc, const wxString &shortDesc, UndoPush flags)
 
void RollbackState ()
 
void ModifyState (bool bWantsAutoSave)
 
void RecreateMixerBoard ()
 
bool IsSoloSimple () const
 
bool IsSoloNone () const
 
ToolManagerGetToolManager ()
 
void SetNormalizedWindowState (wxRect pSizeAndLocation)
 
wxRect GetNormalizedWindowState () const
 
bool IsTimerRecordCancelled ()
 
void ResetTimerRecordFlag ()
 
ScrubberGetScrubber ()
 
const ScrubberGetScrubber () const
 
PlaybackScrollerGetPlaybackScroller ()
 
std::shared_ptr< BackgroundCellGetBackgroundCell () const
 
bool IsFocused (const wxWindow *window) const
 
- Public Member Functions inherited from TrackPanelListener
 TrackPanelListener ()
 
virtual ~TrackPanelListener ()
 
- Public Member Functions inherited from SelectionBarListener
 SelectionBarListener ()
 
virtual ~SelectionBarListener ()
 
- Public Member Functions inherited from SpectralSelectionBarListener
 SpectralSelectionBarListener ()
 
virtual ~SpectralSelectionBarListener ()
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
bool ReadXMLTag (const char *tag, const char **attrs)
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 
- Public Member Functions inherited from AudioIOListener
 AudioIOListener ()
 
virtual ~AudioIOListener ()
 

Static Public Member Functions

static wxArrayString ShowOpenDialog (const wxString &extraformat=wxEmptyString, const wxString &extrafilter=wxEmptyString)
 Show an open dialogue for opening audio files, and possibly other sorts of files. More...
 
static bool IsAlreadyOpen (const wxString &projPathName)
 
static void OpenFiles (AudacityProject *proj)
 
static AudacityProjectOpenProject (AudacityProject *pProject, const wxString &fileNameArg, bool addtohistory=true)
 
static double OnClipMove (ViewInfo &viewInfo, Track *track, TrackList &trackList, bool syncLocked, bool right)
 
static void DoMacMinimize (AudacityProject *project)
 
static AudacityProjectDoImportMIDI (AudacityProject *pProject, const wxString &fileName)
 
static wxString ClipBoundaryMessage (const std::vector< FoundClipBoundary > &results)
 
static void RebuildAllMenuBars ()
 
static bool HasKeyboardCapture (const wxWindow *handler)
 
static wxWindow * GetKeyboardCaptureHandler ()
 
static void CaptureKeyboard (wxWindow *handler)
 
static void ReleaseKeyboard (wxWindow *handler)
 
static TrackListGetClipboardTracks ()
 
static void ClearClipboard ()
 
static void DeleteClipboard ()
 
static int CountUnnamed ()
 
static void RefreshAllTitles (bool bShowProjectNumbers)
 
static ODLockAllProjectDeleteMutex ()
 Prevents DELETE from external thread - for e.g. use of GetActiveProject. More...
 

Public Attributes

double mLastF0
 
double mLastF1
 
size_t mAlignLabelsCount
 
PlayMode mLastPlayMode { PlayMode::normalPlay }
 
ViewInfo mViewInfo
 
bool mShowSplashScreen
 
wxString mHelpPref
 
wxString mSoloPref
 
bool mbBusyImporting { false }
 
int mBatchMode { 0 }
 
std::unique_ptr< PlaybackScrollermPlaybackScroller
 
wxWindowRef mFocusLender
 

Private Types

enum  SelectionOperation { SELECTION_EXTEND, SELECTION_CONTRACT, CURSOR_MOVE }
 
enum  CursorDirection { DIRECTION_LEFT = -1, DIRECTION_RIGHT = +1 }
 
enum  TimeUnit { TIME_UNIT_SECONDS, TIME_UNIT_PIXELS }
 

Private Member Functions

void EnqueueODTasks ()
 
bool DoSave (bool fromSaveAs, bool bWantSaveCopy, bool bLossless=false)
 
void CreateMenusAndCommands ()
 
void PopulateMacrosMenu (CommandManager *c, CommandFlag flags)
 
void PopulateEffectsMenu (CommandManager *c, EffectType type, CommandFlag batchflags, CommandFlag realflags)
 
void AddEffectMenuItems (CommandManager *c, std::vector< const PluginDescriptor * > &plugs, CommandFlag batchflags, CommandFlag realflags, bool isDefault)
 
void AddEffectMenuItemGroup (CommandManager *c, const wxArrayString &names, const std::vector< bool > &vHasDialog, const PluginIDList &plugs, const std::vector< CommandFlag > &flags, bool isDefault)
 
void CreateRecentFilesMenu (CommandManager *c)
 
void ModifyUndoMenuItems ()
 
void ModifyToolbarMenus ()
 
void ModifyAllProjectToolbarMenus ()
 
CommandFlag GetFocusedFrame ()
 
double NearestZeroCrossing (double t0)
 
void SetTool (int tool)
 Called by handlers that set tools. More...
 
void OnSelectTool (const CommandContext &context)
 Handler to set the select tool active. More...
 
void OnZoomTool (const CommandContext &context)
 Handler to set the Zoom tool active. More...
 
void OnEnvelopeTool (const CommandContext &context)
 Handler to set the Envelope tool active. More...
 
void OnTimeShiftTool (const CommandContext &context)
 Handler to set the Time shift tool active. More...
 
void OnDrawTool (const CommandContext &context)
 
void OnMultiTool (const CommandContext &context)
 
void OnNextTool (const CommandContext &context)
 
void OnPrevTool (const CommandContext &context)
 
bool HandlePasteText ()
 
bool HandlePasteNothingSelected ()
 
int CountSelectedTracks ()
 
bool OnlyHandleKeyUp (const CommandContext &context)
 
void OnCursorMove (double seekStep)
 
void OnBoundaryMove (int step)
 
void SeekLeftOrRight (double direction, SelectionOperation operation)
 
void SeekWhenAudioActive (double seekStep)
 
void SeekWhenAudioInactive (double seekStep, TimeUnit timeUnit, SelectionOperation operation)
 
void MoveWhenAudioInactive (double seekStep, TimeUnit timeUnit)
 
double OffsetTime (double t, double offset, TimeUnit timeUnit, int snapToTime)
 
double GridMove (double t, int minPix)
 
bool SnapSelection ()
 
void OnCapture (wxCommandEvent &evt)
 
void InitialState ()
 
void PopState (const UndoState &state)
 
void UpdateLyrics ()
 
void UpdateMixerBoard ()
 
void GetRegionsByLabel (Regions &regions)
 
void AutoSave ()
 
void DeleteCurrentAutoSaveFile ()
 
double GetZoomOfToFit ()
 
double GetZoomOfSelection ()
 
double GetZoomOfPreset (int preset)
 
void RestartTimer ()
 
void SortTracks (int flags)
 

Static Private Member Functions

static void FinishCopy (const Track *n, Track *dest)
 
static void FinishCopy (const Track *n, Track::Holder &&dest, TrackList &list)
 

Private Attributes

SelectedRegion mRegionSave {}
 
bool mCursorPositionHasBeenStored {false}
 
double mCursorPositionStored
 
wxString mFileName
 
bool mbLoadedFromAup
 
std::shared_ptr< DirManagermDirManager
 
int mProjectNo
 
double mRate
 
sampleFormat mDefaultFormat
 
wxMenu * mRecentFilesMenu
 
std::shared_ptr< TagsmTags
 
std::shared_ptr< TrackListmTracks
 
int mSnapTo
 
NumericFormatId mSelectionFormat
 
NumericFormatId mFrequencySelectionFormatName
 
NumericFormatId mBandwidthSelectionFormatName
 
std::shared_ptr< TrackListmLastSavedTracks
 
std::unique_ptr< UndoManagermUndoManager
 
bool mDirty { false }
 
CommandManager mCommandManager
 
CommandFlag mLastFlags
 
wxString mLastMainStatusMessage
 
std::unique_ptr< wxTimer > mTimer
 
wxStatusBar * mStatusBar
 
AdornedRulerPanelmRuler {}
 
wxPanel * mTopPanel {}
 
TrackPanelmTrackPanel {}
 
SelectionState mSelectionState {}
 
bool mCircularTrackNavigation {}
 
std::unique_ptr< TrackFactorymTrackFactory {}
 
wxPanel * mMainPanel
 
wxScrollBar * mHsbar
 
wxScrollBar * mVsbar
 
bool mAutoScrolling { false }
 
bool mActive { true }
 
bool mIconized
 
MacrosWindowmMacrosWindow {}
 
HistoryWindowmHistoryWindow {}
 
LyricsWindowmLyricsWindow {}
 
MixerBoardFramemMixerBoardFrame {}
 
MixerBoardmMixerBoard {}
 
Destroy_ptr< FreqWindowmFreqWindow
 
Destroy_ptr< ContrastDialogmContrastDialog
 
wxDialog * mAliasMissingWarningDialog {}
 
bool mShownOnce { false }
 
MeterPanelmPlaybackMeter {}
 
MeterPanelmCaptureMeter {}
 
std::unique_ptr< ToolManagermToolManager
 
int mAudioIOToken { -1 }
 
bool mIsDeleting { false }
 
bool mTracksFitVerticallyZoomed { false }
 
bool mNormalizeOnLoad
 
bool mShowId3Dialog { true }
 
bool mEmptyCanBeDirty
 
int mWhatIfNoSelection
 
bool mStopIfWasPaused
 
bool mIsSyncLocked
 
bool mLockPlayRegion
 
std::unique_ptr
< ImportXMLTagHandler
mImportXMLTagHandler
 
wxString mAutoSaveFileName
 
bool mAutoSaving { false }
 
bool mIsRecovered { false }
 
wxString mRecoveryAutoSaveDataDir
 
std::unique_ptr
< RecordingRecoveryHandler
mRecordingRecoveryHandler
 
bool mImportedDependencies { false }
 
wxArrayString mStrOtherNamesArray
 
PluginID mLastEffect {}
 
wxRect mNormalizedWindowState
 
bool mTimerRecordCanceled { false }
 
bool mMenuClose { false }
 
bool mbInitializingScrollbar { false }
 
bool mIsCapturing { false }
 
wxWindow * mKeyboardCaptureHandler {}
 
double mSeekShort
 
double mSeekLong
 
wxLongLong mLastSelectionAdjustment
 
bool mIsBeingDeleted { false }
 
std::unique_ptr< OverlaymIndicatorOverlay
 
std::unique_ptr< OverlaymCursorOverlay
 
std::shared_ptr< BackgroundCellmBackgroundCell
 
std::unique_ptr< OverlaymScrubOverlay
 
std::unique_ptr< ScrubbermScrubber
 

Static Private Attributes

static int mProjectCounter =0
 
static std::shared_ptr< TrackListmsClipboard { TrackList::Create() }
 
static AudacityProjectmsClipProject = NULL
 
static double msClipT0 = 0.0
 
static double msClipT1 = 0.0
 

Friends

class CommandManager
 

Detailed Description

AudacityProject provides the main window, with tools and tracks contained within it.

In Audacity, the main window you work in is called a project. AudacityProjects can contain an arbitrary number of tracks of many different types, but if a project contains just one or two tracks then it can be saved in standard formats like WAV or AIFF. This window is the one that contains the menu bar (except on the Mac).

Attention
The menu functions for AudacityProject, those for creating the menu bars and acting on clicks, are found in file Menus.cpp

Definition at line 176 of file Project.h.

Member Typedef Documentation

typedef std::unique_ptr<Track>(WaveTrack::* AudacityProject::EditDestFunction)(double, double)

Definition at line 415 of file Project.h.

typedef void(WaveTrack::* AudacityProject::EditFunction)(double, double)

Definition at line 414 of file Project.h.

Member Enumeration Documentation

Enumerator
DIRECTION_LEFT 
DIRECTION_RIGHT 

Definition at line 561 of file Project.h.

582  :
583 
Enumerator
OnMoveUpID 
OnMoveDownID 
OnMoveTopID 
OnMoveBottomID 

Definition at line 119 of file Project.h.

Enumerator
SELECTION_EXTEND 
SELECTION_CONTRACT 
CURSOR_MOVE 

Definition at line 555 of file Project.h.

Enumerator
TIME_UNIT_SECONDS 
TIME_UNIT_PIXELS 

Definition at line 566 of file Project.h.

582  :
583 

Constructor & Destructor Documentation

AudacityProject::AudacityProject ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size 
)

Definition at line 922 of file Project.cpp.

References _(), AUDACITY_VERSION_STRING, AudacityProjectTimerID, ThemeBase::Bitmap(), ThemeBase::Colour(), TrackList::Create(), CreateMenusAndCommands(), TrackPanel::FactoryFunction, RefreshCode::FixScrollbars, AudioIO::GetOptimalSupportedSampleRate(), AdornedRulerPanel::GetRulerHeight(), gPrefs, mainStatusBarField, mLastF0, mLastF1, OnCapture(), ViewInfo::OnTimer(), safenew, AudacityApp::SetMissingAliasedFileWarningShouldShow(), theTheme, TrackPanelID, SelectedRegion::UndefinedFrequency, and wxGetApp().

925  : wxFrame(parent, id, _TS("Audacity"), pos, size),
926  mViewInfo(0.0, 1.0, ZoomInfo::GetDefaultZoom()),
927  mbLoadedFromAup( false ),
929  mSnapTo(gPrefs->Read(wxT("/SnapTo"), SNAP_OFF)),
932  gPrefs->Read(wxT("/SelectionFormat"), wxT("")) ) ),
935  gPrefs->Read(wxT("/FrequencySelectionFormatName"), wxT("")) ) ),
938  gPrefs->Read(wxT("/BandwidthSelectionFormatName"), wxT("")) ) ),
939  mUndoManager(std::make_unique<UndoManager>())
940 {
941  if (!gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), &mRate, AudioIO::GetOptimalSupportedSampleRate())) {
942  // The default given above can vary with host/devices. So unless there is an entry for
943  // the default sample rate in audacity.cfg, Audacity can open with a rate which is different
944  // from the rate with which it closed. See bug 1879.
945  gPrefs->Write(wxT("/SamplingRate/DefaultProjectSampleRate"), mRate);
946  gPrefs->Flush();
947  }
948 
950 
951 #ifdef EXPERIMENTAL_DA2
952  SetBackgroundColour(theTheme.Colour( clrMedium ));
953 #endif
954  // Note that the first field of the status bar is a dummy, and it's width is set
955  // to zero latter in the code. This field is needed for wxWidgets 2.8.12 because
956  // if you move to the menu bar, the first field of the menu bar is cleared, which
957  // is undesirable behaviour.
958  // In addition, the help strings of menu items are by default sent to the first
959  // field. Currently there are no such help strings, but it they were introduced, then
960  // there would need to be an event handler to send them to the appropriate field.
961  mStatusBar = CreateStatusBar(4);
962 #if wxUSE_ACCESSIBILITY
963  // so that name can be set on a standard control
964  mStatusBar->SetAccessible(safenew WindowAccessible(mStatusBar));
965 #endif
966  mStatusBar->SetName(wxT("status_line")); // not localized
967  mProjectNo = mProjectCounter++; // Bug 322
968 
970 
971  // MM: DirManager is created dynamically, freed on demand via ref-counting
972  // MM: We don't need to Ref() here because it start with refcount=1
973  mDirManager = std::make_shared<DirManager>();
974 
975  mLastSavedTracks.reset();
976 
977  //
978  // Initialize view info (shared with TrackPanel)
979  //
980 
981  UpdatePrefs();
982 
983  mLockPlayRegion = false;
984 
985  // Make sure valgrind sees mIsSyncLocked is initialized, even
986  // though we're about to set it from prefs.
987  mIsSyncLocked = false;
988  gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
989 
990  // LLL: Read this!!!
991  //
992  // Until the time (and cpu) required to refresh the track panel is
993  // reduced, leave the following window creations in the order specified.
994  // This will place the refresh of the track panel last, allowing all
995  // the others to get done quickly.
996  //
997  // Near as I can tell, this is only a problem under Windows.
998  //
999 
1000 
1001  // PRL: this panel groups the top tool dock and the ruler into one
1002  // tab cycle.
1003  // Must create it with non-default width equal to the main window width,
1004  // or else the device toolbar doesn't make initial widths of the choice
1005  // controls correct.
1007  this, wxID_ANY, wxDefaultPosition,
1008  wxSize{ this->GetSize().GetWidth(), -1 }
1009  };
1010  mTopPanel->SetLabel( "Top Panel" );// Not localised
1011  mTopPanel->SetLayoutDirection(wxLayout_LeftToRight);
1012  mTopPanel->SetAutoLayout(true);
1013 #ifdef EXPERIMENTAL_DA2
1014  mTopPanel->SetBackgroundColour(theTheme.Colour( clrMedium ));
1015 #endif
1016 
1017  //
1018  // Create the ToolDock
1019  //
1020  mToolManager = std::make_unique<ToolManager>( this, mTopPanel );
1021  GetSelectionBar()->SetListener(this);
1022 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
1024 #endif
1025  mToolManager->LayoutToolBars();
1026 
1027  //
1028  // Create the horizontal ruler
1029  //
1031  wxID_ANY,
1032  wxDefaultPosition,
1033  wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
1034  &mViewInfo );
1035  mRuler->SetLayoutDirection(wxLayout_LeftToRight);
1036 
1037  //
1038  // Create the TrackPanel and the scrollbars
1039  //
1040  wxWindow * pPage;
1041 
1042 #ifdef EXPERIMENTAL_NOTEBOOK
1043  // We are using a notebook (tabbed panel), so we create the notebook and add pages.
1044  GuiFactory Factory;
1045  wxNotebook * pNotebook;
1046  mMainPanel = Factory.AddPanel(
1047  this, wxPoint( left, top ), wxSize( width, height ) );
1048  pNotebook = Factory.AddNotebook( mMainPanel );
1049  /* i18n-hint: This is an experimental feature where the main panel in
1050  Audacity is put on a notebook tab, and this is the name on that tab.
1051  Other tabs in that notebook may have instruments, patch panels etc.*/
1052  pPage = Factory.AddPage( pNotebook, _("Main Mix"));
1053 #else
1054  // Not using a notebook, so we place the track panel inside another panel,
1055  // this keeps the notebook code and normal code consistant and also
1056  // paves the way for adding additional windows inside the track panel.
1057  mMainPanel = safenew wxPanelWrapper(this, -1,
1058  wxDefaultPosition,
1059  wxDefaultSize,
1060  wxNO_BORDER);
1061  mMainPanel->SetSizer( safenew wxBoxSizer(wxVERTICAL) );
1062  mMainPanel->SetLabel("Main Panel");// Not localised.
1063  pPage = mMainPanel;
1064  // Set the colour here to the track panel background to avoid
1065  // flicker when Audacity starts up.
1066  // However, that leads to areas next to the horizontal scroller
1067  // being painted in background colour and not scroller background
1068  // colour, so suppress this for now.
1069  //pPage->SetBackgroundColour( theTheme.Colour( clrDark ));
1070 #endif
1071  pPage->SetLayoutDirection(wxLayout_LeftToRight);
1072 
1073 #ifdef EXPERIMENTAL_DA2
1074  pPage->SetBackgroundColour(theTheme.Colour( clrMedium ));
1075 #endif
1076 
1077  {
1078  auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
1079  ubs->Add(mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_TOP);
1080  ubs->Add(mRuler, 0, wxEXPAND);
1081  mTopPanel->SetSizer(ubs.release());
1082  }
1083 
1084  wxBoxSizer *bs;
1085  {
1086  auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
1087  bs = ubs.get();
1088  bs->Add(mTopPanel, 0, wxEXPAND | wxALIGN_TOP);
1089  bs->Add(pPage, 1, wxEXPAND);
1090  bs->Add(mToolManager->GetBotDock(), 0, wxEXPAND);
1091  SetAutoLayout(true);
1092  SetSizer(ubs.release());
1093  }
1094  bs->Layout();
1095 
1096  // The right hand side translates to NEW TrackPanel(...) in normal
1097  // Audacity without additional DLLs.
1099  TrackPanelID,
1100  wxDefaultPosition,
1101  wxDefaultSize,
1102  mTracks,
1103  &mViewInfo,
1104  this,
1105  mRuler);
1107 
1108  mIndicatorOverlay = std::make_unique<PlayIndicatorOverlay>(this);
1109 
1110  mCursorOverlay = std::make_unique<EditCursorOverlay>(this);
1111 
1112  mBackgroundCell = std::make_shared<BackgroundCell>(this);
1113 
1114 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
1115  mScrubOverlay = std::make_unique<ScrubbingOverlay>(this);
1116  mScrubber = std::make_unique<Scrubber>(this);
1117 #endif
1118 
1119  // More order dependencies here...
1120  // This must follow construction of *mIndicatorOverlay, because it must
1121  // attach its timer event handler later (so that its handler is invoked
1122  // earlier)
1123  mPlaybackScroller = std::make_unique<PlaybackScroller>(this);
1124 
1125  // This must follow construction of *mPlaybackScroller,
1126  // because it must
1127  // attach its timer event handler later (so that its handler is invoked
1128  // earlier)
1129  this->Bind(EVT_TRACK_PANEL_TIMER,
1131  &mViewInfo);
1132 
1133  // Add the overlays, in the sequence in which they will be painted
1135  mTrackPanel->AddOverlay(mCursorOverlay.get());
1136 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
1137  mTrackPanel->AddOverlay(mScrubOverlay.get());
1138 #endif
1139 
1141 
1142  mTrackPanel->SetBackgroundCell(mBackgroundCell);
1143 
1144  // LLL: When Audacity starts or becomes active after returning from
1145  // another application, the first window that can accept focus
1146  // will be given the focus even if we try to SetFocus(). By
1147  // creating the scrollbars after the TrackPanel, we resolve
1148  // several focus problems.
1149  mHsbar = safenew ScrollBar(pPage, HSBarID, wxSB_HORIZONTAL);
1150  mVsbar = safenew ScrollBar(pPage, VSBarID, wxSB_VERTICAL);
1151 #if wxUSE_ACCESSIBILITY
1152  // so that name can be set on a standard control
1153  mHsbar->SetAccessible(safenew WindowAccessible(mHsbar));
1154  mVsbar->SetAccessible(safenew WindowAccessible(mVsbar));
1155 #endif
1156  mHsbar->SetLayoutDirection(wxLayout_LeftToRight);
1157  mHsbar->SetName(_("Horizontal Scrollbar"));
1158  mVsbar->SetName(_("Vertical Scrollbar"));
1159  // LLL: When Audacity starts or becomes active after returning from
1160  // another application, the first window that can accept focus
1161  // will be given the focus even if we try to SetFocus(). By
1162  // making the TrackPanel that first window, we resolve several
1163  // keyboard focus problems.
1164  pPage->MoveBeforeInTabOrder(mTopPanel);
1165 
1166  bs = (wxBoxSizer *)pPage->GetSizer();
1167 
1168  {
1169  // Top horizontal grouping
1170  auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1171 
1172  // Track panel
1173  hs->Add(mTrackPanel, 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP);
1174 
1175  {
1176  // Vertical grouping
1177  auto vs = std::make_unique<wxBoxSizer>(wxVERTICAL);
1178 
1179  // Vertical scroll bar
1180  vs->Add(mVsbar, 1, wxEXPAND | wxALIGN_TOP);
1181  hs->Add(vs.release(), 0, wxEXPAND | wxALIGN_TOP);
1182  }
1183 
1184  bs->Add(hs.release(), 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP);
1185  }
1186 
1187  {
1188  // Bottom horizontal grouping
1189  auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1190 
1191  // Bottom scrollbar
1192  hs->Add(mTrackPanel->GetLeftOffset() - 1, 0);
1193  hs->Add(mHsbar, 1, wxALIGN_BOTTOM);
1194  hs->Add(mVsbar->GetSize().GetWidth(), 0);
1195  bs->Add(hs.release(), 0, wxEXPAND | wxALIGN_LEFT);
1196  }
1197 
1198  // Lay it out
1199  pPage->SetAutoLayout(true);
1200  pPage->Layout();
1201 
1202 #ifdef EXPERIMENTAL_NOTEBOOK
1203  AddPages(this, Factory, pNotebook);
1204 #endif
1205 
1206  mMainPanel->Layout();
1207 
1208  wxASSERT( mTrackPanel->GetProject()==this);
1209 
1210  // MM: Give track panel the focus to ensure keyboard commands work
1211  mTrackPanel->SetFocus();
1212 
1213  // Create tags object
1214  mTags = std::make_shared<Tags>();
1215 
1216  InitialState();
1217  FixScrollbars();
1218  mRuler->SetLeftOffset(mTrackPanel->GetLeftOffset()); // bevel on AdornedRuler
1219 
1220  //
1221  // Set the Icon
1222  //
1223 
1224  // loads either the XPM or the windows resource, depending on the platform
1225 #if !defined(__WXMAC__) && !defined(__WXX11__)
1226  {
1227 #if defined(__WXMSW__)
1228  wxIcon ic{ wxICON(AudacityLogo) };
1229 #elif defined(__WXGTK__)
1230  wxIcon ic{wxICON(AudacityLogoAlpha)};
1231 #else
1232  wxIcon ic{};
1233  ic.CopyFromBitmap(theTheme.Bitmap(bmpAudacityLogo48x48));
1234 #endif
1235  SetIcon(ic);
1236  }
1237 #endif
1238  mIconized = false;
1239 
1241 
1242  int widths[] = {0, GetControlToolBar()->WidthForStatusBar(mStatusBar), -1, 150};
1243  mStatusBar->SetStatusWidths(4, widths);
1244  wxString msg = wxString::Format(_("Welcome to Audacity version %s"),
1246  mStatusBar->SetStatusText(msg, mainStatusBarField);
1248 
1249  mTimer = std::make_unique<wxTimer>(this, AudacityProjectTimerID);
1250  RestartTimer();
1251 
1252 #if wxUSE_DRAG_AND_DROP
1253  // We can import now, so become a drag target
1254 // SetDropTarget(safenew AudacityDropTarget(this));
1255 // mTrackPanel->SetDropTarget(safenew AudacityDropTarget(this));
1256 
1257  // SetDropTarget takes ownership
1258  mTrackPanel->SetDropTarget(safenew DropTarget(this));
1259 #endif
1260 
1261  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
1263  this);
1264 
1265  //Initialize the last selection adjustment time.
1266  mLastSelectionAdjustment = ::wxGetLocalTimeMillis();
1267 #ifdef EXPERIMENTAL_DA2
1268  ClearBackground();// For wxGTK.
1269 #endif
1271 }
std::unique_ptr< Overlay > mIndicatorOverlay
Definition: Project.h:797
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool mbLoadedFromAup
Definition: Project.h:615
#define AUDACITY_VERSION_STRING
Definition: Audacity.h:81
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
void InitialState()
Definition: Project.cpp:4707
std::unique_ptr< PlaybackScroller > mPlaybackScroller
Definition: Project.h:833
double mLastF1
Definition: Project.h:306
bool mIsSyncLocked
Definition: Project.h:739
bool mIconized
Definition: Project.h:684
std::unique_ptr< wxTimer > mTimer
Definition: Project.h:668
void SetMissingAliasedFileWarningShouldShow(bool b)
Changes the behavior of missing aliased blockfiles warnings.
wxScrollBar * mVsbar
Definition: Project.h:681
void SetListener(SpectralSelectionBarListener *l)
bool mLockPlayRegion
Definition: Project.h:741
void UpdatePrefs()
Definition: TrackPanel.cpp:387
std::unique_ptr< Scrubber > mScrubber
Definition: Project.h:803
#define _TS(s)
Definition: Internat.h:30
sampleFormat mDefaultFormat
Definition: Project.h:622
std::shared_ptr< DirManager > mDirManager
Definition: Project.h:616
int GetRulerHeight()
Definition: Ruler.h:326
void OnCapture(wxCommandEvent &evt)
Definition: Project.cpp:1450
std::unique_ptr< TrackFactory > mTrackFactory
Definition: Project.h:678
static int GetOptimalSupportedSampleRate()
Get a supported sample rate which can be used a an optimal default.
Definition: AudioIO.cpp:3082
SpectralSelectionBar * GetSpectralSelectionBar()
Definition: Project.cpp:5095
std::unique_ptr< Overlay > mCursorOverlay
Definition: Project.h:797
#define safenew
Definition: Audacity.h:230
DropTarget, derived from wxFileDropTarget gives drag and drop functionality for audio files...
static std::shared_ptr< TrackList > Create()
Definition: Track.cpp:792
Used to create a WaveTrack, or a LabelTrack.. Implementation of the functions of this class are dispe...
Definition: Track.h:867
std::shared_ptr< Tags > mTags
Definition: Project.h:631
wxBitmap & Bitmap(int iIndex)
Definition: Theme.cpp:1244
void UpdateStatusBar(AudacityProject *pProject)
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void FixScrollbars()
Definition: Project.cpp:1930
std::shared_ptr< TrackList > mLastSavedTracks
Definition: Project.h:641
std::shared_ptr< BackgroundCell > mBackgroundCell
Definition: Project.h:799
double mRate
Definition: Project.h:621
AdornedRulerPanel * mRuler
Definition: Project.h:673
static NumericFormatId LookupFormat(Type type, const wxString &id)
void SetListener(SelectionBarListener *l)
NumericFormatId mSelectionFormat
Definition: Project.h:637
std::unique_ptr< UndoManager > mUndoManager
Definition: Project.h:656
ViewInfo mViewInfo
Definition: Project.h:560
const int AudacityProjectTimerID
Definition: Project.h:49
std::unique_ptr< Overlay > mScrubOverlay
Definition: Project.h:802
void SetBackgroundCell(const std::shared_ptr< TrackPanelCell > &pCell)
void UpdatePrefs()
Definition: Project.cpp:1376
NumericFormatId mFrequencySelectionFormatName
Definition: Project.h:638
void AddOverlay(Overlay *pOverlay)
void OnTimer(wxCommandEvent &event)
Definition: ViewInfo.cpp:203
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
int WidthForStatusBar(wxStatusBar *const)
wxStatusBar * mStatusBar
Definition: Project.h:671
ControlToolBar * GetControlToolBar()
Definition: Project.cpp:5041
Definition: Snap.h:52
AudacityProject * GetProject() const override
Definition: TrackPanel.cpp:426
static double GetDefaultZoom()
Definition: ViewInfo.h:85
wxScrollBar * mHsbar
Definition: Project.h:680
std::unique_ptr< ToolManager > mToolManager
Definition: Project.h:704
wxPanel * mTopPanel
Definition: Project.h:674
static int mProjectCounter
Definition: Project.h:618
SelectionBar * GetSelectionBar()
Definition: Project.cpp:5086
This is an Audacity Specific ruler panel which additionally has border, selection markers...
Definition: Ruler.h:313
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
int GetLeftOffset() const
Definition: TrackPanel.h:270
void CreateMenusAndCommands()
Definition: Menus.cpp:303
AudacityApp & wxGetApp()
static sampleFormat SampleFormatChoice()
static TrackPanel *(* FactoryFunction)(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const std::shared_ptr< TrackList > &tracks, ViewInfo *viewInfo, TrackPanelListener *listener, AdornedRulerPanel *ruler)
Definition: TrackPanel.h:361
double mLastF0
Definition: Project.h:305
static const int UndefinedFrequency
std::shared_ptr< TrackList > mTracks
Definition: Project.h:634
wxLongLong mLastSelectionAdjustment
Definition: Project.h:787
TrackPanel * mTrackPanel
Definition: Project.h:675
void SetLeftOffset(int offset)
Definition: Ruler.cpp:3608
wxPanel * mMainPanel
Definition: Project.h:679
NumericFormatId mBandwidthSelectionFormatName
Definition: Project.h:639
void RestartTimer()
Definition: Project.cpp:5157
AudacityProject::~AudacityProject ( )
virtual

Definition at line 1273 of file Project.cpp.

References AudacityApp::GetRecentFiles(), mCursorOverlay, mIndicatorOverlay, mRecentFilesMenu, mScrubOverlay, mTrackPanel, FileHistory::RemoveMenu(), OverlayPanel::RemoveOverlay(), and wxGetApp().

1274 {
1275  // Tool manager gives us capture sometimes
1276  if(HasCapture())
1277  ReleaseMouse();
1278 
1279  if (wxGetApp().GetRecentFiles())
1280  {
1282  }
1283 
1284  if(mTrackPanel) {
1285 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
1287 #endif
1290  }
1291 }
std::unique_ptr< Overlay > mIndicatorOverlay
Definition: Project.h:797
wxMenu * mRecentFilesMenu
Definition: Project.h:625
bool RemoveOverlay(Overlay *pOverlay)
std::unique_ptr< Overlay > mCursorOverlay
Definition: Project.h:797
std::unique_ptr< Overlay > mScrubOverlay
Definition: Project.h:802
void RemoveMenu(wxMenu *menu)
FileHistory * GetRecentFiles()
Definition: AudacityApp.h:154
AudacityApp & wxGetApp()
TrackPanel * mTrackPanel
Definition: Project.h:675

Member Function Documentation

void AudacityProject::AddEffectMenuItemGroup ( CommandManager c,
const wxArrayString &  names,
const std::vector< bool > &  vHasDialog,
const PluginIDList plugs,
const std::vector< CommandFlag > &  flags,
bool  isDefault 
)
private

Definition at line 1988 of file Menus.cpp.

References _(), CommandManager::AddItem(), CommandManager::BeginSubMenu(), CommandManager::EndSubMenu(), FN, PluginManager::Get(), PluginDescriptor::GetPath(), PluginManager::GetPlugin(), PluginDescriptor::GetPluginType(), gPrefs, name, OnEffect(), and PluginTypeEffect.

Referenced by AddEffectMenuItems().

1994 {
1995  int namesCnt = (int) names.GetCount();
1996  int perGroup;
1997 
1998 #if defined(__WXGTK__)
1999  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 15);
2000 #else
2001  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 0);
2002 #endif
2003 
2004  int groupCnt = namesCnt;
2005  for (int i = 0; i < namesCnt; i++)
2006  {
2007  while (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
2008  {
2009  i++;
2010  groupCnt--;
2011  }
2012  }
2013 
2014  // The "default" effects shouldn't be broken into subgroups
2015  if (namesCnt > 0 && isDefault)
2016  {
2017  perGroup = 0;
2018  }
2019 
2020  int max = perGroup;
2021  int items = perGroup;
2022 
2023  if (max > groupCnt)
2024  {
2025  max = 0;
2026  }
2027 
2028  int groupNdx = 0;
2029  for (int i = 0; i < namesCnt; i++)
2030  {
2031  if (max > 0 && items == max)
2032  {
2033  int end = groupNdx + max;
2034  if (end + 1 > groupCnt)
2035  {
2036  end = groupCnt;
2037  }
2038  c->BeginSubMenu(wxString::Format(_("Plug-in %d to %d"),
2039  groupNdx + 1,
2040  end));
2041  }
2042 
2043  if (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
2044  {
2045  wxString name = names[i];
2046  c->BeginSubMenu(name);
2047  while (i < namesCnt && names[i].IsSameAs(name))
2048  {
2049  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2050  wxString item = plug->GetPath();
2051  if( plug->GetPluginType() == PluginTypeEffect )
2052  c->AddItem(item,
2053  item,
2054  item.Contains("..."),
2055  FN(OnEffect),
2056  flags[i],
2057  flags[i], true, plugs[i]);
2058 
2059  i++;
2060  }
2061  c->EndSubMenu();
2062  i--;
2063  }
2064  else
2065  {
2066  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2067  if( plug->GetPluginType() == PluginTypeEffect )
2068  c->AddItem(names[i],
2069  names[i],
2070  vHasDialog[i],
2071  FN(OnEffect),
2072  flags[i],
2073  flags[i], true, plugs[i]);
2074  }
2075 
2076  if (max > 0)
2077  {
2078  groupNdx++;
2079  items--;
2080  if (items == 0 || i + 1 == namesCnt)
2081  {
2082  c->EndSubMenu();
2083  items = max;
2084  }
2085  }
2086  }
2087 
2088  return;
2089 }
static wxArrayString names()
Definition: Tags.cpp:703
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
wxMenu * BeginSubMenu(const wxString &tName)
void AddItem(const wxChar *name, const wxChar *label, bool hasDialog, CommandHandlerFinder finder, CommandFunctorPointer callback, CommandFlag flags=NoFlagsSpecifed, CommandMask mask=NoFlagsSpecifed, bool bIsEffect=false, const CommandParameter &parameter=CommandParameter{})
const wxString & GetPath() const
#define FN(X)
Definition: Menus.cpp:300
void OnEffect(const CommandContext &context)
Definition: Menus.cpp:4664
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
const wxChar * name
Definition: Distortion.cpp:94
PluginType GetPluginType() const
static PluginManager & Get()
const PluginDescriptor * GetPlugin(const PluginID &ID)
void AudacityProject::AddEffectMenuItems ( CommandManager c,
std::vector< const PluginDescriptor * > &  plugs,
CommandFlag  batchflags,
CommandFlag  realflags,
bool  isDefault 
)
private

Definition at line 1847 of file Menus.cpp.

References _(), AddEffectMenuItemGroup(), CommandManager::BeginSubMenu(), CommandManager::EndSubMenu(), EffectManager::Get(), EffectManager::GetEffectFamilyName(), PluginDescriptor::GetID(), PluginDescriptor::GetSymbol(), EffectManager::GetVendorName(), gPrefs, PluginDescriptor::IsEffectDefault(), PluginDescriptor::IsEffectInteractive(), PluginDescriptor::IsEffectRealtime(), IdentInterfaceSymbol::Msgid(), name, and IdentInterfaceSymbol::Translation().

Referenced by PopulateEffectsMenu().

1852 {
1853  size_t pluginCnt = plugs.size();
1854 
1855  wxString groupBy = gPrefs->Read(wxT("/Effects/GroupBy"), wxT("name"));
1856 
1857  bool grouped = false;
1858  if (groupBy.StartsWith(wxT("groupby")))
1859  {
1860  grouped = true;
1861  }
1862 
1863  std::vector<bool> vHasDialog;
1864  wxArrayString groupNames;
1865  PluginIDList groupPlugs;
1866  std::vector<CommandFlag> groupFlags;
1867  if (grouped)
1868  {
1869  wxString last;
1870  wxString current;
1871 
1872  for (size_t i = 0; i < pluginCnt; i++)
1873  {
1874  const PluginDescriptor *plug = plugs[i];
1875 
1876  bool hasDialog = plug->GetSymbol().Msgid().Contains("...");
1877  auto name = plug->GetSymbol().Translation();
1878 
1879  if (plug->IsEffectInteractive())
1880  {
1881  name += wxT("...");
1882  }
1883 
1884  if (groupBy == wxT("groupby:publisher"))
1885  {
1886  current = EffectManager::Get().GetVendorName(plug->GetID());
1887  if (current.IsEmpty())
1888  {
1889  current = _("Unknown");
1890  }
1891  }
1892  else if (groupBy == wxT("groupby:type"))
1893  {
1894  current = EffectManager::Get().GetEffectFamilyName(plug->GetID());
1895  if (current.IsEmpty())
1896  {
1897  current = _("Unknown");
1898  }
1899  }
1900 
1901  if (current != last)
1902  {
1903  bool bInSubmenu = !last.IsEmpty() && (groupNames.Count() > 1);
1904  if( bInSubmenu)
1905  c->BeginSubMenu(last);
1906 
1907  AddEffectMenuItemGroup(c, groupNames, vHasDialog,
1908  groupPlugs, groupFlags, isDefault);
1909 
1910  if (bInSubmenu)
1911  c->EndSubMenu();
1912 
1913  groupNames.Clear();
1914  vHasDialog.clear();
1915  groupPlugs.Clear();
1916  groupFlags.clear();
1917  last = current;
1918  }
1919 
1920  groupNames.Add(name);
1921  vHasDialog.push_back(hasDialog);
1922  groupPlugs.Add(plug->GetID());
1923  groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags);
1924  }
1925 
1926  if (groupNames.GetCount() > 0)
1927  {
1928  bool bInSubmenu = groupNames.Count() > 1;
1929  if (bInSubmenu)
1930  c->BeginSubMenu(current);
1931 
1932  AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault);
1933 
1934  if (bInSubmenu)
1935  c->EndSubMenu();
1936  }
1937  }
1938  else
1939  {
1940  for (size_t i = 0; i < pluginCnt; i++)
1941  {
1942  const PluginDescriptor *plug = plugs[i];
1943 
1944  bool hasDialog = plug->GetSymbol().Msgid().Contains("...");
1945  auto name = plug->GetSymbol().Translation();
1946 
1947  if (plug->IsEffectInteractive())
1948  {
1949  name += wxT("...");
1950  }
1951 
1952  wxString group = wxEmptyString;
1953  if (groupBy == wxT("sortby:publisher:name"))
1954  {
1955  group = EffectManager::Get().GetVendorName(plug->GetID());
1956  }
1957  else if (groupBy == wxT("sortby:type:name"))
1958  {
1959  group = EffectManager::Get().GetEffectFamilyName(plug->GetID());
1960  }
1961 
1962  if (plug->IsEffectDefault())
1963  {
1964  group = wxEmptyString;
1965  }
1966 
1967  if (!group.IsEmpty())
1968  {
1969  group += wxT(": ");
1970  }
1971 
1972  groupNames.Add(group + name);
1973  vHasDialog.push_back(hasDialog);
1974  groupPlugs.Add(plug->GetID());
1975  groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags);
1976  }
1977 
1978  if (groupNames.GetCount() > 0)
1979  {
1980  AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault);
1981  }
1982 
1983  }
1984 
1985  return;
1986 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
wxMenu * BeginSubMenu(const wxString &tName)
void AddEffectMenuItemGroup(CommandManager *c, const wxArrayString &names, const std::vector< bool > &vHasDialog, const PluginIDList &plugs, const std::vector< CommandFlag > &flags, bool isDefault)
Definition: Menus.cpp:1988
wxString GetEffectFamilyName(const PluginID &ID)
bool IsEffectInteractive() const
wxArrayString PluginIDList
const wxString & Translation() const
bool IsEffectRealtime() const
wxString GetVendorName(const PluginID &ID)
const IdentInterfaceSymbol & GetSymbol() const
static EffectManager & Get()
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
bool IsEffectDefault() const
const wxChar * name
Definition: Distortion.cpp:94
const wxString & GetID() const
const wxString & Msgid() const
std::vector< std::shared_ptr< Track > > AudacityProject::AddImportedTracks ( const wxString &  fileName,
TrackHolders &&  newTracks 
)

Definition at line 4315 of file Project.cpp.

References _(), SeqBlock::f, GetSelectionBar(), IsProjectSaved(), mbLoadedFromAup, mFileName, mImportedDependencies, mRate, mTracks, Track::Pointer(), PushState(), SelectNone(), SetProjectTitle(), SelectionBar::SetRate(), and Track::Wave.

Referenced by Import(), and OnImportRaw().

4317 {
4318  std::vector< std::shared_ptr< Track > > results;
4319 
4320  const auto numTracks = newTracks.size();
4321  SelectNone();
4322 
4323  bool initiallyEmpty = mTracks->empty();
4324  double newRate = 0;
4325  wxString trackNameBase = fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast('.');
4326  bool isLinked = false;
4327  int i = -1;
4328  for (auto &uNewTrack : newTracks) {
4329  ++i;
4330 
4331  auto newTrack = mTracks->Add(std::move(uNewTrack));
4332  results.push_back(Track::Pointer(newTrack));
4333  if (newRate == 0 && newTrack->GetKind() == Track::Wave) {
4334  newRate = ((WaveTrack *)newTrack)->GetRate();
4335  }
4336  newTrack->SetSelected(true);
4337  //we need to check link status based on the first channel only.
4338  if(0==i)
4339  isLinked = newTrack->GetLinked();
4340  if (numTracks > 2 || (numTracks > 1 && !isLinked) ) {
4341  newTrack->SetName(trackNameBase + wxString::Format(wxT(" %d" ), i + 1));
4342  }
4343  else {
4344  newTrack->SetName(trackNameBase);
4345  }
4346 
4347  // Check if NEW track contains aliased blockfiles and if yes,
4348  // remember this to show a warning later
4349  if (newTrack->GetKind() == WaveTrack::Wave)
4350  {
4351  if (WaveClip* clip = ((WaveTrack*)newTrack)->GetClipByIndex(0)) {
4352  BlockArray &blocks = clip->GetSequence()->GetBlockArray();
4353  if (blocks.size())
4354  {
4355  SeqBlock& block = blocks[0];
4356  if (block.f->IsAlias())
4357  {
4358  mImportedDependencies = true;
4359  }
4360  }
4361  }
4362  }
4363  }
4364 
4365  // Automatically assign rate of imported file to whole project,
4366  // if this is the first file that is imported
4367  if (initiallyEmpty && newRate > 0) {
4368  mRate = newRate;
4370  }
4371 
4372  PushState(wxString::Format(_("Imported '%s'"), fileName),
4373  _("Import"));
4374 
4375 #if defined(__WXGTK__)
4376  // See bug #1224
4377  // The track panel hasn't we been fully created, so the OnZoomFit() will not give
4378  // expected results due to a window width of zero. Should be safe to yield here to
4379  // allow the creattion to complete. If this becomes a problem, it "might" be possible
4380  // to queue a dummy event to trigger the OnZoomFit().
4381  wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT);
4382 #endif
4383 
4384  if (initiallyEmpty && !IsProjectSaved() ) {
4385  wxString name = fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.'));
4386  mFileName =::wxPathOnly(fileName) + wxFILE_SEP_PATH + name + wxT(".aup");
4387  mbLoadedFromAup = false;
4388  SetProjectTitle();
4389  }
4390 
4391  // Moved this call to higher levels to prevent flicker redrawing everything on each file.
4392  // HandleResize();
4393 
4394  newTracks.clear();
4395 
4396  return results;
4397 }
Data structure containing pointer to a BlockFile and a start time. Element of a BlockArray.
Definition: Sequence.h:31
bool mbLoadedFromAup
Definition: Project.h:615
void SetRate(double rate)
wxString mFileName
Definition: Project.h:614
bool mImportedDependencies
Definition: Project.h:761
void SetProjectTitle(int number=-1)
Definition: Project.cpp:1510
double mRate
Definition: Project.h:621
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:176
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void PushState(const wxString &desc, const wxString &shortDesc)
Definition: Project.cpp:4740
const wxChar * name
Definition: Distortion.cpp:94
void SelectNone()
Definition: Menus.cpp:6342
BlockFilePtr f
Definition: Sequence.h:33
bool IsProjectSaved()
Definition: Project.cpp:6046
SelectionBar * GetSelectionBar()
Definition: Project.cpp:5086
static std::shared_ptr< Subclass > Pointer(Track *t)
Definition: Track.h:137
std::shared_ptr< TrackList > mTracks
Definition: Project.h:634
double AudacityProject::AdjustForFindingEndTimes ( const std::vector< const WaveClip * > &  clips,
double  time 
)

Definition at line 7706 of file Menus.cpp.

Referenced by FindNextClipBoundary(), and FindPrevClipBoundary().

7707 {
7708  auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
7709  return clip->GetStartTime() == time; });
7710  if (q != clips.end() && q != clips.begin() &&
7711  (*(q - 1))->SharesBoundaryWithNextClip(*q)) {
7712  time = (*(q-1))->GetEndTime();
7713  }
7714 
7715  return time;
7716 }
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:176
double AudacityProject::AdjustForFindingStartTimes ( const std::vector< const WaveClip * > &  clips,
double  time 
)

Definition at line 7688 of file Menus.cpp.

Referenced by FindNextClip(), FindNextClipBoundary(), FindPrevClip(), and FindPrevClipBoundary().

7689 {
7690  auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
7691  return clip->GetEndTime() == time; });
7692  if (q != clips.end() && q + 1 != clips.end() &&
7693  (*q)->SharesBoundaryWithNextClip(*(q+1))) {
7694  time = (*(q+1))->GetStartTime();
7695  }
7696 
7697  return time;
7698 }
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:176
ODLock & AudacityProject::AllProjectDeleteMutex ( )
static

Prevents DELETE from external thread - for e.g. use of GetActiveProject.

Definition at line 184 of file Project.cpp.

Referenced by ODTask::DoSome(), OnCloseWindow(), and ODManager::Start().

185 {
186  static ODLock theMutex;
187  return theMutex;
188 };
void AudacityProject::ApplyUpdatedTheme ( )
virtual

Definition at line 1293 of file Project.cpp.

References TrackPanel::ApplyUpdatedTheme(), ThemeBase::Colour(), mTrackPanel, and theTheme.

Referenced by Theme::ApplyUpdatedImages().

1294 {
1295  SetBackgroundColour(theTheme.Colour( clrMedium ));
1296  ClearBackground();// For wxGTK.
1298 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
void ApplyUpdatedTheme()
Definition: TrackPanel.cpp:408
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
TrackPanel * mTrackPanel
Definition: Project.h:675
double AudacityProject::AS_GetRate ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1572 of file Project.cpp.

References mRate.

1573 {
1574  return mRate;
1575 }
double mRate
Definition: Project.h:621
const NumericFormatId & AudacityProject::AS_GetSelectionFormat ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1603 of file Project.cpp.

References GetSelectionFormat().

1604 {
1605  return GetSelectionFormat();
1606 }
const NumericFormatId & GetSelectionFormat() const
Definition: Project.cpp:1719
int AudacityProject::AS_GetSnapTo ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1584 of file Project.cpp.

References GetSnapTo().

1585 {
1586  return GetSnapTo();
1587 }
int GetSnapTo() const
Definition: Project.cpp:5703
void AudacityProject::AS_ModifySelection ( double &  start,
double &  end,
bool  done 
)
overridevirtual

Implements SelectionBarListener.

Definition at line 1725 of file Project.cpp.

References ModifyState(), mTrackPanel, mViewInfo, TrackPanel::Refresh(), ViewInfo::selectedRegion, and SelectedRegion::setTimes().

1726 {
1727  mViewInfo.selectedRegion.setTimes(start, end);
1728  mTrackPanel->Refresh(false);
1729  if (done) {
1730  ModifyState(false);
1731  }
1732 }
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
ViewInfo mViewInfo
Definition: Project.h:560
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
void ModifyState(bool bWantsAutoSave)
Definition: Project.cpp:4785
bool setTimes(double t0, double t1)
TrackPanel * mTrackPanel
Definition: Project.h:675
void AudacityProject::AS_SetRate ( double  rate)
overridevirtual

Implements SelectionBarListener.

Definition at line 1579 of file Project.cpp.

References mRate.

1580 {
1581  mRate = rate;
1582 }
double mRate
Definition: Project.h:621
void AudacityProject::AS_SetSelectionFormat ( const NumericFormatId format)
overridevirtual

Implements SelectionBarListener.

Definition at line 1608 of file Project.cpp.

References format, GetTrackPanel(), gPrefs, IdentInterfaceSymbol::Internal(), mSelectionFormat, TrackPanel::Refresh(), and SnapSelection().

Referenced by SetSelectionFormat().

1609 {
1611 
1612  gPrefs->Write(wxT("/SelectionFormat"), mSelectionFormat.Internal());
1613  gPrefs->Flush();
1614 
1615  if (SnapSelection() && GetTrackPanel())
1616  GetTrackPanel()->Refresh(false);
1617 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1544
int format
Definition: ExportPCM.cpp:56
NumericFormatId mSelectionFormat
Definition: Project.h:637
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
const wxString & Internal() const
TrackPanel * GetTrackPanel()
Definition: Project.h:308
void AudacityProject::AS_SetSnapTo ( int  snap)
overridevirtual

Implements SelectionBarListener.

Definition at line 1589 of file Project.cpp.

References gPrefs, mSnapTo, RedrawProject(), and SnapSelection().

Referenced by SetSnapTo().

1590 {
1591  mSnapTo = snap;
1592 
1593 // LLL: TODO - what should this be changed to???
1594 // mCommandManager.Check(wxT("Snap"), mSnapTo);
1595  gPrefs->Write(wxT("/SnapTo"), mSnapTo);
1596  gPrefs->Flush();
1597 
1598  SnapSelection();
1599 
1600  RedrawProject();
1601 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1410
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1544
void AudacityProject::AutoSave ( )
private

Definition at line 5507 of file Project.cpp.

References _(), AudacityMessageBox(), FileNames::AutoSaveDir(), CreateUniqueName(), DeleteCurrentAutoSaveFile(), mAutoSaveFileName, mAutoSaving, mFileName, mStrOtherNamesArray, AutoSaveFile::Write(), WriteXML(), and WriteXMLHeader().

Referenced by ModifyState(), OnAudioIOStartRecording(), OnAudioIOStopRecording(), PopState(), and PushState().

5508 {
5509  // SonifyBeginAutoSave(); // part of RBD's r10680 stuff now backed out
5510 
5511  // To minimize the possibility of race conditions, we first write to a
5512  // file with the extension ".tmp", then rename the file to .autosave
5513  wxString projName;
5514 
5515  if (mFileName.IsEmpty())
5516  projName = wxT("New Project");
5517  else
5518  projName = wxFileName(mFileName).GetName();
5519 
5520  wxString fn = wxFileName(FileNames::AutoSaveDir(),
5521  projName + wxString(wxT(" - ")) + CreateUniqueName()).GetFullPath();
5522 
5523  // PRL: I found a try-catch and rewrote it,
5524  // but this guard is unnecessary because AutoSaveFile does not throw
5525  bool success = GuardedCall< bool >( [&]
5526  {
5527  VarSetter<bool> setter(&mAutoSaving, true, false);
5528 
5529  AutoSaveFile buffer;
5530  WriteXMLHeader(buffer);
5531  WriteXML(buffer, false);
5532  mStrOtherNamesArray.Clear();
5533 
5534  wxFFile saveFile;
5535  saveFile.Open(fn + wxT(".tmp"), wxT("wb"));
5536  return buffer.Write(saveFile);
5537  } );
5538 
5539  if (!success)
5540  return;
5541 
5542  // Now that we have a NEW auto-save file, DELETE the old one
5544 
5545  if (!mAutoSaveFileName.IsEmpty())
5546  return; // could not remove auto-save file
5547 
5548  if (!wxRenameFile(fn + wxT(".tmp"), fn + wxT(".autosave")))
5549  {
5551  wxString::Format( _("Could not create autosave file: %s"),
5552  fn + wxT(".autosave") ),
5553  _("Error"), wxICON_STOP, this);
5554  return;
5555  }
5556 
5557  mAutoSaveFileName += fn + wxT(".autosave");
5558  // no-op cruft that's not #ifdefed for NoteTrack
5559  // See above for further comments.
5560  // SonifyEndAutoSave();
5561 }
void WriteXMLHeader(XMLWriter &xmlFile) const
Definition: Project.cpp:3774
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
void WriteXML(XMLWriter &xmlFile, bool bWantSaveCopy)
Definition: Project.cpp:3789
wxString mFileName
Definition: Project.h:614
static wxString CreateUniqueName()
Definition: Project.cpp:881
wxArrayString mStrOtherNamesArray
Definition: Project.h:763
wxString mAutoSaveFileName
Definition: Project.h:746
void DeleteCurrentAutoSaveFile()
Definition: Project.cpp:5563
static wxString AutoSaveDir()
Definition: FileNames.cpp:109
bool mAutoSaving
Definition: Project.h:749
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void Write(const wxString &data) override
a class wrapping reading and writing of arbitrary data in text or binary format to a file...
Definition: AutoRecovery.h:76
void AudacityProject::CaptureKeyboard ( wxWindow *  handler)
static

Definition at line 6011 of file Project.cpp.

References GetActiveProject(), and mKeyboardCaptureHandler.

Referenced by DeviceToolBar::OnFocus(), MixerToolBar::OnFocus(), MixerTrackSlider::OnFocus(), SelectionBar::OnFocus(), TranscriptionToolBar::OnFocus(), NumericTextCtrl::OnFocus(), and TrackPanel::SetFocusedTrack().

6012 {
6013  AudacityProject *project = GetActiveProject();
6014  if (project)
6015  {
6016 // wxASSERT(project->mKeyboardCaptureHandler == NULL);
6017  project->mKeyboardCaptureHandler = handler;
6018  }
6019 }
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
wxWindow * mKeyboardCaptureHandler
Definition: Project.h:782
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:309
bool AudacityProject::ChannelsHaveSameClipBoundaries ( const WaveTrack wt)

Definition at line 6684 of file Menus.cpp.

References WaveTrack::GetClips(), Track::GetLink(), and Track::GetLinked().

Referenced by FindClipBoundaries(), and FindClips().

6685 {
6686  bool sameClips = false;
6687 
6688  if (wt->GetLinked() && wt->GetLink()) {
6689  auto& left = wt->GetClips();
6690  auto& right = static_cast<const WaveTrack*>(wt->GetLink())->GetClips();
6691  if (left.size() == right.size()) {
6692  sameClips = true;
6693  for (unsigned int i = 0; i < left.size(); i++) {
6694  if (left[i]->GetStartTime() != right[i]->GetStartTime() ||
6695  left[i]->GetEndTime() != right[i]->GetEndTime()) {
6696  sameClips = false;
6697  break;
6698  }
6699  }
6700  }
6701  }
6702 
6703  return sameClips;
6704 }
bool GetLinked() const
Definition: Track.h:287
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
WaveClipHolders & GetClips()
Definition: WaveTrack.h:370
Track * GetLink() const
Definition: Track.cpp:269
void AudacityProject::Clear ( )

Definition at line 4948 of file Project.cpp.

References _(), Track::Clear(), SelectedRegion::collapseToT0(), SelectedRegion::duration(), TrackListIterator::First(), Track::GetSelected(), GetTracks(), Track::IsSyncLockSelected(), mViewInfo, TrackListIterator::Next(), PushState(), RedrawProject(), ViewInfo::selectedRegion, SelectedRegion::t0(), and SelectedRegion::t1().

Referenced by OnDelete().

4949 {
4950  TrackListIterator iter(GetTracks());
4951 
4952  Track *n = iter.First();
4953 
4954  while (n) {
4955  if (n->GetSelected() || n->IsSyncLockSelected()) {
4957  }
4958  n = iter.Next();
4959  }
4960 
4961  double seconds = mViewInfo.selectedRegion.duration();
4962 
4964 
4965  PushState(wxString::Format(_("Deleted %.2f seconds at t=%.2f"),
4966  seconds,
4968  _("Delete"));
4969 
4970  RedrawProject();
4971 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1410
double t0() const
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
bool GetSelected() const
Definition: Track.h:284
bool IsSyncLockSelected() const
Definition: Track.cpp:295
double t1() const
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
virtual void Clear(double WXUNUSED(t0), double WXUNUSED(t1))=0
ViewInfo mViewInfo
Definition: Project.h:560
An iterator for a TrackList.
Definition: Track.h:410
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void PushState(const wxString &desc, const wxString &shortDesc)
Definition: Project.cpp:4740
TrackList * GetTracks()
Definition: Project.h:193
double duration() const
void AudacityProject::ClearClipboard ( )
static

Definition at line 4938 of file Project.cpp.

References msClipboard, msClipProject, msClipT0, and msClipT1.

Referenced by EditClipboardByLabel(), OnCopy(), OnCut(), HistoryWindow::OnDiscardClipboard(), and OnSplitCut().

4939 {
4940  msClipT0 = 0.0;
4941  msClipT1 = 0.0;
4942  msClipProject = NULL;
4943  if (msClipboard) {
4944  msClipboard->Clear();
4945  }
4946 }
static double msClipT0
Definition: Project.h:646
static double msClipT1
Definition: Project.h:647
static std::shared_ptr< TrackList > msClipboard
Definition: Project.h:644
static AudacityProject * msClipProject
Definition: Project.h:645
bool AudacityProject::Clipboard ( )
inline

Definition at line 219 of file Project.h.

219 { return (msClipT1 - msClipT0) > 0.0; }
static double msClipT0
Definition: Project.h:646
static double msClipT1
Definition: Project.h:647
wxString AudacityProject::ClipBoundaryMessage ( const std::vector< FoundClipBoundary > &  results)
static

Definition at line 7835 of file Menus.cpp.

References _(), format, and wxPLURAL.

Referenced by OnCursorClipBoundary(), and OnSelectClipBoundary().

7836 {
7837  wxString message;
7838  for (auto& result : results) {
7839 
7840  auto longName = result.ComposeTrackName();
7841 
7842  wxString str;
7843  auto nClips = result.waveTrack->GetNumClips();
7844  if (result.nFound < 2) {
7845  /* i18n-hint: in the string after this one,
7846  First %s is replaced with the noun "start" or "end"
7847  identifying one end of a clip,
7848  first number gives the position of that clip in a sequence
7849  of clips,
7850  last number counts all clips,
7851  and the last string is the name of the track containing the clips.
7852  */
7853  _("dummyStringClipBoundaryMessage");
7854  auto format = wxPLURAL(
7855  "%s %d of %d clip %s",
7856  "%s %d of %d clips %s",
7857  nClips
7858  );
7859  str = wxString::Format(format,
7860  result.clipStart1 ? _("start") : _("end"),
7861  result.index1 + 1,
7862  nClips,
7863  longName
7864  );
7865  }
7866  else {
7867  /* i18n-hint: in the string after this one,
7868  First two %s are each replaced with the noun "start"
7869  or with "end", identifying and end of a clip,
7870  first and second numbers give the position of those clips in
7871  a seqeunce of clips,
7872  last number counts all clips,
7873  and the last string is the name of the track containing the clips.
7874  */
7875  _("dummyStringClipBoundaryMessageLong");
7876  auto format = wxPLURAL(
7877  "%s %d and %s %d of %d clip %s",
7878  "%s %d and %s %d of %d clips %s",
7879  nClips
7880  );
7881  str = wxString::Format(format,
7882  result.clipStart1 ? _("start") : _("end"),
7883  result.index1 + 1,
7884  result.clipStart2 ? _("start") : _("end"),
7885  result.index2 + 1,
7886  nClips,
7887  longName
7888  );
7889  }
7890 
7891  if (message.empty())
7892  message = str;
7893  else
7894  message = wxString::Format(_("%s, %s"), message, str);
7895  }
7896 
7897  return message;
7898 }
#define wxPLURAL(sing, plur, n)
Definition: Internat.h:82
int format
Definition: ExportPCM.cpp:56
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
int AudacityProject::CountSelectedTracks ( )
private

Definition at line 6283 of file Menus.cpp.

References TrackListIterator::First(), Track::GetSelected(), GetTracks(), and TrackListIterator::Next().

Referenced by OnSelectSomething().

6284 {
6285  TrackListIterator iter(GetTracks());
6286 
6287  int count =0;
6288  for (Track *t = iter.First(); t; t = iter.Next()) {
6289  if( t->GetSelected() )
6290  count++;
6291  }
6292  return count;
6293 }
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
An iterator for a TrackList.
Definition: Track.h:410
TrackList * GetTracks()
Definition: Project.h:193
int AudacityProject::CountUnnamed ( )
static

Definition at line 2146 of file Project.cpp.

References gAudacityProjects, and GetName().

Referenced by TitleRestorer::TitleRestorer().

2147 {
2148  int j = 0;
2149  for ( size_t i = 0; i < gAudacityProjects.size(); i++) {
2150  if ( gAudacityProjects[i] )
2151  if ( gAudacityProjects[i]->GetName().IsEmpty() )
2152  j++;
2153  }
2154  return j;
2155 }
AProjectArray gAudacityProjects
Definition: Project.cpp:304
wxString GetName()
Definition: Project.cpp:1497
void AudacityProject::CreateMenusAndCommands ( )
private

Definition at line 303 of file Menus.cpp.

References _(), CommandManager::AddCheck(), CommandManager::AddGlobalCommand(), CommandManager::AddItem(), CommandManager::AddItemList(), CommandManager::AddMenuBar(), Scrubber::AddMenuItems(), CommandManager::AddSeparator(), AlwaysEnabledFlag, AudioIOBusyFlag, AudioIONotBusyFlag, AudioTracksSelectedFlag, CommandManager::BeginMenu(), CommandManager::BeginSubMenu(), CanStopAudioStreamFlag, CaptureNotBusyFlag, CreateRecentFilesMenu(), CutCopyAvailableFlag, EffectTypeAnalyze, EffectTypeGenerate, EffectTypeProcess, EffectTypeTool, CommandManager::EndMenu(), CommandManager::EndSubMenu(), FN, gAudioIO, EffectManager::Get(), PluginManager::Get(), EffectManager::GetEffectByIdentifier(), PluginManager::GetPlugin(), GetScrubber(), gPrefs, HasLastEffectFlag, PluginDescriptor::IsEnabled(), IsNotSyncLockedFlag, IsRealtimeNotActiveFlag, IsSyncLockedFlag, LabelsSelectedFlag, LabelTracksExistFlag, mAlignLabelsCount, mCommandManager, AudioIO::mDetectUpstreamDropouts, mLastEffect, mLastFlags, ModifyUndoMenuItems(), mRecentFilesMenu, AudioIO::mSimulateRecordingErrors, names(), NextFrame(), NextWindow(), NoAutoSelect, NoteTracksExistFlag, NoteTracksSelectedFlag, NotMinimizedFlag, OnAbout(), OnAddLabel(), OnAddLabelPlaying(), OnAlign(), OnAlignNoSync(), OnApplyMacrosPalette(), OnAudacityCommand(), OnAudioDeviceInfo(), OnAudioHost(), OnBenchmark(), OnCheckDependencies(), OnCheckForUpdates(), OnClipLeft(), OnClipRight(), OnClose(), OnCollapseAllTracks(), OnContrast(), OnCopy(), OnCopyLabels(), OnCursorDown(), OnCursorLeft(), OnCursorLongJumpLeft(), OnCursorLongJumpRight(), OnCursorNextClipBoundary(), OnCursorPositionStore(), OnCursorPrevClipBoundary(), OnCursorRight(), OnCursorSelEnd(), OnCursorSelStart(), OnCursorShortJumpLeft(), OnCursorShortJumpRight(), OnCursorTrackEnd(), OnCursorTrackStart(), OnCursorUp(), OnCut(), OnCutLabels(), OnDelete(), OnDeleteLabels(), OnDetectUpstreamDropouts(), OnDisjoin(), OnDisjoinLabels(), OnDrawTool(), OnDuplicate(), OnEditLabels(), OnEditMetadata(), OnEnvelopeTool(), OnExit(), OnExpandAllTracks(), OnExportAudio(), OnExportLabels(), OnExportMIDI(), OnExportMp3(), OnExportMultiple(), OnExportOgg(), OnExportSelection(), OnExportWav(), OnFirstTrack(), OnFullScreen(), OnGoSelEnd(), OnGoSelStart(), OnHistory(), OnImport(), OnImportLabels(), OnImportMIDI(), OnImportRaw(), OnInputChannels(), OnInputDevice(), OnInputGain(), OnInputGainDec(), OnInputGainInc(), OnJoin(), OnJoinLabels(), OnKaraoke(), OnLastTrack(), OnLockPlayRegion(), OnMacBringAllToFront(), OnMacMinimize(), OnMacMinimizeAll(), OnMacZoom(), OnManageAnalyzers(), OnManageEffects(), OnManageGenerators(), OnManageMacros(), OnManageTools(), OnManual(), OnMixAndRender(), OnMixAndRenderToNewTrack(), OnMixerBoard(), OnMoveSelectionWithTracks(), OnMoveToNextLabel(), OnMoveToPrevLabel(), OnMultiTool(), OnMuteAllTracks(), OnNew(), OnNewLabelTrack(), OnNewStereoTrack(), OnNewTimeTrack(), OnNewWaveTrack(), OnNextHigherPeakFrequency(), OnNextLowerPeakFrequency(), OnNextTool(), OnOpen(), OnOutputDevice(), OnOutputGain(), OnOutputGainDec(), OnOutputGainInc(), OnPageSetup(), OnPanCenter(), OnPanLeft(), OnPanRight(), OnPaste(), OnPasteNewLabel(), OnPause(), OnPlayAfterSelectionEnd(), OnPlayAfterSelectionStart(), OnPlayAtSpeed(), OnPlayAtSpeedCutPreview(), OnPlayAtSpeedLooped(), OnPlayBeforeAndAfterSelectionEnd(), OnPlayBeforeAndAfterSelectionStart(), OnPlayBeforeSelectionEnd(), OnPlayBeforeSelectionStart(), OnPlayCutPreview(), OnPlayLooped(), OnPlayOneSecond(), OnPlaySpeedDec(), OnPlaySpeedInc(), OnPlayStop(), OnPlayStopSelect(), OnPlayToSelection(), OnPlotSpectrum(), OnPreferences(), OnPrevTool(), OnPrint(), OnProjectReset(), OnPunchAndRoll(), OnQuickHelp(), OnRecord(), OnRecord2ndChoice(), OnRedo(), OnRemoveTracks(), OnRepeatLastEffect(), OnResample(), OnRescanDevices(), OnResetToolBars(), OnSave(), OnSaveAs(), OnSaveCopy(), OnScreenshot(), OnSeekLeftLong(), OnSeekLeftShort(), OnSeekRightLong(), OnSeekRightShort(), OnSelContractLeft(), OnSelContractRight(), OnSelectAll(), OnSelectAllTracks(), OnSelectCursorEnd(), OnSelectCursorStoredCursor(), OnSelectCursorToNextClipBoundary(), OnSelectionRestore(), OnSelectionSave(), OnSelectNextClip(), OnSelectNone(), OnSelectPrevClip(), OnSelectPrevClipBoundaryToCursor(), OnSelectStartCursor(), OnSelectSyncLockSel(), OnSelectTool(), OnSelectTrackStartToEnd(), OnSelExtendLeft(), OnSelExtendRight(), OnSelSetExtendLeft(), OnSelSetExtendRight(), OnSelToEnd(), OnSelToStart(), OnSetLeftSelection(), OnSetPlaySpeed(), OnSetRightSelection(), OnShiftDown(), OnShiftUp(), OnShowClipping(), OnShowDeviceToolBar(), OnShowEditToolBar(), OnShowExtraMenus(), OnShowLog(), OnShowMixerToolBar(), OnShowPlayMeterToolBar(), OnShowRecordMeterToolBar(), OnShowScrubbingToolBar(), OnShowSelectionToolBar(), OnShowSpectralSelectionToolBar(), OnShowToolsToolBar(), OnShowTranscriptionToolBar(), OnShowTransportToolBar(), OnSilence(), OnSilenceLabels(), OnSimulateRecordingErrors(), OnSkipEnd(), OnSkipStart(), OnSnapToNearest(), OnSnapToOff(), OnSnapToPrior(), OnSortName(), OnSortTime(), OnSoundActivated(), OnSplit(), OnSplitCut(), OnSplitCutLabels(), OnSplitDelete(), OnSplitDeleteLabels(), OnSplitLabels(), OnSplitNew(), OnStereoToMono(), OnStop(), OnSyncLock(), OnTimerRecord(), OnTimeShiftTool(), OnToggle(), OnTogglePinnedHead(), OnTogglePlayRecording(), OnToggleSoundActivated(), OnToggleSpectralSelection(), OnToggleSWPlaythrough(), OnToggleTypeToCreateLabel(), OnTrackClose(), OnTrackGain(), OnTrackGainDec(), OnTrackGainInc(), OnTrackMenu(), OnTrackMoveBottom(), OnTrackMoveDown(), OnTrackMoveTop(), OnTrackMoveUp(), OnTrackMute(), OnTrackPan(), OnTrackPanLeft(), OnTrackPanRight(), OnTrackSolo(), OnTrim(), OnUndo(), OnUnlockPlayRegion(), OnUnmuteAllTracks(), OnZeroCrossing(), OnZoomFit(), OnZoomFitV(), OnZoomIn(), OnZoomNormal(), OnZoomOut(), OnZoomSel(), OnZoomToggle(), OnZoomTool(), PlayableTracksExistFlag, PlayRegionLockedFlag, PlayRegionNotLockedFlag, PopulateEffectsMenu(), PopulateMacrosMenu(), PrevFrame(), PrevWindow(), RedoAvailableFlag, CommandManager::SetCommandFlags(), CommandManager::SetDefaultFlags(), CommandManager::SetLongName(), CommandManager::SetMaxList(), CommandManager::SetOccultCommands(), StereoRequiredFlag, CommandManager::SwapMenuBars(), TimeSelectedFlag, TrackPanelHasFocus, TracksExistFlag, TracksSelectedFlag, UndoAvailableFlag, UnsavedChangesFlag, WaveTracksExistFlag, WaveTracksSelectedFlag, wxGetApp(), XXO, ZoomInAvailableFlag, and ZoomOutAvailableFlag.

Referenced by RebuildMenuBar().

304 {
306  wxArrayString names;
307  std::vector<int> indices;
308 
309  // The list of defaults to exclude depends on
310  // preference wxT("/GUI/Shortcuts/FullDefaults"), which may have changed.
311  c->SetMaxList();
312 
313  {
314  auto menubar = c->AddMenuBar(wxT("appmenu"));
315  wxASSERT(menubar);
316  c->SetOccultCommands( false );
317 
319  // File menu
321 
322  c->BeginMenu(_("&File"));
324 
325  /*i18n-hint: "New" is an action (verb) to create a NEW project*/
326  c->AddItem(wxT("New"), XXO("&New"), FN(OnNew), wxT("Ctrl+N"),
329 
330  /*i18n-hint: (verb)*/
331  c->AddItem(wxT("Open"), XXO("&Open..."), FN(OnOpen), wxT("Ctrl+O"),
334 
335 #ifdef EXPERIMENTAL_RESET
336  // Empty the current project and forget its name and path. DANGEROUS
337  // It's just for developers.
338  // Do not translate this menu item (no XXO).
339  // It MUST not be shown to regular users.
340  c->AddItem(wxT("Reset"), wxT("&Dangerous Reset..."), FN(OnProjectReset), wxT(""),
343 #endif
344 
346 
348 
350 
351  c->AddItem(wxT("Close"), XXO("&Close"), FN(OnClose), wxT("Ctrl+W"));
352 
353  c->AddSeparator();
354 
355  c->BeginSubMenu( _("&Save Project") );
356  c->AddItem(wxT("Save"), XXO("&Save Project"), FN(OnSave), wxT("Ctrl+S"),
359  c->AddItem(wxT("SaveAs"), XXO("Save Project &As..."), FN(OnSaveAs));
360  // TODO: The next two items should be disabled if project is empty
361  c->AddItem(wxT("SaveCopy"), XXO("Save Lossless Copy of Project..."), FN(OnSaveCopy));
362 #ifdef USE_LIBVORBIS
363  c->AddItem(wxT("SaveCompressed"), XXO("&Save Compressed Copy of Project..."), FN(OnSaveCompressed));
364 #endif
365  c->EndSubMenu();
366  c->AddSeparator();
367 
368  c->BeginSubMenu( _("&Export") );
369 
370  // Enable Export audio commands only when there are audio tracks.
371  c->AddItem(wxT("ExportMp3"), XXO("Export as MP&3"), FN(OnExportMp3), wxT(""),
374 
375  c->AddItem(wxT("ExportWav"), XXO("Export as &WAV"), FN(OnExportWav), wxT(""),
378 
379  c->AddItem(wxT("ExportOgg"), XXO("Export as &OGG"), FN(OnExportOgg), wxT(""),
382 
383  c->AddItem(wxT("Export"), XXO("&Export Audio..."), FN(OnExportAudio), wxT("Ctrl+Shift+E"),
386 
387  // Enable Export Selection commands only when there's a selection.
388  c->AddItem(wxT("ExportSel"), XXO("Expo&rt Selected Audio..."), FN(OnExportSelection),
391 
392  c->AddItem(wxT("ExportLabels"), XXO("Export &Labels..."), FN(OnExportLabels),
395  // Enable Export audio commands only when there are audio tracks.
396  c->AddItem(wxT("ExportMultiple"), XXO("Export &Multiple..."), FN(OnExportMultiple), wxT("Ctrl+Shift+L"),
399 #if defined(USE_MIDI)
400  c->AddItem(wxT("ExportMIDI"), XXO("Export MI&DI..."), FN(OnExportMIDI),
403 #endif
404  c->EndSubMenu();
405 
406  c->BeginSubMenu(_("&Import"));
407 
408  c->AddItem(wxT("ImportAudio"), XXO("&Audio..."), FN(OnImport), wxT("Ctrl+Shift+I"));
409  c->AddItem(wxT("ImportLabels"), XXO("&Labels..."), FN(OnImportLabels));
410 #ifdef USE_MIDI
411  c->AddItem(wxT("ImportMIDI"), XXO("&MIDI..."), FN(OnImportMIDI));
412 #endif // USE_MIDI
413  c->AddItem(wxT("ImportRaw"), XXO("&Raw Data..."), FN(OnImportRaw));
414 
415  c->EndSubMenu();
416  c->AddSeparator();
417 
419 
420  c->AddItem(wxT("PageSetup"), XXO("Pa&ge Setup..."), FN(OnPageSetup),
423  /* i18n-hint: (verb) It's item on a menu. */
424  c->AddItem(wxT("Print"), XXO("&Print..."), FN(OnPrint),
427 
428  c->AddSeparator();
429 
430  // On the Mac, the Exit item doesn't actually go here...wxMac will pull it out
431  // and put it in the Audacity menu for us based on its ID.
432  /* i18n-hint: (verb) It's item on a menu. */
433  c->AddItem(wxT("Exit"), XXO("E&xit"), FN(OnExit), wxT("Ctrl+Q"),
436 
437  c->EndMenu();
438 
440  // Edit Menu
442 
443  c->BeginMenu(_("&Edit"));
444 
447 
448  c->AddItem(wxT("Undo"), XXO("&Undo"), FN(OnUndo), wxT("Ctrl+Z"),
451 
452  // The default shortcut key for Redo is different on different platforms.
453  wxString key =
454 #ifdef __WXMSW__
455  wxT("Ctrl+Y");
456 #else
457  wxT("Ctrl+Shift+Z");
458 #endif
459 
460  c->AddItem(wxT("Redo"), XXO("&Redo"), FN(OnRedo), key,
463 
465 
466  c->AddSeparator();
467 
468  // Basic Edit coomands
469  /* i18n-hint: (verb)*/
470  c->AddItem(wxT("Cut"), XXO("Cu&t"), FN(OnCut), wxT("Ctrl+X"),
473  c->AddItem(wxT("Delete"), XXO("&Delete"), FN(OnDelete), wxT("Ctrl+K"),
476  /* i18n-hint: (verb)*/
477  c->AddItem(wxT("Copy"), XXO("&Copy"), FN(OnCopy), wxT("Ctrl+C"),
480  /* i18n-hint: (verb)*/
481  c->AddItem(wxT("Paste"), XXO("&Paste"), FN(OnPaste), wxT("Ctrl+V"),
484  /* i18n-hint: (verb)*/
485  c->AddItem(wxT("Duplicate"), XXO("Duplic&ate"), FN(OnDuplicate), wxT("Ctrl+D"));
486 
487  c->AddSeparator();
488 
489  c->BeginSubMenu(_("R&emove Special"));
490  /* i18n-hint: (verb) Do a special kind of cut*/
491  c->AddItem(wxT("SplitCut"), XXO("Spl&it Cut"), FN(OnSplitCut), wxT("Ctrl+Alt+X"));
492  /* i18n-hint: (verb) Do a special kind of DELETE*/
493  c->AddItem(wxT("SplitDelete"), XXO("Split D&elete"), FN(OnSplitDelete), wxT("Ctrl+Alt+K"));
494 
495  c->AddSeparator();
496 
497  /* i18n-hint: (verb)*/
498  c->AddItem(wxT("Silence"), XXO("Silence Audi&o"), FN(OnSilence), wxT("Ctrl+L"),
501  /* i18n-hint: (verb)*/
502  c->AddItem(wxT("Trim"), XXO("Tri&m Audio"), FN(OnTrim), wxT("Ctrl+T"),
505  c->EndSubMenu();
506 
507  c->AddSeparator();
508 
510 
511  c->BeginSubMenu(_("Clip B&oundaries"));
512  /* i18n-hint: (verb) It's an item on a menu. */
513  c->AddItem(wxT("Split"), XXO("Sp&lit"), FN(OnSplit), wxT("Ctrl+I"),
516  c->AddItem(wxT("SplitNew"), XXO("Split Ne&w"), FN(OnSplitNew), wxT("Ctrl+Alt+I"),
519  c->AddSeparator();
520  /* i18n-hint: (verb)*/
521  c->AddItem(wxT("Join"), XXO("&Join"), FN(OnJoin), wxT("Ctrl+J"));
522  c->AddItem(wxT("Disjoin"), XXO("Detac&h at Silences"), FN(OnDisjoin), wxT("Ctrl+Alt+J"));
523  c->EndSubMenu();
524 
526 
527  c->BeginSubMenu(_("&Labels"));
528 
529  c->AddItem(wxT("EditLabels"), XXO("&Edit Labels..."), FN(OnEditLabels),
531 
532  c->AddSeparator();
533 
534  c->AddItem(wxT("AddLabel"), XXO("Add Label at &Selection"), FN(OnAddLabel), wxT("Ctrl+B"),
536  c->AddItem(wxT("AddLabelPlaying"), XXO("Add Label at &Playback Position"),
538 #ifdef __WXMAC__
539  wxT("Ctrl+."),
540 #else
541  wxT("Ctrl+M"),
542 #endif
544  AudioIOBusyFlag);
546  c->AddItem(wxT("PasteNewLabel"), XXO("Paste Te&xt to New Label"), FN(OnPasteNewLabel), wxT("Ctrl+Alt+V"),
548 
549  c->AddSeparator();
550 
551  c->AddCheck(wxT("TypeToCreateLabel"), XXO("&Type to Create a Label (on/off)"),
553 
554  c->EndSubMenu();
555 
557 
558  c->BeginSubMenu(_("La&beled Audio"));
559 
562 
563  /* i18n-hint: (verb)*/
564  c->SetLongName( _("Label Cut"))->AddItem(wxT("CutLabels"), XXO("&Cut"), FN(OnCutLabels), wxT("Alt+X"),
567  c->SetLongName( _("Label Delete"))->AddItem(wxT("DeleteLabels"), XXO("&Delete"), FN(OnDeleteLabels), wxT("Alt+K"),
570 
571  c->AddSeparator();
572 
573  /* i18n-hint: (verb) A special way to cut out a piece of audio*/
574  c->SetLongName( _("Label Split Cut"))->AddItem(wxT("SplitCutLabels"), XXO("&Split Cut"), FN(OnSplitCutLabels), wxT("Alt+Shift+X"));
575  c->SetLongName( _("Label Split Delete"))->AddItem(wxT("SplitDeleteLabels"), XXO("Sp&lit Delete"), FN(OnSplitDeleteLabels), wxT("Alt+Shift+K"));
576 
577  c->AddSeparator();
578 
579 
580  c->SetLongName( _("Label Silence"))->AddItem(wxT("SilenceLabels"), XXO("Silence &Audio"), FN(OnSilenceLabels), wxT("Alt+L"));
581  /* i18n-hint: (verb)*/
582  c->SetLongName( _("Label Copy"))->AddItem(wxT("CopyLabels"), XXO("Co&py"), FN(OnCopyLabels), wxT("Alt+Shift+C"));
583 
584  c->AddSeparator();
585 
586  /* i18n-hint: (verb)*/
587  c->SetLongName( _("Label Split"))->AddItem(wxT("SplitLabels"), XXO("Spli&t"), FN(OnSplitLabels), wxT("Alt+I"),
590  /* i18n-hint: (verb)*/
591  c->SetLongName( _("Label Join"))->AddItem(wxT("JoinLabels"), XXO("&Join"), FN(OnJoinLabels), wxT("Alt+J"));
592  c->AddItem(wxT("DisjoinLabels"), XXO("Detac&h at Silences"), FN(OnDisjoinLabels), wxT("Alt+Shift+J"));
593 
594  c->EndSubMenu();
595 
596  c->AddItem(wxT("EditMetaData"), XXO("Me&tadata..."), FN(OnEditMetadata),
598 
600 
601 #ifndef __WXMAC__
602  c->AddSeparator();
603 #endif
604 
605  // The default shortcut key for Preferences is different on different platforms.
606  key =
607 #ifdef __WXMAC__
608  wxT("Ctrl+,");
609 #else
610  wxT("Ctrl+P");
611 #endif
612 
613  c->AddItem(wxT("Preferences"), XXO("Pre&ferences..."), FN(OnPreferences), key,
616 
617  c->EndMenu();
618 
620  // Select Menu
622 
623  /* i18n-hint: (verb) It's an item on a menu. */
624  c->BeginMenu(_("&Select"));
626 
627  c->SetLongName( _("Select All"))->AddItem(wxT("SelectAll"), XXO("&All"), FN(OnSelectAll), wxT("Ctrl+A"));
628  c->SetLongName( _("Select None"))->AddItem(wxT("SelectNone"), XXO("&None"), FN(OnSelectNone), wxT("Ctrl+Shift+A"));
629 
631 
633 
634  c->BeginSubMenu(_("&Tracks"));
635  c->AddItem(wxT("SelAllTracks"), XXO("In All &Tracks"), FN(OnSelectAllTracks),
636  wxT("Ctrl+Shift+K"),
638 
639 #ifdef EXPERIMENTAL_SYNC_LOCK
640  c->SetLongName( _("Select Sync-Locked"))->AddItem(wxT("SelSyncLockTracks"), XXO("In All &Sync-Locked Tracks"),
641  FN(OnSelectSyncLockSel), wxT("Ctrl+Shift+Y"),
644 #endif
645 
646  c->EndSubMenu();
647 
649 
651 
652  c->BeginSubMenu(_("R&egion"));
653 
654  c->SetLongName( _("Set Selection Left at Play Position"))->AddItem(wxT("SetLeftSelection"), XXO("&Left at Playback Position"), FN(OnSetLeftSelection), wxT("["));
655  c->SetLongName( _("Set Selection Right at Play Position"))->AddItem(wxT("SetRightSelection"), XXO("&Right at Playback Position"), FN(OnSetRightSelection), wxT("]"));
657  c->SetLongName( _("Select Track Start to Cursor"))->AddItem(wxT("SelTrackStartToCursor"), XXO("Track &Start to Cursor"), FN(OnSelectStartCursor), wxT("Shift+J"),AlwaysEnabledFlag,AlwaysEnabledFlag);
658  c->SetLongName( _("Select Cursor to Track End"))->AddItem(wxT("SelCursorToTrackEnd"), XXO("Cursor to Track &End"), FN(OnSelectCursorEnd), wxT("Shift+K"),AlwaysEnabledFlag,AlwaysEnabledFlag);
659  c->SetLongName( _("Select Track Start to End"))->AddItem(wxT("SelTrackStartToEnd"), XXO("Track Start to En&d"), FN(OnSelectTrackStartToEnd), wxT(""),AlwaysEnabledFlag,AlwaysEnabledFlag);
660  c->AddSeparator();
661  // GA: Audacity had 'Store Re&gion' here previously. There is no one-step
662  // way to restore the 'Saved Cursor Position' in Select Menu, so arguably
663  // using the word 'Selection' to do duty for both saving the region or the
664  // cursor is better. But it does not belong in a 'Region' submenu.
665  c->AddItem(wxT("SelSave"), XXO("S&tore Selection"), FN(OnSelectionSave),
668  // Audacity had 'Retrieve Regio&n' here previously.
669  c->AddItem(wxT("SelRestore"), XXO("Retrieve Selectio&n"), FN(OnSelectionRestore),
672 
673  c->EndSubMenu();
674 
676 
678 
679 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
680  c->BeginSubMenu(_("S&pectral"));
681  c->AddItem(wxT("ToggleSpectralSelection"), XXO("To&ggle Spectral Selection"), FN(OnToggleSpectralSelection), wxT("Q"));
682  c->AddItem(wxT("NextHigherPeakFrequency"), XXO("Next &Higher Peak Frequency"), FN(OnNextHigherPeakFrequency));
683  c->AddItem(wxT("NextLowerPeakFrequency"), XXO("Next &Lower Peak Frequency"), FN(OnNextLowerPeakFrequency));
684  c->EndSubMenu();
685 #endif
686 
688 
690 
691  c->BeginSubMenu(_("Clip B&oundaries"));
692  c->AddItem(wxT("SelPrevClipBoundaryToCursor"), XXO("Pre&vious Clip Boundary to Cursor"),
695  c->AddItem(wxT("SelCursorToNextClipBoundary"), XXO("Cursor to Ne&xt Clip Boundary"),
698  c->SetLongName( _("Select Previous Clip"))->AddItem(wxT("SelPrevClip"), XXO("Previo&us Clip"), FN(OnSelectPrevClip), wxT("Alt+,"),
700  c->SetLongName( _("Select Next Clip"))->AddItem(wxT("SelNextClip"), XXO("N&ext Clip"), FN(OnSelectNextClip), wxT("Alt+."),
702 
703  c->EndSubMenu();
705 
706  c->AddSeparator();
707 
708  c->SetLongName( _("Select Cursor to Stored"))->AddItem(wxT("SelCursorStoredCursor"), XXO("Cursor to Stored &Cursor Position"), FN(OnSelectCursorStoredCursor),
709  wxT(""), TracksExistFlag, TracksExistFlag);
710 
711  c->AddItem(wxT("StoreCursorPosition"), XXO("Store Cursor Pos&ition"), FN(OnCursorPositionStore),
714  // Save cursor position is used in some selections.
715  // Maybe there should be a restore for it?
716 
717  c->AddSeparator();
718 
719  c->SetLongName( _("Select Zero Crossing"))->AddItem(wxT("ZeroCross"), XXO("At &Zero Crossings"), FN(OnZeroCrossing), wxT("Z"));
720 
721  c->EndMenu();
722 
724  // View Menu
726 
727  c->BeginMenu(_("&View"));
729  c->BeginSubMenu(_("&Zoom"));
730 
731  c->AddItem(wxT("ZoomIn"), XXO("Zoom &In"), FN(OnZoomIn), wxT("Ctrl+1"),
734  c->AddItem(wxT("ZoomNormal"), XXO("Zoom &Normal"), FN(OnZoomNormal), wxT("Ctrl+2"));
735  c->AddItem(wxT("ZoomOut"), XXO("Zoom &Out"), FN(OnZoomOut), wxT("Ctrl+3"),
738  c->AddItem(wxT("ZoomSel"), XXO("&Zoom to Selection"), FN(OnZoomSel), wxT("Ctrl+E"),
741  c->AddItem(wxT("ZoomToggle"), XXO("Zoom &Toggle"), FN(OnZoomToggle), wxT("Shift+Z"),
744  c->EndSubMenu();
745 
746  c->BeginSubMenu(_("T&rack Size"));
747  c->AddItem(wxT("FitInWindow"), XXO("&Fit to Width"), FN(OnZoomFit), wxT("Ctrl+F"));
748  c->AddItem(wxT("FitV"), XXO("Fit to &Height"), FN(OnZoomFitV), wxT("Ctrl+Shift+F"));
749  c->AddItem(wxT("CollapseAllTracks"), XXO("&Collapse All Tracks"), FN(OnCollapseAllTracks), wxT("Ctrl+Shift+C"));
750  c->AddItem(wxT("ExpandAllTracks"), XXO("E&xpand Collapsed Tracks"), FN(OnExpandAllTracks), wxT("Ctrl+Shift+X"));
751  c->EndSubMenu();
752 
753  c->BeginSubMenu(_("Sk&ip to"));
754  c->SetLongName( _("Skip to Selection Start"))->AddItem(wxT("SkipSelStart"), XXO("Selection Sta&rt"), FN(OnGoSelStart), wxT("Ctrl+["),
756  c->SetLongName( _("Skip to Selection End"))->AddItem(wxT("SkipSelEnd"), XXO("Selection En&d"), FN(OnGoSelEnd), wxT("Ctrl+]"),
758  c->EndSubMenu();
759 
760  c->AddSeparator();
761 
762  // History window should be available either for UndoAvailableFlag or RedoAvailableFlag,
763  // but we can't make the AddItem flags and mask have both, because they'd both have to be true for the
764  // command to be enabled.
765  // If user has Undone the entire stack, RedoAvailableFlag is on but UndoAvailableFlag is off.
766  // If user has done things but not Undone anything, RedoAvailableFlag is off but UndoAvailableFlag is on.
767  // So in either of those cases, (AudioIONotBusyFlag | UndoAvailableFlag | RedoAvailableFlag) mask
768  // would fail.
769  // The only way to fix this in the current architecture is to hack in special cases for RedoAvailableFlag
770  // in AudacityProject::UpdateMenus() (ugly) and CommandManager::HandleCommandEntry() (*really* ugly --
771  // shouldn't know about particular command names and flags).
772  // Here's the hack that would be necessary in AudacityProject::UpdateMenus(), if somebody decides to do it:
773  // // Because EnableUsingFlags requires all the flag bits match the corresponding mask bits,
774  // // "UndoHistory" specifies only AudioIONotBusyFlag | UndoAvailableFlag, because that
775  // // covers the majority of cases where it should be enabled.
776  // // If history is not empty but we've Undone the whole stack, we also want to enable,
777  // // to show the Redo's on stack.
778  // // "UndoHistory" might already be enabled, but add this check for RedoAvailableFlag.
779  // if (flags & RedoAvailableFlag)
780  // mCommandManager.Enable(wxT("UndoHistory"), true);
781  // So for now, enable the command regardless of stack. It will just show empty sometimes.
782  // FOR REDESIGN, clearly there are some limitations with the flags/mask bitmaps.
783 
784  /* i18n-hint: Clicking this menu item shows the various editing steps that have been taken.*/
785  c->AddItem(wxT("UndoHistory"), XXO("&History..."), FN(OnHistory),
788 
789  c->AddItem(wxT("Karaoke"), XXO("&Karaoke..."), FN(OnKaraoke), LabelTracksExistFlag, LabelTracksExistFlag);
790  c->AddItem(wxT("MixerBoard"), XXO("&Mixer Board..."), FN(OnMixerBoard), PlayableTracksExistFlag, PlayableTracksExistFlag);
791 
792  c->AddSeparator();
793 
795 
796  c->BeginSubMenu(_("&Toolbars"));
797 
798  /* i18n-hint: (verb)*/
799  c->AddItem(wxT("ResetToolbars"), XXO("Reset Toolb&ars"), FN(OnResetToolBars), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
800  c->AddSeparator();
801 
802  /* i18n-hint: Clicking this menu item shows the toolbar with the big buttons on it (play record etc)*/
803  c->AddCheck(wxT("ShowTransportTB"), XXO("&Transport Toolbar"), FN(OnShowTransportToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
804  /* i18n-hint: Clicking this menu item shows a toolbar that has some tools in it*/
805  c->AddCheck(wxT("ShowToolsTB"), XXO("T&ools Toolbar"), FN(OnShowToolsToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
806  /* i18n-hint: Clicking this menu item shows the toolbar with the recording level meters*/
807  c->AddCheck(wxT("ShowRecordMeterTB"), XXO("&Recording Meter Toolbar"), FN(OnShowRecordMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
808  /* i18n-hint: Clicking this menu item shows the toolbar with the playback level meter*/
809  c->AddCheck(wxT("ShowPlayMeterTB"), XXO("&Playback Meter Toolbar"), FN(OnShowPlayMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
810  /* --i18n-hint: Clicking this menu item shows the toolbar which has sound level meters*/
811  //c->AddCheck(wxT("ShowMeterTB"), XXO("Co&mbined Meter Toolbar"), FN(OnShowMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
812  /* i18n-hint: Clicking this menu item shows the toolbar with the mixer*/
813  c->AddCheck(wxT("ShowMixerTB"), XXO("Mi&xer Toolbar"), FN(OnShowMixerToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
814  /* i18n-hint: Clicking this menu item shows the toolbar for editing*/
815  c->AddCheck(wxT("ShowEditTB"), XXO("&Edit Toolbar"), FN(OnShowEditToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
816  /* i18n-hint: Clicking this menu item shows the toolbar for transcription (currently just vary play speed)*/
817  c->AddCheck(wxT("ShowTranscriptionTB"), XXO("Pla&y-at-Speed Toolbar"), FN(OnShowTranscriptionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
818  /* i18n-hint: Clicking this menu item shows the toolbar that enables Scrub or Seek playback and Scrub Ruler*/
819  c->AddCheck(wxT("ShowScrubbingTB"), XXO("Scru&b Toolbar"), FN(OnShowScrubbingToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
820  /* i18n-hint: Clicking this menu item shows the toolbar that manages devices*/
821  c->AddCheck(wxT("ShowDeviceTB"), XXO("&Device Toolbar"), FN(OnShowDeviceToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
822  /* i18n-hint: Clicking this menu item shows the toolbar for selecting a time range of audio*/
823  c->AddCheck(wxT("ShowSelectionTB"), XXO("&Selection Toolbar"), FN(OnShowSelectionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
824 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
825  /* i18n-hint: Clicking this menu item shows the toolbar for selecting a frequency range of audio*/
826  c->AddCheck(wxT("ShowSpectralSelectionTB"), XXO("Spe&ctral Selection Toolbar"), FN(OnShowSpectralSelectionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
827 #endif
828 
829  c->EndSubMenu();
830 
831  c->AddSeparator();
832 
833  c->AddCheck(wxT("ShowExtraMenus"), XXO("&Extra Menus (on/off)"), FN(OnShowExtraMenus),
834  gPrefs->Read(wxT("/GUI/ShowExtraMenus"), 0L), AlwaysEnabledFlag, AlwaysEnabledFlag);
835  c->AddCheck(wxT("ShowClipping"), XXO("&Show Clipping (on/off)"), FN(OnShowClipping),
836  gPrefs->Read(wxT("/GUI/ShowClipping"), 0L), AlwaysEnabledFlag, AlwaysEnabledFlag);
837 #if defined(EXPERIMENTAL_EFFECTS_RACK)
838  c->AddCheck(wxT("ShowEffectsRack"), XXO("Show Effects Rack"), FN(OnShowEffectsRack), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
839 #endif
840 
841 
842  c->EndMenu();
843 
845  // Transport Menu
847 
848  /*i18n-hint: 'Transport' is the name given to the set of controls that
849  play, record, pause etc. */
850  c->BeginMenu(_("Tra&nsport"));
852  c->BeginSubMenu(_("Pl&aying"));
853  /* i18n-hint: (verb) Start or Stop audio playback*/
854  c->AddItem(wxT("PlayStop"), XXO("Pl&ay/Stop"), FN(OnPlayStop), wxT("Space"));
855  c->AddItem(wxT("PlayStopSelect"), XXO("Play/Stop and &Set Cursor"), FN(OnPlayStopSelect), wxT("X"));
856  c->AddItem(wxT("PlayLooped"), XXO("&Loop Play"), FN(OnPlayLooped), wxT("Shift+Space"),
859  c->AddItem(wxT("Pause"), XXO("&Pause"), FN(OnPause), wxT("P"));
860  c->EndSubMenu();
861 
862  c->BeginSubMenu( _("&Recording"));
865  /* i18n-hint: (verb)*/
866  c->AddItem(wxT("Record1stChoice"), XXO("&Record"), FN(OnRecord), wxT("R"));
867  // The OnRecord2ndChoice function is: if normal record records beside,
868  // it records below, if normal record records below, it records beside.
869  // TODO: Do 'the right thing' with other options like TimerRecord.
870  bool bPreferNewTrack;
871  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
872  c->AddItem( wxT("Record2ndChoice"),
873  // Our first choice is bound to R (by default) and gets the prime position.
874  // We supply the name for the 'other one' here. It should be bound to Shift+R
875  (bPreferNewTrack ? _("&Append Record") : _("Record &New Track")), false,
877  wxT("Shift+R")
878  );
879 
880  c->AddItem(wxT("TimerRecord"), XXO("&Timer Record..."), FN(OnTimerRecord), wxT("Shift+T"));
881 
882 #ifdef EXPERIMENTAL_PUNCH_AND_ROLL
883  c->AddItem(wxT("PunchAndRoll"), XXO("Punch and Rol&l Record"), FN(OnPunchAndRoll), wxT("Shift+D"),
886 #endif
887 
888  // JKC: I decided to duplicate this between play and record, rather than put it
889  // at the top level. AddItem can now cope with simple duplicated items.
890  // PRL: This second registration of wxT("Pause"), with unspecified flags,
891  // in fact will use the same flags as in the previous registration.
892  c->AddItem(wxT("Pause"), XXO("&Pause"), FN(OnPause), wxT("P"));
893  c->EndSubMenu();
894 
895  // Scrubbing sub-menu
897 
898  // JKC: ANSWER-ME: How is 'cursor to' different to 'Skip To' and how is it useful?
899  // GA: 'Skip to' moves the viewpoint to center of the track and preserves the
900  // selection. 'Cursor to' does neither. 'Center at' might describe it better than 'Skip'.
901  c->BeginSubMenu(_("&Cursor to"));
902 
903  c->SetLongName( _("Cursor to Selection Start"))->AddItem(wxT("CursSelStart"), XXO("Selection Star&t"), FN(OnCursorSelStart),
905  c->SetLongName( _("Cursor to Selection End"))->AddItem(wxT("CursSelEnd"), XXO("Selection En&d"), FN(OnCursorSelEnd),
907 
908  c->SetLongName( _("Cursor to Track Start"))->AddItem(wxT("CursTrackStart"), XXO("Track &Start"), FN(OnCursorTrackStart), wxT("J"),
910  c->SetLongName( _("Cursor to Track End"))->AddItem(wxT("CursTrackEnd"), XXO("Track &End"), FN(OnCursorTrackEnd), wxT("K"),
912 
913  c->SetLongName( _("Cursor to Prev Clip Boundary"))->AddItem(wxT("CursPrevClipBoundary"), XXO("Pre&vious Clip Boundary"), FN(OnCursorPrevClipBoundary), wxT(""),
915  c->SetLongName( _("Cursor to Next Clip Boundary"))->AddItem(wxT("CursNextClipBoundary"), XXO("Ne&xt Clip Boundary"), FN(OnCursorNextClipBoundary), wxT(""),
917 
918  c->SetLongName( _("Cursor to Project Start"))->AddItem(wxT("CursProjectStart"), XXO("&Project Start"), FN(OnSkipStart), wxT("Home"));
919  c->SetLongName( _("Cursor to Project End"))->AddItem(wxT("CursProjectEnd"), XXO("Project E&nd"), FN(OnSkipEnd), wxT("End"));
920 
921  c->EndSubMenu();
922 
923  c->AddSeparator();
924 
926 
927  c->BeginSubMenu(_("Pla&y Region"));
928 
929  c->AddItem(wxT("LockPlayRegion"), XXO("&Lock"), FN(OnLockPlayRegion),
932  c->AddItem(wxT("UnlockPlayRegion"), XXO("&Unlock"), FN(OnUnlockPlayRegion),
935 
936  c->EndSubMenu();
937 
938  c->AddSeparator();
939 
940  c->AddItem(wxT("RescanDevices"), XXO("R&escan Audio Devices"), FN(OnRescanDevices),
943 
944  c->BeginSubMenu(_("Transport &Options"));
945  // Sound Activated recording options
946  c->AddItem(wxT("SoundActivationLevel"), XXO("Sound Activation Le&vel..."), FN(OnSoundActivated),
949  c->AddCheck(wxT("SoundActivation"), XXO("Sound A&ctivated Recording (on/off)"), FN(OnToggleSoundActivated), 0,
952  c->AddSeparator();
953 
954  c->AddCheck(wxT("PinnedHead"), XXO("Pinned Play/Record &Head (on/off)"),
956  // Switching of scrolling on and off is permitted even during transport
958 
959  c->AddCheck(wxT("Overdub"), XXO("&Overdub (on/off)"), FN(OnTogglePlayRecording), 1,
962  c->AddCheck(wxT("SWPlaythrough"), XXO("So&ftware Playthrough (on/off)"), FN(OnToggleSWPlaythrough), 0,
965 
966 
967 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
968  c->AddCheck(wxT("AutomatedInputLevelAdjustmentOnOff"), XXO("A&utomated Recording Level Adjustment (on/off)"), FN(OnToggleAutomatedInputLevelAdjustment), 0,
971 #endif
972  c->EndSubMenu();
973 
974  c->EndMenu();
975 
977  // Tracks Menu (formerly Project Menu)
979 
980  c->BeginMenu(_("&Tracks"));
982 
984 
985  c->BeginSubMenu(_("Add &New"));
986 
987  c->AddItem(wxT("NewMonoTrack"), XXO("&Mono Track"), FN(OnNewWaveTrack), wxT("Ctrl+Shift+N"));
988  c->AddItem(wxT("NewStereoTrack"), XXO("&Stereo Track"), FN(OnNewStereoTrack));
989  c->AddItem(wxT("NewLabelTrack"), XXO("&Label Track"), FN(OnNewLabelTrack));
990  c->AddItem(wxT("NewTimeTrack"), XXO("&Time Track"), FN(OnNewTimeTrack));
991 
992  c->EndSubMenu();
993 
995 
996  c->AddSeparator();
997 
998  c->BeginSubMenu(_("Mi&x") );
999  {
1000  // Stereo to Mono is an oddball command that is also subject to control by the
1001  // plug-in manager, as if an effect. Decide whether to show or hide it.
1002  const PluginID ID = EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono"));
1003  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
1004  if (plug && plug->IsEnabled())
1005  c->AddItem(wxT("Stereo to Mono"), XXO("Mix Stereo Down to &Mono"), FN(OnStereoToMono),
1008  }
1009  c->AddItem(wxT("MixAndRender"), XXO("Mi&x and Render"), FN(OnMixAndRender),
1012  c->AddItem(wxT("MixAndRenderToNewTrack"), XXO("Mix and Render to Ne&w Track"), FN(OnMixAndRenderToNewTrack), wxT("Ctrl+Shift+M"),
1015  c->EndSubMenu();
1016 
1017  c->AddItem(wxT("Resample"), XXO("&Resample..."), FN(OnResample),
1020 
1021  c->AddSeparator();
1022 
1023  c->AddItem(wxT("RemoveTracks"), XXO("Remo&ve Tracks"), FN(OnRemoveTracks),
1026 
1027  c->AddSeparator();
1028 
1029  c->BeginSubMenu(_("M&ute/Unmute"));
1030  c->AddItem(wxT("MuteAllTracks"), XXO("&Mute All Tracks"), FN(OnMuteAllTracks), wxT("Ctrl+U"));
1031  c->AddItem(wxT("UnmuteAllTracks"), XXO("&Unmute All Tracks"), FN(OnUnmuteAllTracks), wxT("Ctrl+Shift+U"));
1032  c->EndSubMenu();
1033 
1034  c->BeginSubMenu(_("&Pan"));
1035  // As Pan changes are not saved on Undo stack, pan settings for all tracks
1036  // in the project could very easily be lost unless we require the tracks to be selcted.
1038  c->SetLongName( _("Pan Left"))->AddItem(wxT("PanLeft"), XXO("&Left"), FN(OnPanLeft));
1039  c->SetLongName( _("Pan Right"))->AddItem(wxT("PanRight"), XXO("&Right"), FN(OnPanRight));
1040  c->SetLongName( _("Pan Center"))->AddItem(wxT("PanCenter"), XXO("&Center"), FN(OnPanCenter));
1041  c->EndSubMenu();
1042 
1043 
1044  c->AddSeparator();
1045 
1047 
1048  const TranslatedInternalString alignLabelsNoSync[] = {
1049  { wxT("EndToEnd"), _("&Align End to End") },
1050  { wxT("Together"), _("Align &Together") },
1051  };
1052 
1053  const TranslatedInternalString alignLabels[] = {
1054  { wxT("StartToZero"), _("Start to &Zero") },
1055  { wxT("StartToSelStart"), _("Start to &Cursor/Selection Start") },
1056  { wxT("StartToSelEnd"), _("Start to Selection &End") },
1057  { wxT("EndToSelStart"), _("End to Cu&rsor/Selection Start") },
1058  { wxT("EndToSelEnd"), _("End to Selection En&d") },
1059  };
1060  mAlignLabelsCount = sizeof(alignLabels) / sizeof(alignLabels[0]);
1061 
1062  // Calling c->SetCommandFlags() after AddItemList for "Align" and "AlignMove"
1063  // does not correctly set flags for submenus, so do it this way.
1066 
1067  c->BeginSubMenu(_("&Align Tracks"));
1068 
1069  //c->BeginSubMenu(_("Just Move Tracks"));
1070  c->AddItemList(wxT("Align"), alignLabelsNoSync, 2u, FN(OnAlignNoSync));
1071  c->AddSeparator();
1072  c->AddItemList(wxT("Align"), alignLabels, mAlignLabelsCount, FN(OnAlign));
1073  c->AddSeparator();
1074  c->AddCheck(wxT("MoveSelectionWithTracks"), XXO("&Move Selection with Tracks (on/off)"),
1076  gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), 0L),
1078  c->EndSubMenu();
1079 
1080 #if 0
1081  // TODO: Can these labels be made clearer? Do we need this sub-menu at all?
1082  c->BeginSubMenu(_("Move Sele&ction and Tracks"));
1083 
1084  c->AddItemList(wxT("AlignMove"), alignLabels, mAlignLabelsCount, FN(OnAlignMoveSel));
1085  c->SetCommandFlags(wxT("AlignMove"),
1088 
1089  c->EndSubMenu();
1090 #endif
1091 
1093 
1094 
1096 
1097 #ifdef EXPERIMENTAL_SCOREALIGN
1098  c->AddItem(wxT("ScoreAlign"), XXO("Synchronize MIDI with Audio"), FN(OnScoreAlign),
1101 #endif // EXPERIMENTAL_SCOREALIGN
1102 
1104 
1105  c->BeginSubMenu(_("S&ort Tracks"));
1106 
1107  c->SetLongName( _("Sort by Time"))->AddItem(wxT("SortByTime"), XXO("By &Start Time"), FN(OnSortTime),
1109  TracksExistFlag);
1110  c->SetLongName( _("Sort by Name"))->AddItem(wxT("SortByName"), XXO("By &Name"), FN(OnSortName),
1112  TracksExistFlag);
1113 
1114  c->EndSubMenu();
1115 
1117 
1118 #ifdef EXPERIMENTAL_SYNC_LOCK
1119  c->AddSeparator();
1120  c->AddCheck(wxT("SyncLock"), XXO("Sync-&Lock Tracks (on/off)"), FN(OnSyncLock),
1121  gPrefs->Read(wxT("/GUI/SyncLockTracks"), 0L),
1123 
1124 #endif
1125 
1126  c->EndMenu();
1127 
1128  // All of this is a bit hacky until we can get more things connected into
1129  // the plugin manager...sorry! :-(
1130 
1131  wxArrayString defaults;
1132 
1134  // Generate Menu
1136 
1137  c->BeginMenu(_("&Generate"));
1139 
1140 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1141  c->AddItem(wxT("ManageGenerators"), XXO("Add / Remove Plug-ins..."), FN(OnManageGenerators));
1142  c->AddSeparator();
1143 #endif
1144 
1145 
1150 
1151  c->EndMenu();
1152 
1154  // Effect Menu
1156 
1157  c->BeginMenu(_("Effe&ct"));
1158 
1159  wxString buildMenuLabel;
1160  if (!mLastEffect.IsEmpty()) {
1161  buildMenuLabel.Printf(_("Repeat %s"),
1162  EffectManager::Get().GetCommandName(mLastEffect));
1163  }
1164  else
1165  buildMenuLabel = _("Repeat Last Effect");
1166 
1167 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1168  c->AddItem(wxT("ManageEffects"), XXO("Add / Remove Plug-ins..."), FN(OnManageEffects));
1169  c->AddSeparator();
1170 #endif
1171 
1172  c->AddItem(wxT("RepeatLastEffect"), buildMenuLabel, false, FN(OnRepeatLastEffect), wxT("Ctrl+R"),
1175 
1176  c->AddSeparator();
1177 
1182 
1183  c->EndMenu();
1184 
1186  // Analyze Menu
1188 
1189  c->BeginMenu(_("&Analyze"));
1190 
1191 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1192  c->AddItem(wxT("ManageAnalyzers"), XXO("Add / Remove Plug-ins..."), FN(OnManageAnalyzers));
1193  c->AddSeparator();
1194 #endif
1195 
1196 
1197  c->AddItem(wxT("ContrastAnalyser"), XXO("Contrast..."), FN(OnContrast), wxT("Ctrl+Shift+T"),
1200  c->AddItem(wxT("PlotSpectrum"), XXO("Plot Spectrum..."), FN(OnPlotSpectrum),
1203 
1208 
1209  c->EndMenu();
1210 
1212  // Tools Menu
1214 
1215  c->BeginMenu(_("T&ools"));
1216 
1217 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1218  c->AddItem(wxT("ManageTools"), XXO("Add / Remove Plug-ins..."), FN(OnManageTools));
1219  //c->AddSeparator();
1220 #endif
1221 
1222  c->AddItem(wxT("ManageMacros"), XXO("&Macros..."), FN(OnManageMacros));
1223 
1224  c->BeginSubMenu(_("&Apply Macro"));
1225  c->AddItem(wxT("ApplyMacrosPalette"), XXO("&Palette..."), FN(OnApplyMacrosPalette));
1226  c->AddSeparator();
1228  c->EndSubMenu();
1229  c->AddSeparator();
1230 
1231  c->AddItem(wxT("FancyScreenshot"), XXO("&Screenshot..."), FN(OnScreenshot));
1232 
1233 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
1234 // as they used to in 1.3.x
1235 //#ifdef IS_ALPHA
1236  // TODO: What should we do here? Make benchmark a plug-in?
1237  // Easy enough to do. We'd call it mod-self-test.
1238  c->AddItem(wxT("Benchmark"), XXO("&Run Benchmark..."), FN(OnBenchmark));
1239 //#endif
1240 
1241  c->AddSeparator();
1242 
1247 
1248 #ifdef IS_ALPHA
1249  c->AddSeparator();
1250  c->AddCheck(wxT("SimulateRecordingErrors"),
1251  XXO("Simulate Recording Errors"),
1254  c->AddCheck(wxT("DetectUpstreamDropouts"),
1255  XXO("Detect Upstream Dropouts"),
1258 #endif
1259 
1260  c->EndMenu();
1261 
1262 
1263 #ifdef __WXMAC__
1264  // poor imitation of the Mac Windows Menu
1267 
1268  {
1269  c->BeginMenu(_("&Window"));
1270  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1271  * window) shrink to an icon on the dock */
1272  c->AddItem(wxT("MacMinimize"), XXO("&Minimize"), FN(OnMacMinimize),
1273  wxT("Ctrl+M"), NotMinimizedFlag, NotMinimizedFlag);
1274  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1275  * window) full sized */
1276  c->AddItem(wxT("MacZoom"), XXO("&Zoom"), FN(OnMacZoom),
1278  c->AddSeparator();
1279  /* i18n-hint: Standard Macintosh Window menu item: Make all project
1280  * windows un-hidden */
1281  c->AddItem(wxT("MacBringAllToFront"),
1282  XXO("&Bring All to Front"), FN(OnMacBringAllToFront),
1284  c->EndMenu();
1285  }
1286 #endif
1287 
1288 
1290 
1291  bool bShowExtraMenus;
1292  gPrefs->Read(wxT("/GUI/ShowExtraMenus"), &bShowExtraMenus, false);
1293  std::unique_ptr<wxMenuBar> menubar2;
1294  if( !bShowExtraMenus )
1295  {
1296  menubar2 = c->AddMenuBar(wxT("ext-menu"));
1297  c->SetOccultCommands(true);
1298  }
1299 
1301  // Ext-Menu
1303 
1304  // i18n-hint: Extra is a menu with extra commands
1305  c->BeginMenu(_("Ext&ra"));
1306 
1308 
1310  c->BeginSubMenu(_("T&ransport"));
1311 
1312  // PlayStop is already in the menus.
1313  /* i18n-hint: (verb) Start playing audio*/
1314  c->AddItem(wxT("Play"), XXO("Pl&ay"), FN(OnPlayStop),
1317  /* i18n-hint: (verb) Stop playing audio*/
1318  c->AddItem(wxT("Stop"), XXO("Sto&p"), FN(OnStop),
1319  AudioIOBusyFlag | CanStopAudioStreamFlag,
1320  AudioIOBusyFlag | CanStopAudioStreamFlag);
1321 
1323 
1324  c->AddItem(wxT("PlayOneSec"), XXO("Play &One Second"), FN(OnPlayOneSecond), wxT("1"),
1327  c->AddItem(wxT("PlayToSelection"), XXO("Play to &Selection"), FN(OnPlayToSelection), wxT("B"),
1330  c->AddItem(wxT("PlayBeforeSelectionStart"), XXO("Play &Before Selection Start"), FN(OnPlayBeforeSelectionStart), wxT("Shift+F5"));
1331  c->AddItem(wxT("PlayAfterSelectionStart"), XXO("Play Af&ter Selection Start"), FN(OnPlayAfterSelectionStart), wxT("Shift+F6"));
1332  c->AddItem(wxT("PlayBeforeSelectionEnd"), XXO("Play Be&fore Selection End"), FN(OnPlayBeforeSelectionEnd), wxT("Shift+F7"));
1333  c->AddItem(wxT("PlayAfterSelectionEnd"), XXO("Play Aft&er Selection End"), FN(OnPlayAfterSelectionEnd), wxT("Shift+F8"));
1334  c->AddItem(wxT("PlayBeforeAndAfterSelectionStart"), XXO("Play Before a&nd After Selection Start"), FN(OnPlayBeforeAndAfterSelectionStart), wxT("Ctrl+Shift+F5"));
1335  c->AddItem(wxT("PlayBeforeAndAfterSelectionEnd"), XXO("Play Before an&d After Selection End"), FN(OnPlayBeforeAndAfterSelectionEnd), wxT("Ctrl+Shift+F7"));
1336  c->AddItem(wxT("PlayCutPreview"), XXO("Play C&ut Preview"), FN(OnPlayCutPreview), wxT("C"),
1339  c->EndSubMenu();
1340 
1342 
1344  c->BeginSubMenu(_("T&ools"));
1345 
1346  c->AddItem(wxT("SelectTool"), XXO("&Selection Tool"), FN(OnSelectTool), wxT("F1"));
1347  c->AddItem(wxT("EnvelopeTool"), XXO("&Envelope Tool"), FN(OnEnvelopeTool), wxT("F2"));
1348  c->AddItem(wxT("DrawTool"), XXO("&Draw Tool"), FN(OnDrawTool), wxT("F3"));
1349  c->AddItem(wxT("ZoomTool"), XXO("&Zoom Tool"), FN(OnZoomTool), wxT("F4"));
1350  c->AddItem(wxT("TimeShiftTool"), XXO("&Time Shift Tool"), FN(OnTimeShiftTool), wxT("F5"));
1351  c->AddItem(wxT("MultiTool"), XXO("&Multi Tool"), FN(OnMultiTool), wxT("F6"));
1352 
1353  c->AddItem(wxT("PrevTool"), XXO("&Previous Tool"), FN(OnPrevTool), wxT("A"));
1354  c->AddItem(wxT("NextTool"), XXO("&Next Tool"), FN(OnNextTool), wxT("D"));
1355  c->EndSubMenu();
1356 
1358 
1360  c->BeginSubMenu(_("Mi&xer"));
1361 
1362  c->AddItem(wxT("OutputGain"), XXO("Ad&just Playback Volume..."), FN(OnOutputGain));
1363  c->AddItem(wxT("OutputGainInc"), XXO("&Increase Playback Volume"), FN(OnOutputGainInc));
1364  c->AddItem(wxT("OutputGainDec"), XXO("&Decrease Playback Volume"), FN(OnOutputGainDec));
1365  c->AddItem(wxT("InputGain"), XXO("Adj&ust Recording Volume..."), FN(OnInputGain));
1366  c->AddItem(wxT("InputGainInc"), XXO("I&ncrease Recording Volume"), FN(OnInputGainInc));
1367  c->AddItem(wxT("InputGainDec"), XXO("D&ecrease Recording Volume"), FN(OnInputGainDec));
1368  c->EndSubMenu();
1369 
1371 
1373  c->BeginSubMenu(_("&Edit"));
1374 
1375  c->AddItem(wxT("DeleteKey"), XXO("&Delete Key"), FN(OnDelete), wxT("Backspace"),
1378 
1379  c->AddItem(wxT("DeleteKey2"), XXO("Delete Key&2"), FN(OnDelete), wxT("Delete"),
1382  c->EndSubMenu();
1383 
1385 
1387  c->BeginSubMenu(_("&Play-at-Speed"));
1388 
1389  /* i18n-hint: 'Normal Play-at-Speed' doesn't loop or cut preview. */
1390  c->AddItem(wxT("PlayAtSpeed"), XXO("Normal Pl&ay-at-Speed"), FN(OnPlayAtSpeed));
1391  c->AddItem(wxT("PlayAtSpeedLooped"), XXO("&Loop Play-at-Speed"), FN(OnPlayAtSpeedLooped));
1392  c->AddItem(wxT("PlayAtSpeedCutPreview"), XXO("Play C&ut Preview-at-Speed"), FN(OnPlayAtSpeedCutPreview));
1393  c->AddItem(wxT("SetPlaySpeed"), XXO("Ad&just Playback Speed..."), FN(OnSetPlaySpeed));
1394  c->AddItem(wxT("PlaySpeedInc"), XXO("&Increase Playback Speed"), FN(OnPlaySpeedInc));
1395  c->AddItem(wxT("PlaySpeedDec"), XXO("&Decrease Playback Speed"), FN(OnPlaySpeedDec));
1396 
1397  // These were on the original transcription toolbar. But they are not on the
1398  // shortened one.
1399  c->AddItem(wxT("MoveToPrevLabel"), XXO("Move to &Previous Label"), FN(OnMoveToPrevLabel), wxT("Alt+Left"),
1401  c->AddItem(wxT("MoveToNextLabel"), XXO("Move to &Next Label"), FN(OnMoveToNextLabel), wxT("Alt+Right"),
1403  c->EndSubMenu();
1404 
1406 
1407  c->SetDefaultFlags(AudioIOBusyFlag, AudioIOBusyFlag);
1408  c->BeginSubMenu(_("See&k"));
1409 
1410  c->AddItem(wxT("SeekLeftShort"), XXO("Short Seek &Left During Playback"), FN(OnSeekLeftShort), wxT("Left\tallowDup"));
1411  c->AddItem(wxT("SeekRightShort"), XXO("Short Seek &Right During Playback"), FN(OnSeekRightShort), wxT("Right\tallowDup"));
1412  c->AddItem(wxT("SeekLeftLong"), XXO("Long Seek Le&ft During Playback"), FN(OnSeekLeftLong), wxT("Shift+Left\tallowDup"));
1413  c->AddItem(wxT("SeekRightLong"), XXO("Long Seek Rig&ht During Playback"), FN(OnSeekRightLong), wxT("Shift+Right\tallowDup"));
1414  c->EndSubMenu();
1415 
1417 
1419  c->BeginSubMenu(_("De&vice"));
1420 
1421  c->AddItem(wxT("InputDevice"), XXO("Change &Recording Device..."), FN(OnInputDevice), wxT("Shift+I"),
1424  c->AddItem(wxT("OutputDevice"), XXO("Change &Playback Device..."), FN(OnOutputDevice), wxT("Shift+O"),
1427  c->AddItem(wxT("AudioHost"), XXO("Change Audio &Host..."), FN(OnAudioHost), wxT("Shift+H"),
1430  c->AddItem(wxT("InputChannels"), XXO("Change Recording Cha&nnels..."), FN(OnInputChannels), wxT("Shift+N"),
1433  c->EndSubMenu();
1434 
1436 
1438  c->BeginSubMenu(_("&Selection"));
1439 
1440  c->AddItem(wxT("SnapToOff"), XXO("Snap-To &Off"), FN(OnSnapToOff));
1441  c->AddItem(wxT("SnapToNearest"), XXO("Snap-To &Nearest"), FN(OnSnapToNearest));
1442  c->AddItem(wxT("SnapToPrior"), XXO("Snap-To &Prior"), FN(OnSnapToPrior));
1443 
1444  c->AddItem(wxT("SelStart"), XXO("Selection to &Start"), FN(OnSelToStart), wxT("Shift+Home"));
1445  c->AddItem(wxT("SelEnd"), XXO("Selection to En&d"), FN(OnSelToEnd), wxT("Shift+End"));
1446  c->AddItem(wxT("SelExtLeft"), XXO("Selection Extend &Left"), FN(OnSelExtendLeft), wxT("Shift+Left\twantKeyup\tallowDup"),
1449  c->AddItem(wxT("SelExtRight"), XXO("Selection Extend &Right"), FN(OnSelExtendRight), wxT("Shift+Right\twantKeyup\tallowDup"),
1452 
1453  c->AddItem(wxT("SelSetExtLeft"), XXO("Set (or Extend) Le&ft Selection"), FN(OnSelSetExtendLeft),
1456  c->AddItem(wxT("SelSetExtRight"), XXO("Set (or Extend) Rig&ht Selection"), FN(OnSelSetExtendRight),
1459 
1460  c->AddItem(wxT("SelCntrLeft"), XXO("Selection Contract L&eft"), FN(OnSelContractLeft), wxT("Ctrl+Shift+Right\twantKeyup"),
1463  c->AddItem(wxT("SelCntrRight"), XXO("Selection Contract R&ight"), FN(OnSelContractRight), wxT("Ctrl+Shift+Left\twantKeyup"),
1466 
1467  c->EndSubMenu();
1468 
1469 
1471  c->AddSeparator();
1472 
1473  c->AddGlobalCommand(wxT("PrevWindow"), XXO("Move Backward Through Active Windows"), FN(PrevWindow), wxT("Alt+Shift+F6"));
1474  c->AddGlobalCommand(wxT("NextWindow"), XXO("Move Forward Through Active Windows"), FN(NextWindow), wxT("Alt+F6"));
1475 
1477 
1479  c->BeginSubMenu(_("F&ocus"));
1480 
1481  c->AddItem(wxT("PrevFrame"), XXO("Move &Backward from Toolbars to Tracks"), FN(PrevFrame), wxT("Ctrl+Shift+F6"));
1482  c->AddItem(wxT("NextFrame"), XXO("Move F&orward from Toolbars to Tracks"), FN(NextFrame), wxT("Ctrl+F6"));
1483 
1486  c->AddItem(wxT("PrevTrack"), XXO("Move Focus to &Previous Track"), FN(OnCursorUp), wxT("Up"));
1487  c->AddItem(wxT("NextTrack"), XXO("Move Focus to &Next Track"), FN(OnCursorDown), wxT("Down"));
1488  c->AddItem(wxT("FirstTrack"), XXO("Move Focus to &First Track"), FN(OnFirstTrack), wxT("Ctrl+Home"));
1489  c->AddItem(wxT("LastTrack"), XXO("Move Focus to &Last Track"), FN(OnLastTrack), wxT("Ctrl+End"));
1490 
1491  c->AddItem(wxT("ShiftUp"), XXO("Move Focus to P&revious and Select"), FN(OnShiftUp), wxT("Shift+Up"));
1492  c->AddItem(wxT("ShiftDown"), XXO("Move Focus to N&ext and Select"), FN(OnShiftDown), wxT("Shift+Down"));
1493 
1494  c->AddItem(wxT("Toggle"), XXO("&Toggle Focused Track"), FN(OnToggle), wxT("Return"));
1495  c->AddItem(wxT("ToggleAlt"), XXO("Toggle Focuse&d Track"), FN(OnToggle), wxT("NUMPAD_ENTER"));
1496  c->EndSubMenu();
1497 
1499 
1501  c->BeginSubMenu(_("&Cursor"));
1502 
1503  c->AddItem(wxT("CursorLeft"), XXO("Cursor &Left"), FN(OnCursorLeft), wxT("Left\twantKeyup\tallowDup"),
1506  c->AddItem(wxT("CursorRight"), XXO("Cursor &Right"), FN(OnCursorRight), wxT("Right\twantKeyup\tallowDup"),
1509  c->AddItem(wxT("CursorShortJumpLeft"), XXO("Cursor Sh&ort Jump Left"), FN(OnCursorShortJumpLeft), wxT(","),
1512  c->AddItem(wxT("CursorShortJumpRight"), XXO("Cursor Shor&t Jump Right"), FN(OnCursorShortJumpRight), wxT("."),
1515  c->AddItem(wxT("CursorLongJumpLeft"), XXO("Cursor Long J&ump Left"), FN(OnCursorLongJumpLeft), wxT("Shift+,"),
1518  c->AddItem(wxT("CursorLongJumpRight"), XXO("Cursor Long Ju&mp Right"), FN(OnCursorLongJumpRight), wxT("Shift+."),
1521 
1522  c->AddItem(wxT("ClipLeft"), XXO("Clip L&eft"), FN(OnClipLeft), wxT("\twantKeyup"),
1525  c->AddItem(wxT("ClipRight"), XXO("Clip Rig&ht"), FN(OnClipRight), wxT("\twantKeyup"),
1528  c->EndSubMenu();
1529 
1531 
1533  c->BeginSubMenu(_("&Track"));
1534 
1535  c->AddItem(wxT("TrackPan"), XXO("Change P&an on Focused Track..."), FN(OnTrackPan), wxT("Shift+P"),
1538  c->AddItem(wxT("TrackPanLeft"), XXO("Pan &Left on Focused Track"), FN(OnTrackPanLeft), wxT("Alt+Shift+Left"),
1541  c->AddItem(wxT("TrackPanRight"), XXO("Pan &Right on Focused Track"), FN(OnTrackPanRight), wxT("Alt+Shift+Right"),
1544  c->AddItem(wxT("TrackGain"), XXO("Change Gai&n on Focused Track..."), FN(OnTrackGain), wxT("Shift+G"),
1547  c->AddItem(wxT("TrackGainInc"), XXO("&Increase Gain on Focused Track"), FN(OnTrackGainInc), wxT("Alt+Shift+Up"),
1550  c->AddItem(wxT("TrackGainDec"), XXO("&Decrease Gain on Focused Track"), FN(OnTrackGainDec), wxT("Alt+Shift+Down"),
1553  c->AddItem(wxT("TrackMenu"), XXO("Op&en Menu on Focused Track..."), FN(OnTrackMenu), wxT("Shift+M\tskipKeydown"),
1556  c->AddItem(wxT("TrackMute"), XXO("M&ute/Unmute Focused Track"), FN(OnTrackMute), wxT("Shift+U"),
1559  c->AddItem(wxT("TrackSolo"), XXO("&Solo/Unsolo Focused Track"), FN(OnTrackSolo), wxT("Shift+S"),
1562  c->AddItem(wxT("TrackClose"), XXO("&Close Focused Track"), FN(OnTrackClose), wxT("Shift+C"),
1565  c->AddItem(wxT("TrackMoveUp"), XXO("Move Focused Track U&p"), FN(OnTrackMoveUp),
1568  c->AddItem(wxT("TrackMoveDown"), XXO("Move Focused Track Do&wn"), FN(OnTrackMoveDown),
1571  c->AddItem(wxT("TrackMoveTop"), XXO("Move Focused Track to T&op"), FN(OnTrackMoveTop),
1574  c->AddItem(wxT("TrackMoveBottom"), XXO("Move Focused Track to &Bottom"), FN(OnTrackMoveBottom),
1577  c->EndSubMenu();
1578 
1579  // These are the more useful to VI user Scriptables.
1580  // i18n-hint: Scriptables are commands normally used from Python, Perl etc.
1581  c->BeginSubMenu(_("&Scriptables I"));
1582 
1583  // Note that the PLUGIN_SYMBOL must have a space between words,
1584  // whereas the short-form used here must not.
1585  // (So if you did write "CompareAudio" for the PLUGIN_SYMBOL name, then
1586  // you would have to use "Compareaudio" here.)
1587 
1588  c->AddItem(wxT("SelectTime"), XXO("Select Time..."), FN(OnAudacityCommand),
1589