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 ()
 
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 ()
 
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 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
 
- 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 }
 
std::unique_ptr< PlaybackScrollermPlaybackScroller
 

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 CountSelectedWaveTracks ()
 
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 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
 
std::unique_ptr< wxTimer > mTimer
 
long mLastStatusUpdateTime
 
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 413 of file Project.h.

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

Definition at line 412 of file Project.h.

Member Enumeration Documentation

Enumerator
DIRECTION_LEFT 
DIRECTION_RIGHT 

Definition at line 561 of file Project.h.

580  :
581 
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.

559 
ViewInfo is used mainly to hold the zooming, selection and scroll information. It also has some statu...
Definition: ViewInfo.h:141
ViewInfo mViewInfo
Definition: Project.h:558
Enumerator
TIME_UNIT_SECONDS 
TIME_UNIT_PIXELS 

Definition at line 566 of file Project.h.

580  :
581 

Constructor & Destructor Documentation

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

Definition at line 921 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().

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

Definition at line 1270 of file Project.cpp.

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

1271 {
1272  // Tool manager gives us capture sometimes
1273  if(HasCapture())
1274  ReleaseMouse();
1275 
1276  if (wxGetApp().GetRecentFiles())
1277  {
1279  }
1280 
1281  if(mTrackPanel) {
1282 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
1284 #endif
1287  }
1288 }
std::unique_ptr< Overlay > mIndicatorOverlay
Definition: Project.h:793
wxMenu * mRecentFilesMenu
Definition: Project.h:623
bool RemoveOverlay(Overlay *pOverlay)
std::unique_ptr< Overlay > mCursorOverlay
Definition: Project.h:793
std::unique_ptr< Overlay > mScrubOverlay
Definition: Project.h:798
void RemoveMenu(wxMenu *menu)
FileHistory * GetRecentFiles()
Definition: AudacityApp.h:154
AudacityApp & wxGetApp()
TrackPanel * mTrackPanel
Definition: Project.h:672

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 1974 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().

1980 {
1981  int namesCnt = (int) names.GetCount();
1982  int perGroup;
1983 
1984 #if defined(__WXGTK__)
1985  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 15);
1986 #else
1987  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 0);
1988 #endif
1989 
1990  int groupCnt = namesCnt;
1991  for (int i = 0; i < namesCnt; i++)
1992  {
1993  while (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
1994  {
1995  i++;
1996  groupCnt--;
1997  }
1998  }
1999 
2000  // The "default" effects shouldn't be broken into subgroups
2001  if (namesCnt > 0 && isDefault)
2002  {
2003  perGroup = 0;
2004  }
2005 
2006  int max = perGroup;
2007  int items = perGroup;
2008 
2009  if (max > groupCnt)
2010  {
2011  max = 0;
2012  }
2013 
2014  int groupNdx = 0;
2015  for (int i = 0; i < namesCnt; i++)
2016  {
2017  if (max > 0 && items == max)
2018  {
2019  int end = groupNdx + max;
2020  if (end + 1 > groupCnt)
2021  {
2022  end = groupCnt;
2023  }
2024  c->BeginSubMenu(wxString::Format(_("Plug-in %d to %d"),
2025  groupNdx + 1,
2026  end));
2027  }
2028 
2029  if (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
2030  {
2031  wxString name = names[i];
2032  c->BeginSubMenu(name);
2033  while (i < namesCnt && names[i].IsSameAs(name))
2034  {
2035  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2036  wxString item = plug->GetPath();
2037  if( plug->GetPluginType() == PluginTypeEffect )
2038  c->AddItem(item,
2039  item,
2040  item.Contains("..."),
2041  FN(OnEffect),
2042  flags[i],
2043  flags[i], true, plugs[i]);
2044 
2045  i++;
2046  }
2047  c->EndSubMenu();
2048  i--;
2049  }
2050  else
2051  {
2052  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2053  if( plug->GetPluginType() == PluginTypeEffect )
2054  c->AddItem(names[i],
2055  names[i],
2056  vHasDialog[i],
2057  FN(OnEffect),
2058  flags[i],
2059  flags[i], true, plugs[i]);
2060  }
2061 
2062  if (max > 0)
2063  {
2064  groupNdx++;
2065  items--;
2066  if (items == 0 || i + 1 == namesCnt)
2067  {
2068  c->EndSubMenu();
2069  items = max;
2070  }
2071  }
2072  }
2073 
2074  return;
2075 }
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:4658
_("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 1833 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().

1838 {
1839  size_t pluginCnt = plugs.size();
1840 
1841  wxString groupBy = gPrefs->Read(wxT("/Effects/GroupBy"), wxT("name"));
1842 
1843  bool grouped = false;
1844  if (groupBy.StartsWith(wxT("groupby")))
1845  {
1846  grouped = true;
1847  }
1848 
1849  std::vector<bool> vHasDialog;
1850  wxArrayString groupNames;
1851  PluginIDList groupPlugs;
1852  std::vector<CommandFlag> groupFlags;
1853  if (grouped)
1854  {
1855  wxString last;
1856  wxString current;
1857 
1858  for (size_t i = 0; i < pluginCnt; i++)
1859  {
1860  const PluginDescriptor *plug = plugs[i];
1861 
1862  bool hasDialog = plug->GetSymbol().Msgid().Contains("...");
1863  auto name = plug->GetSymbol().Translation();
1864 
1865  if (plug->IsEffectInteractive())
1866  {
1867  name += wxT("...");
1868  }
1869 
1870  if (groupBy == wxT("groupby:publisher"))
1871  {
1872  current = EffectManager::Get().GetVendorName(plug->GetID());
1873  if (current.IsEmpty())
1874  {
1875  current = _("Unknown");
1876  }
1877  }
1878  else if (groupBy == wxT("groupby:type"))
1879  {
1880  current = EffectManager::Get().GetEffectFamilyName(plug->GetID());
1881  if (current.IsEmpty())
1882  {
1883  current = _("Unknown");
1884  }
1885  }
1886 
1887  if (current != last)
1888  {
1889  bool bInSubmenu = !last.IsEmpty() && (groupNames.Count() > 1);
1890  if( bInSubmenu)
1891  c->BeginSubMenu(last);
1892 
1893  AddEffectMenuItemGroup(c, groupNames, vHasDialog,
1894  groupPlugs, groupFlags, isDefault);
1895 
1896  if (bInSubmenu)
1897  c->EndSubMenu();
1898 
1899  groupNames.Clear();
1900  vHasDialog.clear();
1901  groupPlugs.Clear();
1902  groupFlags.clear();
1903  last = current;
1904  }
1905 
1906  groupNames.Add(name);
1907  vHasDialog.push_back(hasDialog);
1908  groupPlugs.Add(plug->GetID());
1909  groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags);
1910  }
1911 
1912  if (groupNames.GetCount() > 0)
1913  {
1914  bool bInSubmenu = groupNames.Count() > 1;
1915  if (bInSubmenu)
1916  c->BeginSubMenu(current);
1917 
1918  AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault);
1919 
1920  if (bInSubmenu)
1921  c->EndSubMenu();
1922  }
1923  }
1924  else
1925  {
1926  for (size_t i = 0; i < pluginCnt; i++)
1927  {
1928  const PluginDescriptor *plug = plugs[i];
1929 
1930  bool hasDialog = plug->GetSymbol().Msgid().Contains("...");
1931  auto name = plug->GetSymbol().Translation();
1932 
1933  if (plug->IsEffectInteractive())
1934  {
1935  name += wxT("...");
1936  }
1937 
1938  wxString group = wxEmptyString;
1939  if (groupBy == wxT("sortby:publisher:name"))
1940  {
1941  group = EffectManager::Get().GetVendorName(plug->GetID());
1942  }
1943  else if (groupBy == wxT("sortby:type:name"))
1944  {
1945  group = EffectManager::Get().GetEffectFamilyName(plug->GetID());
1946  }
1947 
1948  if (plug->IsEffectDefault())
1949  {
1950  group = wxEmptyString;
1951  }
1952 
1953  if (!group.IsEmpty())
1954  {
1955  group += wxT(": ");
1956  }
1957 
1958  groupNames.Add(group + name);
1959  vHasDialog.push_back(hasDialog);
1960  groupPlugs.Add(plug->GetID());
1961  groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags);
1962  }
1963 
1964  if (groupNames.GetCount() > 0)
1965  {
1966  AddEffectMenuItemGroup(c, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault);
1967  }
1968 
1969  }
1970 
1971  return;
1972 }
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:1974
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 4283 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().

4285 {
4286  std::vector< std::shared_ptr< Track > > results;
4287 
4288  const auto numTracks = newTracks.size();
4289  SelectNone();
4290 
4291  bool initiallyEmpty = mTracks->empty();
4292  double newRate = 0;
4293  wxString trackNameBase = fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast('.');
4294  bool isLinked = false;
4295  int i = -1;
4296  for (auto &uNewTrack : newTracks) {
4297  ++i;
4298 
4299  auto newTrack = mTracks->Add(std::move(uNewTrack));
4300  results.push_back(Track::Pointer(newTrack));
4301  if (newRate == 0 && newTrack->GetKind() == Track::Wave) {
4302  newRate = ((WaveTrack *)newTrack)->GetRate();
4303  }
4304  newTrack->SetSelected(true);
4305  //we need to check link status based on the first channel only.
4306  if(0==i)
4307  isLinked = newTrack->GetLinked();
4308  if (numTracks > 2 || (numTracks > 1 && !isLinked) ) {
4309  newTrack->SetName(trackNameBase + wxString::Format(wxT(" %d" ), i + 1));
4310  }
4311  else {
4312  newTrack->SetName(trackNameBase);
4313  }
4314 
4315  // Check if NEW track contains aliased blockfiles and if yes,
4316  // remember this to show a warning later
4317  if (newTrack->GetKind() == WaveTrack::Wave)
4318  {
4319  if (WaveClip* clip = ((WaveTrack*)newTrack)->GetClipByIndex(0)) {
4320  BlockArray &blocks = clip->GetSequence()->GetBlockArray();
4321  if (blocks.size())
4322  {
4323  SeqBlock& block = blocks[0];
4324  if (block.f->IsAlias())
4325  {
4326  mImportedDependencies = true;
4327  }
4328  }
4329  }
4330  }
4331  }
4332 
4333  // Automatically assign rate of imported file to whole project,
4334  // if this is the first file that is imported
4335  if (initiallyEmpty && newRate > 0) {
4336  mRate = newRate;
4338  }
4339 
4340  PushState(wxString::Format(_("Imported '%s'"), fileName),
4341  _("Import"));
4342 
4343 #if defined(__WXGTK__)
4344  // See bug #1224
4345  // The track panel hasn't we been fully created, so the OnZoomFit() will not give
4346  // expected results due to a window width of zero. Should be safe to yield here to
4347  // allow the creattion to complete. If this becomes a problem, it "might" be possible
4348  // to queue a dummy event to trigger the OnZoomFit().
4349  wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT);
4350 #endif
4351 
4352  if (initiallyEmpty && !IsProjectSaved() ) {
4353  wxString name = fileName.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.'));
4354  mFileName =::wxPathOnly(fileName) + wxFILE_SEP_PATH + name + wxT(".aup");
4355  mbLoadedFromAup = false;
4356  SetProjectTitle();
4357  }
4358 
4359  // Moved this call to higher levels to prevent flicker redrawing everything on each file.
4360  // HandleResize();
4361 
4362  newTracks.clear();
4363 
4364  return results;
4365 }
Data structure containing pointer to a BlockFile and a start time. Element of a BlockArray.
Definition: Sequence.h:31
bool mbLoadedFromAup
Definition: Project.h:613
void SetRate(double rate)
wxString mFileName
Definition: Project.h:612
bool mImportedDependencies
Definition: Project.h:757
void SetProjectTitle(int number=-1)
Definition: Project.cpp:1478
double mRate
Definition: Project.h:619
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:4702
const wxChar * name
Definition: Distortion.cpp:94
void SelectNone()
Definition: Menus.cpp:6284
BlockFilePtr f
Definition: Sequence.h:33
bool IsProjectSaved()
Definition: Project.cpp:5996
SelectionBar * GetSelectionBar()
Definition: Project.cpp:5048
static std::shared_ptr< Subclass > Pointer(Track *t)
Definition: Track.h:137
std::shared_ptr< TrackList > mTracks
Definition: Project.h:632
double AudacityProject::AdjustForFindingEndTimes ( const std::vector< const WaveClip * > &  clips,
double  time 
)

Definition at line 7648 of file Menus.cpp.

Referenced by FindNextClipBoundary(), and FindPrevClipBoundary().

7649 {
7650  auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
7651  return clip->GetStartTime() == time; });
7652  if (q != clips.end() && q != clips.begin() &&
7653  (*(q - 1))->SharesBoundaryWithNextClip(*q)) {
7654  time = (*(q-1))->GetEndTime();
7655  }
7656 
7657  return time;
7658 }
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 7630 of file Menus.cpp.

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

7631 {
7632  auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
7633  return clip->GetEndTime() == time; });
7634  if (q != clips.end() && q + 1 != clips.end() &&
7635  (*q)->SharesBoundaryWithNextClip(*(q+1))) {
7636  time = (*(q+1))->GetStartTime();
7637  }
7638 
7639  return time;
7640 }
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 183 of file Project.cpp.

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

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

Definition at line 1290 of file Project.cpp.

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

Referenced by Theme::ApplyUpdatedImages().

1291 {
1292  SetBackgroundColour(theTheme.Colour( clrMedium ));
1293  ClearBackground();// For wxGTK.
1295 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
void ApplyUpdatedTheme()
Definition: TrackPanel.cpp:415
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
TrackPanel * mTrackPanel
Definition: Project.h:672
double AudacityProject::AS_GetRate ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1540 of file Project.cpp.

References mRate.

1541 {
1542  return mRate;
1543 }
double mRate
Definition: Project.h:619
const NumericFormatId & AudacityProject::AS_GetSelectionFormat ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1569 of file Project.cpp.

References GetSelectionFormat().

1570 {
1571  return GetSelectionFormat();
1572 }
const NumericFormatId & GetSelectionFormat() const
Definition: Project.cpp:1685
int AudacityProject::AS_GetSnapTo ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1550 of file Project.cpp.

References GetSnapTo().

1551 {
1552  return GetSnapTo();
1553 }
int GetSnapTo() const
Definition: Project.cpp:5653
void AudacityProject::AS_ModifySelection ( double &  start,
double &  end,
bool  done 
)
overridevirtual

Implements SelectionBarListener.

Definition at line 1691 of file Project.cpp.

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

1692 {
1693  mViewInfo.selectedRegion.setTimes(start, end);
1694  mTrackPanel->Refresh(false);
1695  if (done) {
1696  ModifyState(false);
1697  }
1698 }
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
ViewInfo mViewInfo
Definition: Project.h:558
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
void ModifyState(bool bWantsAutoSave)
Definition: Project.cpp:4747
bool setTimes(double t0, double t1)
TrackPanel * mTrackPanel
Definition: Project.h:672
void AudacityProject::AS_SetRate ( double  rate)
overridevirtual

Implements SelectionBarListener.

Definition at line 1545 of file Project.cpp.

References mRate.

1546 {
1547  mRate = rate;
1548 }
double mRate
Definition: Project.h:619
void AudacityProject::AS_SetSelectionFormat ( const NumericFormatId format)
overridevirtual

Implements SelectionBarListener.

Definition at line 1574 of file Project.cpp.

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

Referenced by SetSelectionFormat().

1575 {
1577 
1578  gPrefs->Write(wxT("/SelectionFormat"), mSelectionFormat.Internal());
1579  gPrefs->Flush();
1580 
1581  if (SnapSelection() && GetTrackPanel())
1582  GetTrackPanel()->Refresh(false);
1583 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1512
int format
Definition: ExportPCM.cpp:56
NumericFormatId mSelectionFormat
Definition: Project.h:635
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
const wxString & Internal() const
TrackPanel * GetTrackPanel()
Definition: Project.h:307
void AudacityProject::AS_SetSnapTo ( int  snap)
overridevirtual

Implements SelectionBarListener.

Definition at line 1555 of file Project.cpp.

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

Referenced by SetSnapTo().

1556 {
1557  mSnapTo = snap;
1558 
1559 // LLL: TODO - what should this be changed to???
1560 // mCommandManager.Check(wxT("Snap"), mSnapTo);
1561  gPrefs->Write(wxT("/SnapTo"), mSnapTo);
1562  gPrefs->Flush();
1563 
1564  SnapSelection();
1565 
1566  RedrawProject();
1567 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1378
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1512
void AudacityProject::AutoSave ( )
private

Definition at line 5457 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().

5458 {
5459  // SonifyBeginAutoSave(); // part of RBD's r10680 stuff now backed out
5460 
5461  // To minimize the possibility of race conditions, we first write to a
5462  // file with the extension ".tmp", then rename the file to .autosave
5463  wxString projName;
5464 
5465  if (mFileName.IsEmpty())
5466  projName = wxT("New Project");
5467  else
5468  projName = wxFileName(mFileName).GetName();
5469 
5470  wxString fn = wxFileName(FileNames::AutoSaveDir(),
5471  projName + wxString(wxT(" - ")) + CreateUniqueName()).GetFullPath();
5472 
5473  // PRL: I found a try-catch and rewrote it,
5474  // but this guard is unnecessary because AutoSaveFile does not throw
5475  bool success = GuardedCall< bool >( [&]
5476  {
5477  VarSetter<bool> setter(&mAutoSaving, true, false);
5478 
5479  AutoSaveFile buffer;
5480  WriteXMLHeader(buffer);
5481  WriteXML(buffer, false);
5482  mStrOtherNamesArray.Clear();
5483 
5484  wxFFile saveFile;
5485  saveFile.Open(fn + wxT(".tmp"), wxT("wb"));
5486  return buffer.Write(saveFile);
5487  } );
5488 
5489  if (!success)
5490  return;
5491 
5492  // Now that we have a NEW auto-save file, DELETE the old one
5494 
5495  if (!mAutoSaveFileName.IsEmpty())
5496  return; // could not remove auto-save file
5497 
5498  if (!wxRenameFile(fn + wxT(".tmp"), fn + wxT(".autosave")))
5499  {
5501  wxString::Format( _("Could not create autosave file: %s"),
5502  fn + wxT(".autosave") ),
5503  _("Error"), wxICON_STOP, this);
5504  return;
5505  }
5506 
5507  mAutoSaveFileName += fn + wxT(".autosave");
5508  // no-op cruft that's not #ifdefed for NoteTrack
5509  // See above for further comments.
5510  // SonifyEndAutoSave();
5511 }
void WriteXMLHeader(XMLWriter &xmlFile) const
Definition: Project.cpp:3745
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:3760
wxString mFileName
Definition: Project.h:612
static wxString CreateUniqueName()
Definition: Project.cpp:880
wxArrayString mStrOtherNamesArray
Definition: Project.h:759
wxString mAutoSaveFileName
Definition: Project.h:742
void DeleteCurrentAutoSaveFile()
Definition: Project.cpp:5513
static wxString AutoSaveDir()
Definition: FileNames.cpp:109
bool mAutoSaving
Definition: Project.h:745
_("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 5961 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().

5962 {
5963  AudacityProject *project = GetActiveProject();
5964  if (project)
5965  {
5966 // wxASSERT(project->mKeyboardCaptureHandler == NULL);
5967  project->mKeyboardCaptureHandler = handler;
5968  }
5969 }
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
wxWindow * mKeyboardCaptureHandler
Definition: Project.h:778
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
bool AudacityProject::ChannelsHaveSameClipBoundaries ( const WaveTrack wt)

Definition at line 6626 of file Menus.cpp.

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

Referenced by FindClipBoundaries(), and FindClips().

6627 {
6628  bool sameClips = false;
6629 
6630  if (wt->GetLinked() && wt->GetLink()) {
6631  auto& left = wt->GetClips();
6632  auto& right = static_cast<const WaveTrack*>(wt->GetLink())->GetClips();
6633  if (left.size() == right.size()) {
6634  sameClips = true;
6635  for (unsigned int i = 0; i < left.size(); i++) {
6636  if (left[i]->GetStartTime() != right[i]->GetStartTime() ||
6637  left[i]->GetEndTime() != right[i]->GetEndTime()) {
6638  sameClips = false;
6639  break;
6640  }
6641  }
6642  }
6643  }
6644 
6645  return sameClips;
6646 }
bool GetLinked() const
Definition: Track.h:279
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
WaveClipHolders & GetClips()
Definition: WaveTrack.h:364
Track * GetLink() const
Definition: Track.cpp:269
void AudacityProject::Clear ( )

Definition at line 4910 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().

4911 {
4912  TrackListIterator iter(GetTracks());
4913 
4914  Track *n = iter.First();
4915 
4916  while (n) {
4917  if (n->GetSelected() || n->IsSyncLockSelected()) {
4919  }
4920  n = iter.Next();
4921  }
4922 
4923  double seconds = mViewInfo.selectedRegion.duration();
4924 
4926 
4927  PushState(wxString::Format(_("Deleted %.2f seconds at t=%.2f"),
4928  seconds,
4930  _("Delete"));
4931 
4932  RedrawProject();
4933 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1378
double t0() const
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
bool GetSelected() const
Definition: Track.h:276
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:558
An iterator for a TrackList.
Definition: Track.h:402
_("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:4702
TrackList * GetTracks()
Definition: Project.h:192
double duration() const
void AudacityProject::ClearClipboard ( )
static

Definition at line 4900 of file Project.cpp.

References msClipboard, msClipProject, msClipT0, and msClipT1.

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

4901 {
4902  msClipT0 = 0.0;
4903  msClipT1 = 0.0;
4904  msClipProject = NULL;
4905  if (msClipboard) {
4906  msClipboard->Clear();
4907  }
4908 }
static double msClipT0
Definition: Project.h:644
static double msClipT1
Definition: Project.h:645
static std::shared_ptr< TrackList > msClipboard
Definition: Project.h:642
static AudacityProject * msClipProject
Definition: Project.h:643
bool AudacityProject::Clipboard ( )
inline

Definition at line 218 of file Project.h.

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

Definition at line 7777 of file Menus.cpp.

References _(), format, and wxPLURAL.

Referenced by OnCursorClipBoundary(), and OnSelectClipBoundary().

7778 {
7779  wxString message;
7780  for (auto& result : results) {
7781 
7782  auto longName = result.ComposeTrackName();
7783 
7784  wxString str;
7785  auto nClips = result.waveTrack->GetNumClips();
7786  if (result.nFound < 2) {
7787  /* i18n-hint: in the string after this one,
7788  First %s is replaced with the noun "start" or "end"
7789  identifying one end of a clip,
7790  first number gives the position of that clip in a sequence
7791  of clips,
7792  last number counts all clips,
7793  and the last string is the name of the track containing the clips.
7794  */
7795  _("dummyStringClipBoundaryMessage");
7796  auto format = wxPLURAL(
7797  "%s %d of %d clip %s",
7798  "%s %d of %d clips %s",
7799  nClips
7800  );
7801  str = wxString::Format(format,
7802  result.clipStart1 ? _("start") : _("end"),
7803  result.index1 + 1,
7804  nClips,
7805  longName
7806  );
7807  }
7808  else {
7809  /* i18n-hint: in the string after this one,
7810  First two %s are each replaced with the noun "start"
7811  or with "end", identifying and end of a clip,
7812  first and second numbers give the position of those clips in
7813  a seqeunce of clips,
7814  last number counts all clips,
7815  and the last string is the name of the track containing the clips.
7816  */
7817  _("dummyStringClipBoundaryMessageLong");
7818  auto format = wxPLURAL(
7819  "%s %d and %s %d of %d clip %s",
7820  "%s %d and %s %d of %d clips %s",
7821  nClips
7822  );
7823  str = wxString::Format(format,
7824  result.clipStart1 ? _("start") : _("end"),
7825  result.index1 + 1,
7826  result.clipStart2 ? _("start") : _("end"),
7827  result.index2 + 1,
7828  nClips,
7829  longName
7830  );
7831  }
7832 
7833  if (message.empty())
7834  message = str;
7835  else
7836  message = wxString::Format(_("%s, %s"), message, str);
7837  }
7838 
7839  return message;
7840 }
#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 6225 of file Menus.cpp.

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

Referenced by OnSelectSomething().

6226 {
6227  TrackListIterator iter(GetTracks());
6228 
6229  int count =0;
6230  for (Track *t = iter.First(); t; t = iter.Next()) {
6231  if( t->GetSelected() )
6232  count++;
6233  }
6234  return count;
6235 }
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:402
TrackList * GetTracks()
Definition: Project.h:192
int AudacityProject::CountSelectedWaveTracks ( )
private

Definition at line 6213 of file Menus.cpp.

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

6214 {
6215  TrackListIterator iter(GetTracks());
6216 
6217  int count =0;
6218  for (Track *t = iter.First(); t; t = iter.Next()) {
6219  if( (t->GetKind() == Track::Wave) && t->GetSelected() )
6220  count++;
6221  }
6222  return count;
6223 }
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:402
TrackList * GetTracks()
Definition: Project.h:192
int AudacityProject::CountUnnamed ( )
static

Definition at line 2117 of file Project.cpp.

References gAudacityProjects, and GetName().

Referenced by TitleRestorer::TitleRestorer().

2118 {
2119  int j = 0;
2120  for ( size_t i = 0; i < gAudacityProjects.size(); i++) {
2121  if ( gAudacityProjects[i] )
2122  if ( gAudacityProjects[i]->GetName().IsEmpty() )
2123  j++;
2124  }
2125  return j;
2126 }
AProjectArray gAudacityProjects
Definition: Project.cpp:303
wxString GetName()
Definition: Project.cpp:1465
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(), 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 
336 
338 
340 
341  c->AddItem(wxT("Close"), XXO("&Close"), FN(OnClose), wxT("Ctrl+W"));
342 
343  c->AddSeparator();
344 
345  c->BeginSubMenu( _("&Save Project") );
346  c->AddItem(wxT("Save"), XXO("&Save Project"), FN(OnSave), wxT("Ctrl+S"),
349  c->AddItem(wxT("SaveAs"), XXO("Save Project &As..."), FN(OnSaveAs));
350  // TODO: The next two items should be disabled if project is empty
351  c->AddItem(wxT("SaveCopy"), XXO("Save Lossless Copy of Project..."), FN(OnSaveCopy));
352 #ifdef USE_LIBVORBIS
353  c->AddItem(wxT("SaveCompressed"), XXO("&Save Compressed Copy of Project..."), FN(OnSaveCompressed));
354 #endif
355  c->EndSubMenu();
356  c->AddSeparator();
357 
358  c->BeginSubMenu( _("&Export") );
359 
360  // Enable Export audio commands only when there are audio tracks.
361  c->AddItem(wxT("ExportMp3"), XXO("Export as MP&3"), FN(OnExportMp3), wxT(""),
364 
365  c->AddItem(wxT("ExportWav"), XXO("Export as &WAV"), FN(OnExportWav), wxT(""),
368 
369  c->AddItem(wxT("ExportOgg"), XXO("Export as &OGG"), FN(OnExportOgg), wxT(""),
372 
373  c->AddItem(wxT("Export"), XXO("&Export Audio..."), FN(OnExportAudio), wxT("Ctrl+Shift+E"),
376 
377  // Enable Export Selection commands only when there's a selection.
378  c->AddItem(wxT("ExportSel"), XXO("Expo&rt Selected Audio..."), FN(OnExportSelection),
381 
382  c->AddItem(wxT("ExportLabels"), XXO("Export &Labels..."), FN(OnExportLabels),
385  // Enable Export audio commands only when there are audio tracks.
386  c->AddItem(wxT("ExportMultiple"), XXO("Export &Multiple..."), FN(OnExportMultiple), wxT("Ctrl+Shift+L"),
389 #if defined(USE_MIDI)
390  c->AddItem(wxT("ExportMIDI"), XXO("Export MI&DI..."), FN(OnExportMIDI),
393 #endif
394  c->EndSubMenu();
395 
396  c->BeginSubMenu(_("&Import"));
397 
398  c->AddItem(wxT("ImportAudio"), XXO("&Audio..."), FN(OnImport), wxT("Ctrl+Shift+I"));
399  c->AddItem(wxT("ImportLabels"), XXO("&Labels..."), FN(OnImportLabels));
400 #ifdef USE_MIDI
401  c->AddItem(wxT("ImportMIDI"), XXO("&MIDI..."), FN(OnImportMIDI));
402 #endif // USE_MIDI
403  c->AddItem(wxT("ImportRaw"), XXO("&Raw Data..."), FN(OnImportRaw));
404 
405  c->EndSubMenu();
406  c->AddSeparator();
407 
409 
410  c->AddItem(wxT("PageSetup"), XXO("Pa&ge Setup..."), FN(OnPageSetup),
413  /* i18n-hint: (verb) It's item on a menu. */
414  c->AddItem(wxT("Print"), XXO("&Print..."), FN(OnPrint),
417 
418  c->AddSeparator();
419 
420  // On the Mac, the Exit item doesn't actually go here...wxMac will pull it out
421  // and put it in the Audacity menu for us based on its ID.
422  /* i18n-hint: (verb) It's item on a menu. */
423  c->AddItem(wxT("Exit"), XXO("E&xit"), FN(OnExit), wxT("Ctrl+Q"),
426 
427  c->EndMenu();
428 
430  // Edit Menu
432 
433  c->BeginMenu(_("&Edit"));
434 
437 
438  c->AddItem(wxT("Undo"), XXO("&Undo"), FN(OnUndo), wxT("Ctrl+Z"),
441 
442  // The default shortcut key for Redo is different on different platforms.
443  wxString key =
444 #ifdef __WXMSW__
445  wxT("Ctrl+Y");
446 #else
447  wxT("Ctrl+Shift+Z");
448 #endif
449 
450  c->AddItem(wxT("Redo"), XXO("&Redo"), FN(OnRedo), key,
453 
455 
456  c->AddSeparator();
457 
458  // Basic Edit coomands
459  /* i18n-hint: (verb)*/
460  c->AddItem(wxT("Cut"), XXO("Cu&t"), FN(OnCut), wxT("Ctrl+X"),
463  c->AddItem(wxT("Delete"), XXO("&Delete"), FN(OnDelete), wxT("Ctrl+K"),
466  /* i18n-hint: (verb)*/
467  c->AddItem(wxT("Copy"), XXO("&Copy"), FN(OnCopy), wxT("Ctrl+C"),
470  /* i18n-hint: (verb)*/
471  c->AddItem(wxT("Paste"), XXO("&Paste"), FN(OnPaste), wxT("Ctrl+V"),
474  /* i18n-hint: (verb)*/
475  c->AddItem(wxT("Duplicate"), XXO("Duplic&ate"), FN(OnDuplicate), wxT("Ctrl+D"));
476 
477  c->AddSeparator();
478 
479  c->BeginSubMenu(_("R&emove Special"));
480  /* i18n-hint: (verb) Do a special kind of cut*/
481  c->AddItem(wxT("SplitCut"), XXO("Spl&it Cut"), FN(OnSplitCut), wxT("Ctrl+Alt+X"));
482  /* i18n-hint: (verb) Do a special kind of DELETE*/
483  c->AddItem(wxT("SplitDelete"), XXO("Split D&elete"), FN(OnSplitDelete), wxT("Ctrl+Alt+K"));
484 
485  c->AddSeparator();
486 
487  /* i18n-hint: (verb)*/
488  c->AddItem(wxT("Silence"), XXO("Silence Audi&o"), FN(OnSilence), wxT("Ctrl+L"),
491  /* i18n-hint: (verb)*/
492  c->AddItem(wxT("Trim"), XXO("Tri&m Audio"), FN(OnTrim), wxT("Ctrl+T"),
495  c->EndSubMenu();
496 
497  c->AddSeparator();
498 
500 
501  c->BeginSubMenu(_("Clip B&oundaries"));
502  /* i18n-hint: (verb) It's an item on a menu. */
503  c->AddItem(wxT("Split"), XXO("Sp&lit"), FN(OnSplit), wxT("Ctrl+I"),
506  c->AddItem(wxT("SplitNew"), XXO("Split Ne&w"), FN(OnSplitNew), wxT("Ctrl+Alt+I"),
509  c->AddSeparator();
510  /* i18n-hint: (verb)*/
511  c->AddItem(wxT("Join"), XXO("&Join"), FN(OnJoin), wxT("Ctrl+J"));
512  c->AddItem(wxT("Disjoin"), XXO("Detac&h at Silences"), FN(OnDisjoin), wxT("Ctrl+Alt+J"));
513  c->EndSubMenu();
514 
516 
517  c->BeginSubMenu(_("&Labels"));
518 
519  c->AddItem(wxT("EditLabels"), XXO("&Edit Labels..."), FN(OnEditLabels),
521 
522  c->AddSeparator();
523 
524  c->AddItem(wxT("AddLabel"), XXO("Add Label at &Selection"), FN(OnAddLabel), wxT("Ctrl+B"),
526  c->AddItem(wxT("AddLabelPlaying"), XXO("Add Label at &Playback Position"),
528 #ifdef __WXMAC__
529  wxT("Ctrl+."),
530 #else
531  wxT("Ctrl+M"),
532 #endif
534  AudioIOBusyFlag);
536  c->AddItem(wxT("PasteNewLabel"), XXO("Paste Te&xt to New Label"), FN(OnPasteNewLabel), wxT("Ctrl+Alt+V"),
538 
539  c->AddSeparator();
540 
541  c->AddCheck(wxT("TypeToCreateLabel"), XXO("&Type to Create a Label (on/off)"),
543 
544  c->EndSubMenu();
545 
547 
548  c->BeginSubMenu(_("La&beled Audio"));
549 
552 
553  /* i18n-hint: (verb)*/
554  c->SetLongName( _("Label Cut"))->AddItem(wxT("CutLabels"), XXO("&Cut"), FN(OnCutLabels), wxT("Alt+X"),
557  c->SetLongName( _("Label Delete"))->AddItem(wxT("DeleteLabels"), XXO("&Delete"), FN(OnDeleteLabels), wxT("Alt+K"),
560 
561  c->AddSeparator();
562 
563  /* i18n-hint: (verb) A special way to cut out a piece of audio*/
564  c->SetLongName( _("Label Split Cut"))->AddItem(wxT("SplitCutLabels"), XXO("&Split Cut"), FN(OnSplitCutLabels), wxT("Alt+Shift+X"));
565  c->SetLongName( _("Label Split Delete"))->AddItem(wxT("SplitDeleteLabels"), XXO("Sp&lit Delete"), FN(OnSplitDeleteLabels), wxT("Alt+Shift+K"));
566 
567  c->AddSeparator();
568 
569 
570  c->SetLongName( _("Label Silence"))->AddItem(wxT("SilenceLabels"), XXO("Silence &Audio"), FN(OnSilenceLabels), wxT("Alt+L"));
571  /* i18n-hint: (verb)*/
572  c->SetLongName( _("Label Copy"))->AddItem(wxT("CopyLabels"), XXO("Co&py"), FN(OnCopyLabels), wxT("Alt+Shift+C"));
573 
574  c->AddSeparator();
575 
576  /* i18n-hint: (verb)*/
577  c->SetLongName( _("Label Split"))->AddItem(wxT("SplitLabels"), XXO("Spli&t"), FN(OnSplitLabels), wxT("Alt+I"),
580  /* i18n-hint: (verb)*/
581  c->SetLongName( _("Label Join"))->AddItem(wxT("JoinLabels"), XXO("&Join"), FN(OnJoinLabels), wxT("Alt+J"));
582  c->AddItem(wxT("DisjoinLabels"), XXO("Detac&h at Silences"), FN(OnDisjoinLabels), wxT("Alt+Shift+J"));
583 
584  c->EndSubMenu();
585 
586  c->AddItem(wxT("EditMetaData"), XXO("Me&tadata..."), FN(OnEditMetadata),
588 
590 
591 #ifndef __WXMAC__
592  c->AddSeparator();
593 #endif
594 
595  // The default shortcut key for Preferences is different on different platforms.
596  key =
597 #ifdef __WXMAC__
598  wxT("Ctrl+,");
599 #else
600  wxT("Ctrl+P");
601 #endif
602 
603  c->AddItem(wxT("Preferences"), XXO("Pre&ferences..."), FN(OnPreferences), key,
606 
607  c->EndMenu();
608 
610  // Select Menu
612 
613  /* i18n-hint: (verb) It's an item on a menu. */
614  c->BeginMenu(_("&Select"));
616 
617  c->SetLongName( _("Select All"))->AddItem(wxT("SelectAll"), XXO("&All"), FN(OnSelectAll), wxT("Ctrl+A"));
618  c->SetLongName( _("Select None"))->AddItem(wxT("SelectNone"), XXO("&None"), FN(OnSelectNone), wxT("Ctrl+Shift+A"));
619 
621 
623 
624  c->BeginSubMenu(_("&Tracks"));
625  c->AddItem(wxT("SelAllTracks"), XXO("In All &Tracks"), FN(OnSelectAllTracks),
626  wxT("Ctrl+Shift+K"),
628 
629 #ifdef EXPERIMENTAL_SYNC_LOCK
630  c->SetLongName( _("Select Sync-Locked"))->AddItem(wxT("SelSyncLockTracks"), XXO("In All &Sync-Locked Tracks"),
631  FN(OnSelectSyncLockSel), wxT("Ctrl+Shift+Y"),
634 #endif
635 
636  c->EndSubMenu();
637 
639 
641 
642  c->BeginSubMenu(_("R&egion"));
643 
644  c->SetLongName( _("Set Selection Left at Play Position"))->AddItem(wxT("SetLeftSelection"), XXO("&Left at Playback Position"), FN(OnSetLeftSelection), wxT("["));
645  c->SetLongName( _("Set Selection Right at Play Position"))->AddItem(wxT("SetRightSelection"), XXO("&Right at Playback Position"), FN(OnSetRightSelection), wxT("]"));
647  c->SetLongName( _("Select Track Start to Cursor"))->AddItem(wxT("SelTrackStartToCursor"), XXO("Track &Start to Cursor"), FN(OnSelectStartCursor), wxT("Shift+J"),AlwaysEnabledFlag,AlwaysEnabledFlag);
648  c->SetLongName( _("Select Cursor to Track End"))->AddItem(wxT("SelCursorToTrackEnd"), XXO("Cursor to Track &End"), FN(OnSelectCursorEnd), wxT("Shift+K"),AlwaysEnabledFlag,AlwaysEnabledFlag);
649  c->SetLongName( _("Select Track Start to End"))->AddItem(wxT("SelTrackStartToEnd"), XXO("Track Start to En&d"), FN(OnSelectTrackStartToEnd), wxT(""),AlwaysEnabledFlag,AlwaysEnabledFlag);
650  c->AddSeparator();
651  // GA: Audacity had 'Store Re&gion' here previously. There is no one-step
652  // way to restore the 'Saved Cursor Position' in Select Menu, so arguably
653  // using the word 'Selection' to do duty for both saving the region or the
654  // cursor is better. But it does not belong in a 'Region' submenu.
655  c->AddItem(wxT("SelSave"), XXO("S&tore Selection"), FN(OnSelectionSave),
658  // Audacity had 'Retrieve Regio&n' here previously.
659  c->AddItem(wxT("SelRestore"), XXO("Retrieve Selectio&n"), FN(OnSelectionRestore),
662 
663  c->EndSubMenu();
664 
666 
668 
669 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
670  c->BeginSubMenu(_("S&pectral"));
671  c->AddItem(wxT("ToggleSpectralSelection"), XXO("To&ggle Spectral Selection"), FN(OnToggleSpectralSelection), wxT("Q"));
672  c->AddItem(wxT("NextHigherPeakFrequency"), XXO("Next &Higher Peak Frequency"), FN(OnNextHigherPeakFrequency));
673  c->AddItem(wxT("NextLowerPeakFrequency"), XXO("Next &Lower Peak Frequency"), FN(OnNextLowerPeakFrequency));
674  c->EndSubMenu();
675 #endif
676 
678 
680 
681  c->BeginSubMenu(_("Clip B&oundaries"));
682  c->AddItem(wxT("SelPrevClipBoundaryToCursor"), XXO("Pre&vious Clip Boundary to Cursor"),
685  c->AddItem(wxT("SelCursorToNextClipBoundary"), XXO("Cursor to Ne&xt Clip Boundary"),
688  c->SetLongName( _("Select Previous Clip"))->AddItem(wxT("SelPrevClip"), XXO("Previo&us Clip"), FN(OnSelectPrevClip), wxT("Alt+,"),
690  c->SetLongName( _("Select Next Clip"))->AddItem(wxT("SelNextClip"), XXO("N&ext Clip"), FN(OnSelectNextClip), wxT("Alt+."),
692 
693  c->EndSubMenu();
695 
696  c->AddSeparator();
697 
698  c->SetLongName( _("Select Cursor to Stored"))->AddItem(wxT("SelCursorStoredCursor"), XXO("Cursor to Stored &Cursor Position"), FN(OnSelectCursorStoredCursor),
699  wxT(""), TracksExistFlag, TracksExistFlag);
700 
701  c->AddItem(wxT("StoreCursorPosition"), XXO("Store Cursor Pos&ition"), FN(OnCursorPositionStore),
704  // Save cursor position is used in some selections.
705  // Maybe there should be a restore for it?
706 
707  c->AddSeparator();
708 
709  c->SetLongName( _("Select Zero Crossing"))->AddItem(wxT("ZeroCross"), XXO("At &Zero Crossings"), FN(OnZeroCrossing), wxT("Z"));
710 
711  c->EndMenu();
712 
714  // View Menu
716 
717  c->BeginMenu(_("&View"));
719  c->BeginSubMenu(_("&Zoom"));
720 
721  c->AddItem(wxT("ZoomIn"), XXO("Zoom &In"), FN(OnZoomIn), wxT("Ctrl+1"),
724  c->AddItem(wxT("ZoomNormal"), XXO("Zoom &Normal"), FN(OnZoomNormal), wxT("Ctrl+2"));
725  c->AddItem(wxT("ZoomOut"), XXO("Zoom &Out"), FN(OnZoomOut), wxT("Ctrl+3"),
728  c->AddItem(wxT("ZoomSel"), XXO("&Zoom to Selection"), FN(OnZoomSel), wxT("Ctrl+E"),
731  c->AddItem(wxT("ZoomToggle"), XXO("Zoom &Toggle"), FN(OnZoomToggle), wxT("Shift+Z"),
734  c->EndSubMenu();
735 
736  c->BeginSubMenu(_("T&rack Size"));
737  c->AddItem(wxT("FitInWindow"), XXO("&Fit to Width"), FN(OnZoomFit), wxT("Ctrl+F"));
738  c->AddItem(wxT("FitV"), XXO("Fit to &Height"), FN(OnZoomFitV), wxT("Ctrl+Shift+F"));
739  c->AddItem(wxT("CollapseAllTracks"), XXO("&Collapse All Tracks"), FN(OnCollapseAllTracks), wxT("Ctrl+Shift+C"));
740  c->AddItem(wxT("ExpandAllTracks"), XXO("E&xpand Collapsed Tracks"), FN(OnExpandAllTracks), wxT("Ctrl+Shift+X"));
741  c->EndSubMenu();
742 
743  c->BeginSubMenu(_("Sk&ip to"));
744  c->SetLongName( _("Skip to Selection Start"))->AddItem(wxT("SkipSelStart"), XXO("Selection Sta&rt"), FN(OnGoSelStart), wxT("Ctrl+["),
746  c->SetLongName( _("Skip to Selection End"))->AddItem(wxT("SkipSelEnd"), XXO("Selection En&d"), FN(OnGoSelEnd), wxT("Ctrl+]"),
748  c->EndSubMenu();
749 
750  c->AddSeparator();
751 
752  // History window should be available either for UndoAvailableFlag or RedoAvailableFlag,
753  // but we can't make the AddItem flags and mask have both, because they'd both have to be true for the
754  // command to be enabled.
755  // If user has Undone the entire stack, RedoAvailableFlag is on but UndoAvailableFlag is off.
756  // If user has done things but not Undone anything, RedoAvailableFlag is off but UndoAvailableFlag is on.
757  // So in either of those cases, (AudioIONotBusyFlag | UndoAvailableFlag | RedoAvailableFlag) mask
758  // would fail.
759  // The only way to fix this in the current architecture is to hack in special cases for RedoAvailableFlag
760  // in AudacityProject::UpdateMenus() (ugly) and CommandManager::HandleCommandEntry() (*really* ugly --
761  // shouldn't know about particular command names and flags).
762  // Here's the hack that would be necessary in AudacityProject::UpdateMenus(), if somebody decides to do it:
763  // // Because EnableUsingFlags requires all the flag bits match the corresponding mask bits,
764  // // "UndoHistory" specifies only AudioIONotBusyFlag | UndoAvailableFlag, because that
765  // // covers the majority of cases where it should be enabled.
766  // // If history is not empty but we've Undone the whole stack, we also want to enable,
767  // // to show the Redo's on stack.
768  // // "UndoHistory" might already be enabled, but add this check for RedoAvailableFlag.
769  // if (flags & RedoAvailableFlag)
770  // mCommandManager.Enable(wxT("UndoHistory"), true);
771  // So for now, enable the command regardless of stack. It will just show empty sometimes.
772  // FOR REDESIGN, clearly there are some limitations with the flags/mask bitmaps.
773 
774  /* i18n-hint: Clicking this menu item shows the various editing steps that have been taken.*/
775  c->AddItem(wxT("UndoHistory"), XXO("&History..."), FN(OnHistory),
778 
779  c->AddItem(wxT("Karaoke"), XXO("&Karaoke..."), FN(OnKaraoke), LabelTracksExistFlag, LabelTracksExistFlag);
780  c->AddItem(wxT("MixerBoard"), XXO("&Mixer Board..."), FN(OnMixerBoard), PlayableTracksExistFlag, PlayableTracksExistFlag);
781 
782  c->AddSeparator();
783 
785 
786  c->BeginSubMenu(_("&Toolbars"));
787 
788  /* i18n-hint: (verb)*/
789  c->AddItem(wxT("ResetToolbars"), XXO("Reset Toolb&ars"), FN(OnResetToolBars), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
790  c->AddSeparator();
791 
792  /* i18n-hint: Clicking this menu item shows the toolbar with the big buttons on it (play record etc)*/
793  c->AddCheck(wxT("ShowTransportTB"), XXO("&Transport Toolbar"), FN(OnShowTransportToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
794  /* i18n-hint: Clicking this menu item shows a toolbar that has some tools in it*/
795  c->AddCheck(wxT("ShowToolsTB"), XXO("T&ools Toolbar"), FN(OnShowToolsToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
796  /* i18n-hint: Clicking this menu item shows the toolbar with the recording level meters*/
797  c->AddCheck(wxT("ShowRecordMeterTB"), XXO("&Recording Meter Toolbar"), FN(OnShowRecordMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
798  /* i18n-hint: Clicking this menu item shows the toolbar with the playback level meter*/
799  c->AddCheck(wxT("ShowPlayMeterTB"), XXO("&Playback Meter Toolbar"), FN(OnShowPlayMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
800  /* --i18n-hint: Clicking this menu item shows the toolbar which has sound level meters*/
801  //c->AddCheck(wxT("ShowMeterTB"), XXO("Co&mbined Meter Toolbar"), FN(OnShowMeterToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
802  /* i18n-hint: Clicking this menu item shows the toolbar with the mixer*/
803  c->AddCheck(wxT("ShowMixerTB"), XXO("Mi&xer Toolbar"), FN(OnShowMixerToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
804  /* i18n-hint: Clicking this menu item shows the toolbar for editing*/
805  c->AddCheck(wxT("ShowEditTB"), XXO("&Edit Toolbar"), FN(OnShowEditToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
806  /* i18n-hint: Clicking this menu item shows the toolbar for transcription (currently just vary play speed)*/
807  c->AddCheck(wxT("ShowTranscriptionTB"), XXO("Tra&nscription Toolbar"), FN(OnShowTranscriptionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
808  /* i18n-hint: Clicking this menu item shows the toolbar that enables Scrub or Seek playback and Scrub Ruler*/
809  c->AddCheck(wxT("ShowScrubbingTB"), XXO("Scru&b Toolbar"), FN(OnShowScrubbingToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
810  /* i18n-hint: Clicking this menu item shows the toolbar that manages devices*/
811  c->AddCheck(wxT("ShowDeviceTB"), XXO("&Device Toolbar"), FN(OnShowDeviceToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
812  /* i18n-hint: Clicking this menu item shows the toolbar for selecting a time range of audio*/
813  c->AddCheck(wxT("ShowSelectionTB"), XXO("&Selection Toolbar"), FN(OnShowSelectionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
814 #ifdef EXPERIMENTAL_SPECTRAL_EDITING
815  /* i18n-hint: Clicking this menu item shows the toolbar for selecting a frequency range of audio*/
816  c->AddCheck(wxT("ShowSpectralSelectionTB"), XXO("Spe&ctral Selection Toolbar"), FN(OnShowSpectralSelectionToolBar), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
817 #endif
818 
819  c->EndSubMenu();
820 
821  c->AddSeparator();
822 
823  c->AddCheck(wxT("ShowExtraMenus"), XXO("&Extra Menus (on/off)"), FN(OnShowExtraMenus),
824  gPrefs->Read(wxT("/GUI/ShowExtraMenus"), 0L), AlwaysEnabledFlag, AlwaysEnabledFlag);
825  c->AddCheck(wxT("ShowClipping"), XXO("&Show Clipping (on/off)"), FN(OnShowClipping),
826  gPrefs->Read(wxT("/GUI/ShowClipping"), 0L), AlwaysEnabledFlag, AlwaysEnabledFlag);
827 #if defined(EXPERIMENTAL_EFFECTS_RACK)
828  c->AddCheck(wxT("ShowEffectsRack"), XXO("Show Effects Rack"), FN(OnShowEffectsRack), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
829 #endif
830 
831 
832  c->EndMenu();
833 
835  // Transport Menu
837 
838  /*i18n-hint: 'Transport' is the name given to the set of controls that
839  play, record, pause etc. */
840  c->BeginMenu(_("Tra&nsport"));
842  c->BeginSubMenu(_("Pl&aying"));
843  /* i18n-hint: (verb) Start or Stop audio playback*/
844  c->AddItem(wxT("PlayStop"), XXO("Pl&ay/Stop"), FN(OnPlayStop), wxT("Space"));
845  c->AddItem(wxT("PlayStopSelect"), XXO("Play/Stop and &Set Cursor"), FN(OnPlayStopSelect), wxT("X"));
846  c->AddItem(wxT("PlayLooped"), XXO("&Loop Play"), FN(OnPlayLooped), wxT("Shift+Space"),
849  c->AddItem(wxT("Pause"), XXO("&Pause"), FN(OnPause), wxT("P"));
850  c->EndSubMenu();
851 
852  c->BeginSubMenu( _("&Recording"));
855  /* i18n-hint: (verb)*/
856  c->AddItem(wxT("Record1stChoice"), XXO("&Record"), FN(OnRecord), wxT("R"));
857  // The OnRecord2ndChoice function is: if normal record records beside,
858  // it records below, if normal record records below, it records beside.
859  // TODO: Do 'the right thing' with other options like TimerRecord.
860  bool bPreferNewTrack;
861  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
862  c->AddItem( wxT("Record2ndChoice"),
863  // Our first choice is bound to R (by default) and gets the prime position.
864  // We supply the name for the 'other one' here. It should be bound to Shift+R
865  (bPreferNewTrack ? _("&Append Record") : _("Record &New Track")), false,
867  wxT("Shift+R")
868  );
869 
870  c->AddItem(wxT("TimerRecord"), XXO("&Timer Record..."), FN(OnTimerRecord), wxT("Shift+T"));
871 
872 #ifdef EXPERIMENTAL_PUNCH_AND_ROLL
873  c->AddItem(wxT("PunchAndRoll"), XXO("Punch and Rol&l Record"), FN(OnPunchAndRoll), wxT("Shift+D"),
876 #endif
877 
878  // JKC: I decided to duplicate this between play and record, rather than put it
879  // at the top level. AddItem can now cope with simple duplicated items.
880  // PRL: This second registration of wxT("Pause"), with unspecified flags,
881  // in fact will use the same flags as in the previous registration.
882  c->AddItem(wxT("Pause"), XXO("&Pause"), FN(OnPause), wxT("P"));
883  c->EndSubMenu();
884 
885  // Scrubbing sub-menu
887 
888  // JKC: ANSWER-ME: How is 'cursor to' different to 'Skip To' and how is it useful?
889  // GA: 'Skip to' moves the viewpoint to center of the track and preserves the
890  // selection. 'Cursor to' does neither. 'Center at' might describe it better than 'Skip'.
891  c->BeginSubMenu(_("&Cursor to"));
892 
893  c->SetLongName( _("Cursor to Selection Start"))->AddItem(wxT("CursSelStart"), XXO("Selection Star&t"), FN(OnCursorSelStart),
895  c->SetLongName( _("Cursor to Selection End"))->AddItem(wxT("CursSelEnd"), XXO("Selection En&d"), FN(OnCursorSelEnd),
897 
898  c->SetLongName( _("Cursor to Track Start"))->AddItem(wxT("CursTrackStart"), XXO("Track &Start"), FN(OnCursorTrackStart), wxT("J"),
900  c->SetLongName( _("Cursor to Track End"))->AddItem(wxT("CursTrackEnd"), XXO("Track &End"), FN(OnCursorTrackEnd), wxT("K"),
902 
903  c->SetLongName( _("Cursor to Prev Clip Boundary"))->AddItem(wxT("CursPrevClipBoundary"), XXO("Pre&vious Clip Boundary"), FN(OnCursorPrevClipBoundary), wxT(""),
905  c->SetLongName( _("Cursor to Next Clip Boundary"))->AddItem(wxT("CursNextClipBoundary"), XXO("Ne&xt Clip Boundary"), FN(OnCursorNextClipBoundary), wxT(""),
907 
908  c->SetLongName( _("Cursor to Project Start"))->AddItem(wxT("CursProjectStart"), XXO("&Project Start"), FN(OnSkipStart), wxT("Home"));
909  c->SetLongName( _("Cursor to Project End"))->AddItem(wxT("CursProjectEnd"), XXO("Project E&nd"), FN(OnSkipEnd), wxT("End"));
910 
911  c->EndSubMenu();
912 
913  c->AddSeparator();
914 
916 
917  c->BeginSubMenu(_("Pla&y Region"));
918 
919  c->AddItem(wxT("LockPlayRegion"), XXO("&Lock"), FN(OnLockPlayRegion),
922  c->AddItem(wxT("UnlockPlayRegion"), XXO("&Unlock"), FN(OnUnlockPlayRegion),
925 
926  c->EndSubMenu();
927 
928  c->AddSeparator();
929 
930  c->AddItem(wxT("RescanDevices"), XXO("R&escan Audio Devices"), FN(OnRescanDevices),
933 
934  c->BeginSubMenu(_("Transport &Options"));
935  // Sound Activated recording options
936  c->AddItem(wxT("SoundActivationLevel"), XXO("Sound Activation Le&vel..."), FN(OnSoundActivated),
939  c->AddCheck(wxT("SoundActivation"), XXO("Sound A&ctivated Recording (on/off)"), FN(OnToggleSoundActivated), 0,
942  c->AddSeparator();
943 
944  c->AddCheck(wxT("PinnedHead"), XXO("Pinned Play/Record &Head (on/off)"),
946  // Switching of scrolling on and off is permitted even during transport
948 
949  c->AddCheck(wxT("Duplex"), XXO("&Overdub (on/off)"), FN(OnTogglePlayRecording), 0,
952  c->AddCheck(wxT("SWPlaythrough"), XXO("So&ftware Playthrough (on/off)"), FN(OnToggleSWPlaythrough), 0,
955 
956 
957 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
958  c->AddCheck(wxT("AutomatedInputLevelAdjustmentOnOff"), XXO("A&utomated Recording Level Adjustment (on/off)"), FN(OnToggleAutomatedInputLevelAdjustment), 0,
961 #endif
962  c->EndSubMenu();
963 
964  c->EndMenu();
965 
967  // Tracks Menu (formerly Project Menu)
969 
970  c->BeginMenu(_("&Tracks"));
972 
974 
975  c->BeginSubMenu(_("Add &New"));
976 
977  c->AddItem(wxT("NewMonoTrack"), XXO("&Mono Track"), FN(OnNewWaveTrack), wxT("Ctrl+Shift+N"));
978  c->AddItem(wxT("NewStereoTrack"), XXO("&Stereo Track"), FN(OnNewStereoTrack));
979  c->AddItem(wxT("NewLabelTrack"), XXO("&Label Track"), FN(OnNewLabelTrack));
980  c->AddItem(wxT("NewTimeTrack"), XXO("&Time Track"), FN(OnNewTimeTrack));
981 
982  c->EndSubMenu();
983 
985 
986  c->AddSeparator();
987 
988  c->BeginSubMenu(_("Mi&x") );
989  {
990  // Stereo to Mono is an oddball command that is also subject to control by the
991  // plug-in manager, as if an effect. Decide whether to show or hide it.
992  const PluginID ID = EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono"));
993  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
994  if (plug && plug->IsEnabled())
995  c->AddItem(wxT("Stereo to Mono"), XXO("Mix Stereo Down to &Mono"), FN(OnStereoToMono),
998  }
999  c->AddItem(wxT("MixAndRender"), XXO("Mi&x and Render"), FN(OnMixAndRender),
1002  c->AddItem(wxT("MixAndRenderToNewTrack"), XXO("Mix and Render to Ne&w Track"), FN(OnMixAndRenderToNewTrack), wxT("Ctrl+Shift+M"),
1005  c->EndSubMenu();
1006 
1007  c->AddItem(wxT("Resample"), XXO("&Resample..."), FN(OnResample),
1010 
1011  c->AddSeparator();
1012 
1013  c->AddItem(wxT("RemoveTracks"), XXO("Remo&ve Tracks"), FN(OnRemoveTracks),
1016 
1017  c->AddSeparator();
1018 
1019  c->BeginSubMenu(_("M&ute/Unmute"));
1020  c->AddItem(wxT("MuteAllTracks"), XXO("&Mute All Tracks"), FN(OnMuteAllTracks), wxT("Ctrl+U"));
1021  c->AddItem(wxT("UnmuteAllTracks"), XXO("&Unmute All Tracks"), FN(OnUnmuteAllTracks), wxT("Ctrl+Shift+U"));
1022  c->EndSubMenu();
1023 
1024  c->BeginSubMenu(_("&Pan"));
1025  // As Pan changes are not saved on Undo stack, pan settings for all tracks
1026  // in the project could very easily be lost unless we require the tracks to be selcted.
1028  c->SetLongName( _("Pan Left"))->AddItem(wxT("PanLeft"), XXO("&Left"), FN(OnPanLeft));
1029  c->SetLongName( _("Pan Right"))->AddItem(wxT("PanRight"), XXO("&Right"), FN(OnPanRight));
1030  c->SetLongName( _("Pan Center"))->AddItem(wxT("PanCenter"), XXO("&Center"), FN(OnPanCenter));
1031  c->EndSubMenu();
1032 
1033 
1034  c->AddSeparator();
1035 
1037 
1038  const TranslatedInternalString alignLabelsNoSync[] = {
1039  { wxT("EndToEnd"), _("&Align End to End") },
1040  { wxT("Together"), _("Align &Together") },
1041  };
1042 
1043  const TranslatedInternalString alignLabels[] = {
1044  { wxT("StartToZero"), _("Start to &Zero") },
1045  { wxT("StartToSelStart"), _("Start to &Cursor/Selection Start") },
1046  { wxT("StartToSelEnd"), _("Start to Selection &End") },
1047  { wxT("EndToSelStart"), _("End to Cu&rsor/Selection Start") },
1048  { wxT("EndToSelEnd"), _("End to Selection En&d") },
1049  };
1050  mAlignLabelsCount = sizeof(alignLabels) / sizeof(alignLabels[0]);
1051 
1052  // Calling c->SetCommandFlags() after AddItemList for "Align" and "AlignMove"
1053  // does not correctly set flags for submenus, so do it this way.
1056 
1057  c->BeginSubMenu(_("&Align Tracks"));
1058 
1059  //c->BeginSubMenu(_("Just Move Tracks"));
1060  c->AddItemList(wxT("Align"), alignLabelsNoSync, 2u, FN(OnAlignNoSync));
1061  c->AddSeparator();
1062  c->AddItemList(wxT("Align"), alignLabels, mAlignLabelsCount, FN(OnAlign));
1063  c->AddSeparator();
1064  c->AddCheck(wxT("MoveSelectionWithTracks"), XXO("&Move Selection with Tracks (on/off)"),
1066  gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), 0L),
1068  c->EndSubMenu();
1069 
1070 #if 0
1071  // TODO: Can these labels be made clearer? Do we need this sub-menu at all?
1072  c->BeginSubMenu(_("Move Sele&ction and Tracks"));
1073 
1074  c->AddItemList(wxT("AlignMove"), alignLabels, mAlignLabelsCount, FN(OnAlignMoveSel));
1075  c->SetCommandFlags(wxT("AlignMove"),
1078 
1079  c->EndSubMenu();
1080 #endif
1081 
1083 
1084 
1086 
1087 #ifdef EXPERIMENTAL_SCOREALIGN
1088  c->AddItem(wxT("ScoreAlign"), XXO("Synchronize MIDI with Audio"), FN(OnScoreAlign),
1091 #endif // EXPERIMENTAL_SCOREALIGN
1092 
1094 
1095  c->BeginSubMenu(_("S&ort Tracks"));
1096 
1097  c->SetLongName( _("Sort by Time"))->AddItem(wxT("SortByTime"), XXO("By &Start Time"), FN(OnSortTime),
1099  TracksExistFlag);
1100  c->SetLongName( _("Sort by Name"))->AddItem(wxT("SortByName"), XXO("By &Name"), FN(OnSortName),
1102  TracksExistFlag);
1103 
1104  c->EndSubMenu();
1105 
1107 
1108 #ifdef EXPERIMENTAL_SYNC_LOCK
1109  c->AddSeparator();
1110  c->AddCheck(wxT("SyncLock"), XXO("Sync-&Lock Tracks (on/off)"), FN(OnSyncLock),
1111  gPrefs->Read(wxT("/GUI/SyncLockTracks"), 0L),
1113 
1114 #endif
1115 
1116  c->EndMenu();
1117 
1118  // All of this is a bit hacky until we can get more things connected into
1119  // the plugin manager...sorry! :-(
1120 
1121  wxArrayString defaults;
1122 
1124  // Generate Menu
1126 
1127  c->BeginMenu(_("&Generate"));
1129 
1130 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1131  c->AddItem(wxT("ManageGenerators"), XXO("Add / Remove Plug-ins..."), FN(OnManageGenerators));
1132  c->AddSeparator();
1133 #endif
1134 
1135 
1140 
1141  c->EndMenu();
1142 
1144  // Effect Menu
1146 
1147  c->BeginMenu(_("Effe&ct"));
1148 
1149  wxString buildMenuLabel;
1150  if (!mLastEffect.IsEmpty()) {
1151  buildMenuLabel.Printf(_("Repeat %s"),
1152  EffectManager::Get().GetCommandName(mLastEffect));
1153  }
1154  else
1155  buildMenuLabel = _("Repeat Last Effect");
1156 
1157 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1158  c->AddItem(wxT("ManageEffects"), XXO("Add / Remove Plug-ins..."), FN(OnManageEffects));
1159  c->AddSeparator();
1160 #endif
1161 
1162  c->AddItem(wxT("RepeatLastEffect"), buildMenuLabel, false, FN(OnRepeatLastEffect), wxT("Ctrl+R"),
1165 
1166  c->AddSeparator();
1167 
1172 
1173  c->EndMenu();
1174 
1176  // Analyze Menu
1178 
1179  c->BeginMenu(_("&Analyze"));
1180 
1181 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1182  c->AddItem(wxT("ManageAnalyzers"), XXO("Add / Remove Plug-ins..."), FN(OnManageAnalyzers));
1183  c->AddSeparator();
1184 #endif
1185 
1186 
1187  c->AddItem(wxT("ContrastAnalyser"), XXO("Contrast..."), FN(OnContrast), wxT("Ctrl+Shift+T"),
1190  c->AddItem(wxT("PlotSpectrum"), XXO("Plot Spectrum..."), FN(OnPlotSpectrum),
1193 
1198 
1199  c->EndMenu();
1200 
1202  // Tools Menu
1204 
1205  c->BeginMenu(_("T&ools"));
1206 
1207 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1208  c->AddItem(wxT("ManageTools"), XXO("Add / Remove Plug-ins..."), FN(OnManageTools));
1209  //c->AddSeparator();
1210 #endif
1211 
1212  c->AddItem(wxT("ManageMacros"), XXO("&Macros..."), FN(OnManageMacros));
1213 
1214  c->BeginSubMenu(_("&Apply Macro"));
1215  c->AddItem(wxT("ApplyMacrosPalette"), XXO("&Palette..."), FN(OnApplyMacrosPalette));
1216  c->AddSeparator();
1218  c->EndSubMenu();
1219  c->AddSeparator();
1220 
1221  c->AddItem(wxT("FancyScreenshot"), XXO("&Screenshot..."), FN(OnScreenshot));
1222 
1223 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
1224 // as they used to in 1.3.x
1225 //#ifdef IS_ALPHA
1226  // TODO: What should we do here? Make benchmark a plug-in?
1227  // Easy enough to do. We'd call it mod-self-test.
1228  c->AddItem(wxT("Benchmark"), XXO("&Run Benchmark..."), FN(OnBenchmark));
1229 //#endif
1230 
1231 #ifdef IS_ALPHA
1232  c->AddCheck(wxT("SimulateRecordingErrors"),
1233  XXO("Simulate Recording Errors"),
1236  c->AddCheck(wxT("DetectUpstreamDropouts"),
1237  XXO("Detect Upstream Dropouts"),
1240 #endif
1241  c->AddSeparator();
1242 
1247 
1248  c->EndMenu();
1249 
1250 
1251 #ifdef __WXMAC__
1252  // poor imitation of the Mac Windows Menu
1255 
1256  {
1257  c->BeginMenu(_("&Window"));
1258  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1259  * window) shrink to an icon on the dock */
1260  c->AddItem(wxT("MacMinimize"), XXO("&Minimize"), FN(OnMacMinimize),
1261  wxT("Ctrl+M"), NotMinimizedFlag, NotMinimizedFlag);
1262  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1263  * window) full sized */
1264  c->AddItem(wxT("MacZoom"), XXO("&Zoom"), FN(OnMacZoom),
1266  c->AddSeparator();
1267  /* i18n-hint: Standard Macintosh Window menu item: Make all project
1268  * windows un-hidden */
1269  c->AddItem(wxT("MacBringAllToFront"),
1270  XXO("&Bring All to Front"), FN(OnMacBringAllToFront),
1272  c->EndMenu();
1273  }
1274 #endif
1275 
1276 
1278 
1279  bool bShowExtraMenus;
1280  gPrefs->Read(wxT("/GUI/ShowExtraMenus"), &bShowExtraMenus, false);
1281  std::unique_ptr<wxMenuBar> menubar2;
1282  if( !bShowExtraMenus )
1283  {
1284  menubar2 = c->AddMenuBar(wxT("ext-menu"));
1285  c->SetOccultCommands(true);
1286  }
1287 
1289  // Ext-Menu
1291 
1292  // i18n-hint: Extra is a menu with extra commands
1293  c->BeginMenu(_("Ext&ra"));
1294 
1296 
1298  c->BeginSubMenu(_("T&ransport"));
1299 
1300  // PlayStop is already in the menus.
1301  /* i18n-hint: (verb) Start playing audio*/
1302  c->AddItem(wxT("Play"), XXO("Pl&ay"), FN(OnPlayStop),
1305  /* i18n-hint: (verb) Stop playing audio*/
1306  c->AddItem(wxT("Stop"), XXO("Sto&p"), FN(OnStop),
1307  AudioIOBusyFlag | CanStopAudioStreamFlag,
1308  AudioIOBusyFlag | CanStopAudioStreamFlag);
1309 
1311 
1312  c->AddItem(wxT("PlayOneSec"), XXO("Play &One Second"), FN(OnPlayOneSecond), wxT("1"),
1315  c->AddItem(wxT("PlayToSelection"), XXO("Play to &Selection"), FN(OnPlayToSelection), wxT("B"),
1318  c->AddItem(wxT("PlayBeforeSelectionStart"), XXO("Play &Before Selection Start"), FN(OnPlayBeforeSelectionStart), wxT("Shift+F5"));
1319  c->AddItem(wxT("PlayAfterSelectionStart"), XXO("Play Af&ter Selection Start"), FN(OnPlayAfterSelectionStart), wxT("Shift+F6"));
1320  c->AddItem(wxT("PlayBeforeSelectionEnd"), XXO("Play Be&fore Selection End"), FN(OnPlayBeforeSelectionEnd), wxT("Shift+F7"));
1321  c->AddItem(wxT("PlayAfterSelectionEnd"), XXO("Play Aft&er Selection End"), FN(OnPlayAfterSelectionEnd), wxT("Shift+F8"));
1322  c->AddItem(wxT("PlayBeforeAndAfterSelectionStart"), XXO("Play Before a&nd After Selection Start"), FN(OnPlayBeforeAndAfterSelectionStart), wxT("Ctrl+Shift+F5"));
1323  c->AddItem(wxT("PlayBeforeAndAfterSelectionEnd"), XXO("Play Before an&d After Selection End"), FN(OnPlayBeforeAndAfterSelectionEnd), wxT("Ctrl+Shift+F7"));
1324  c->AddItem(wxT("PlayCutPreview"), XXO("Play C&ut Preview"), FN(OnPlayCutPreview), wxT("C"),
1327  c->EndSubMenu();
1328 
1330 
1332  c->BeginSubMenu(_("T&ools"));
1333 
1334  c->AddItem(wxT("SelectTool"), XXO("&Selection Tool"), FN(OnSelectTool), wxT("F1"));
1335  c->AddItem(wxT("EnvelopeTool"), XXO("&Envelope Tool"), FN(OnEnvelopeTool), wxT("F2"));
1336  c->AddItem(wxT("DrawTool"), XXO("&Draw Tool"), FN(OnDrawTool), wxT("F3"));
1337  c->AddItem(wxT("ZoomTool"), XXO("&Zoom Tool"), FN(OnZoomTool), wxT("F4"));
1338  c->AddItem(wxT("TimeShiftTool"), XXO("&Time Shift Tool"), FN(OnTimeShiftTool), wxT("F5"));
1339  c->AddItem(wxT("MultiTool"), XXO("&Multi Tool"), FN(OnMultiTool), wxT("F6"));
1340 
1341  c->AddItem(wxT("PrevTool"), XXO("&Previous Tool"), FN(OnPrevTool), wxT("A"));
1342  c->AddItem(wxT("NextTool"), XXO("&Next Tool"), FN(OnNextTool), wxT("D"));
1343  c->EndSubMenu();
1344 
1346 
1348  c->BeginSubMenu(_("Mi&xer"));
1349 
1350  c->AddItem(wxT("OutputGain"), XXO("Ad&just Playback Volume..."), FN(OnOutputGain));
1351  c->AddItem(wxT("OutputGainInc"), XXO("&Increase Playback Volume"), FN(OnOutputGainInc));
1352  c->AddItem(wxT("OutputGainDec"), XXO("&Decrease Playback Volume"), FN(OnOutputGainDec));
1353  c->AddItem(wxT("InputGain"), XXO("Adj&ust Recording Volume..."), FN(OnInputGain));
1354  c->AddItem(wxT("InputGainInc"), XXO("I&ncrease Recording Volume"), FN(OnInputGainInc));
1355  c->AddItem(wxT("InputGainDec"), XXO("D&ecrease Recording Volume"), FN(OnInputGainDec));
1356  c->EndSubMenu();
1357 
1359 
1361  c->BeginSubMenu(_("&Edit"));
1362 
1363  c->AddItem(wxT("DeleteKey"), XXO("&Delete Key"), FN(OnDelete), wxT("Backspace"),
1366 
1367  c->AddItem(wxT("DeleteKey2"), XXO("Delete Key&2"), FN(OnDelete), wxT("Delete"),
1370  c->EndSubMenu();
1371 
1373 
1375  c->BeginSubMenu(_("Transcri&ption"));
1376 
1377  c->AddItem(wxT("PlayAtSpeed"), XXO("Pl&ay-at-Speed"), FN(OnPlayAtSpeed));
1378  c->AddItem(wxT("PlayAtSpeedLooped"), XXO("&Loop Play-at-Speed"), FN(OnPlayAtSpeedLooped));
1379  c->AddItem(wxT("PlayAtSpeedCutPreview"), XXO("Play C&ut Preview-at-Speed"), FN(OnPlayAtSpeedCutPreview));
1380  c->AddItem(wxT("SetPlaySpeed"), XXO("Ad&just Playback Speed..."), FN(OnSetPlaySpeed));
1381  c->AddItem(wxT("PlaySpeedInc"), XXO("&Increase Playback Speed"), FN(OnPlaySpeedInc));
1382  c->AddItem(wxT("PlaySpeedDec"), XXO("&Decrease Playback Speed"), FN(OnPlaySpeedDec));
1383 
1384  // These were on the original transcription toolbar. But they are not on the
1385  // shortened one.
1386  c->AddItem(wxT("MoveToPrevLabel"), XXO("Move to &Previous Label"), FN(OnMoveToPrevLabel), wxT("Alt+Left"),
1388  c->AddItem(wxT("MoveToNextLabel"), XXO("Move to &Next Label"), FN(OnMoveToNextLabel), wxT("Alt+Right"),
1390  c->EndSubMenu();
1391 
1393 
1394  c->SetDefaultFlags(AudioIOBusyFlag, AudioIOBusyFlag);
1395  c->BeginSubMenu(_("See&k"));
1396 
1397  c->AddItem(wxT("SeekLeftShort"), XXO("Short Seek &Left During Playback"), FN(OnSeekLeftShort), wxT("Left\tallowDup"));
1398  c->AddItem(wxT("SeekRightShort"), XXO("Short Seek &Right During Playback"), FN(OnSeekRightShort), wxT("Right\tallowDup"));
1399  c->AddItem(wxT("SeekLeftLong"), XXO("Long Seek Le&ft During Playback"), FN(OnSeekLeftLong), wxT("Shift+Left\tallowDup"));
1400  c->AddItem(wxT("SeekRightLong"), XXO("Long Seek Rig&ht During Playback"), FN(OnSeekRightLong), wxT("Shift+Right\tallowDup"));
1401  c->EndSubMenu();
1402 
1404 
1406  c->BeginSubMenu(_("De&vice"));
1407 
1408  c->AddItem(wxT("InputDevice"), XXO("Change &Recording Device..."), FN(OnInputDevice), wxT("Shift+I"),
1411  c->AddItem(wxT("OutputDevice"), XXO("Change &Playback Device..."), FN(OnOutputDevice), wxT("Shift+O"),
1414  c->AddItem(wxT("AudioHost"), XXO("Change Audio &Host..."), FN(OnAudioHost), wxT("Shift+H"),
1417  c->AddItem(wxT("InputChannels"), XXO("Change Recording Cha&nnels..."), FN(OnInputChannels), wxT("Shift+N"),
1420  c->EndSubMenu();
1421 
1423 
1425  c->BeginSubMenu(_("&Selection"));
1426 
1427  c->AddItem(wxT("SnapToOff"), XXO("Snap-To &Off"), FN(OnSnapToOff));
1428  c->AddItem(wxT("SnapToNearest"), XXO("Snap-To &Nearest"), FN(OnSnapToNearest));
1429  c->AddItem(wxT("SnapToPrior"), XXO("Snap-To &Prior"), FN(OnSnapToPrior));
1430 
1431  c->AddItem(wxT("SelStart"), XXO("Selection to &Start"), FN(OnSelToStart), wxT("Shift+Home"));
1432  c->AddItem(wxT("SelEnd"), XXO("Selection to En&d"), FN(OnSelToEnd), wxT("Shift+End"));
1433  c->AddItem(wxT("SelExtLeft"), XXO("Selection Extend &Left"), FN(OnSelExtendLeft), wxT("Shift+Left\twantKeyup\tallowDup"),
1436  c->AddItem(wxT("SelExtRight"), XXO("Selection Extend &Right"), FN(OnSelExtendRight), wxT("Shift+Right\twantKeyup\tallowDup"),
1439 
1440  c->AddItem(wxT("SelSetExtLeft"), XXO("Set (or Extend) Le&ft Selection"), FN(OnSelSetExtendLeft),
1443  c->AddItem(wxT("SelSetExtRight"), XXO("Set (or Extend) Rig&ht Selection"), FN(OnSelSetExtendRight),
1446 
1447  c->AddItem(wxT("SelCntrLeft"), XXO("Selection Contract L&eft"), FN(OnSelContractLeft), wxT("Ctrl+Shift+Right\twantKeyup"),
1450  c->AddItem(wxT("SelCntrRight"), XXO("Selection Contract R&ight"), FN(OnSelContractRight), wxT("Ctrl+Shift+Left\twantKeyup"),
1453 
1454  c->EndSubMenu();
1455 
1456 
1458  c->AddSeparator();
1459 
1460  c->AddGlobalCommand(wxT("PrevWindow"), XXO("Move Backward Through Active Windows"), FN(PrevWindow), wxT("Alt+Shift+F6"));
1461  c->AddGlobalCommand(wxT("NextWindow"), XXO("Move Forward Through Active Windows"), FN(NextWindow), wxT("Alt+F6"));
1462 
1464 
1466  c->BeginSubMenu(_("F&ocus"));
1467 
1468  c->AddItem(wxT("PrevFrame"), XXO("Move &Backward from Toolbars to Tracks"), FN(PrevFrame), wxT("Ctrl+Shift+F6"));
1469  c->AddItem(wxT("NextFrame"), XXO("Move F&orward from Toolbars to Tracks"), FN(NextFrame), wxT("Ctrl+F6"));
1470 
1473  c->AddItem(wxT("PrevTrack"), XXO("Move Focus to &Previous Track"), FN(OnCursorUp), wxT("Up"));
1474  c->AddItem(wxT("NextTrack"), XXO("Move Focus to &Next Track"), FN(OnCursorDown), wxT("Down"));
1475  c->AddItem(wxT("FirstTrack"), XXO("Move Focus to &First Track"), FN(OnFirstTrack), wxT("Ctrl+Home"));
1476  c->AddItem(wxT("LastTrack"), XXO("Move Focus to &Last Track"), FN(OnLastTrack), wxT("Ctrl+End"));
1477 
1478  c->AddItem(wxT("ShiftUp"), XXO("Move Focus to P&revious and Select"), FN(OnShiftUp), wxT("Shift+Up"));
1479  c->AddItem(wxT("ShiftDown"), XXO("Move Focus to N&ext and Select"), FN(OnShiftDown), wxT("Shift+Down"));
1480 
1481  c->AddItem(wxT("Toggle"), XXO("&Toggle Focused Track"), FN(OnToggle), wxT("Return"));
1482  c->AddItem(wxT("ToggleAlt"), XXO("Toggle Focuse&d Track"), FN(OnToggle), wxT("NUMPAD_ENTER"));
1483  c->EndSubMenu();
1484 
1486 
1488  c->BeginSubMenu(_("&Cursor"));
1489 
1490  c->AddItem(wxT("CursorLeft"), XXO("Cursor &Left"), FN(OnCursorLeft), wxT("Left\twantKeyup\tallowDup"),
1493  c->AddItem(wxT("CursorRight"), XXO("Cursor &Right"), FN(OnCursorRight), wxT("Right\twantKeyup\tallowDup"),
1496  c->AddItem(wxT("CursorShortJumpLeft"), XXO("Cursor Sh&ort Jump Left"), FN(OnCursorShortJumpLeft), wxT(","),
1499  c->AddItem(wxT("CursorShortJumpRight"), XXO("Cursor Shor&t Jump Right"), FN(OnCursorShortJumpRight), wxT("."),
1502  c->AddItem(wxT("CursorLongJumpLeft"), XXO("Cursor Long J&ump Left"), FN(OnCursorLongJumpLeft), wxT("Shift+,"),
1505  c->AddItem(wxT("CursorLongJumpRight"), XXO("Cursor Long Ju&mp Right"), FN(OnCursorLongJumpRight), wxT("Shift+."),
1508 
1509  c->AddItem(wxT("ClipLeft"), XXO("Clip L&eft"), FN(OnClipLeft), wxT("\twantKeyup"),
1512  c->AddItem(wxT("ClipRight"), XXO("Clip Rig&ht"), FN(OnClipRight), wxT("\twantKeyup"),
1515  c->EndSubMenu();
1516 
1518 
1520  c->BeginSubMenu(_("&Track"));
1521 
1522  c->AddItem(wxT("TrackPan"), XXO("Change P&an on Focused Track..."), FN(OnTrackPan), wxT("Shift+P"),
1525  c->AddItem(wxT("TrackPanLeft"), XXO("Pan &Left on Focused Track"), FN(OnTrackPanLeft), wxT("Alt+Shift+Left"),
1528  c->AddItem(wxT("TrackPanRight"), XXO("Pan &Right on Focused Track"), FN(OnTrackPanRight), wxT("Alt+Shift+Right"),
1531  c->AddItem(wxT("TrackGain"), XXO("Change Gai&n on Focused Track..."), FN(OnTrackGain), wxT("Shift+G"),
1534  c->AddItem(wxT("TrackGainInc"), XXO("&Increase Gain on Focused Track"), FN(OnTrackGainInc), wxT("Alt+Shift+Up"),
1537  c->AddItem(wxT("TrackGainDec"), XXO("&Decrease Gain on Focused Track"), FN(OnTrackGainDec), wxT("Alt+Shift+Down"),
1540  c->AddItem(wxT("TrackMenu"), XXO("Op&en Menu on Focused Track..."), FN(OnTrackMenu), wxT("Shift+M\tskipKeydown"),
1543  c->AddItem(wxT("TrackMute"), XXO("M&ute/Unmute Focused Track"), FN(OnTrackMute), wxT("Shift+U"),
1546  c->AddItem(wxT("TrackSolo"), XXO("&Solo/Unsolo Focused Track"), FN(OnTrackSolo), wxT("Shift+S"),
1549  c->AddItem(wxT("TrackClose"), XXO("&Close Focused Track"), FN(OnTrackClose), wxT("Shift+C"),
1552  c->AddItem(wxT("TrackMoveUp"), XXO("Move Focused Track U&p"), FN(OnTrackMoveUp),
1555  c->AddItem(wxT("TrackMoveDown"), XXO("Move Focused Track Do&wn"), FN(OnTrackMoveDown),
1558  c->AddItem(wxT("TrackMoveTop"), XXO("Move Focused Track to T&op"), FN(OnTrackMoveTop),
1561  c->AddItem(wxT("TrackMoveBottom"), XXO("Move Focused Track to &Bottom"), FN(OnTrackMoveBottom),
1564  c->EndSubMenu();
1565 
1566  // These are the more useful to VI user Scriptables.
1567  // i18n-hint: Scriptables are commands normally used from Python, Perl etc.
1568  c->BeginSubMenu(_("&Scriptables I"));
1569 
1570  // Note that the PLUGIN_SYMBOL must have a space between words,
1571  // whereas the short-form used here must not.
1572  // (So if you did write "CompareAudio" for the PLUGIN_SYMBOL name, then
1573  // you would have to use "Compareaudio" here.)
1574 
1575  c->AddItem(wxT("SelectTime"), XXO("Select Time..."), FN(OnAudacityCommand),
1577  c->AddItem(wxT("SelectFrequencies"),