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 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 557 of file Project.h.

559 
560  // Audio IO callback methods
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
OnMoveUpID 
OnMoveDownID 
OnMoveTopID 
OnMoveBottomID 

Definition at line 119 of file Project.h.

Enumerator
SELECTION_EXTEND 
SELECTION_CONTRACT 
CURSOR_MOVE 

Definition at line 551 of file Project.h.

Enumerator
TIME_UNIT_SECONDS 
TIME_UNIT_PIXELS 

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

Definition at line 1263 of file Project.cpp.

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

1264 {
1265  // Tool manager gives us capture sometimes
1266  if(HasCapture())
1267  ReleaseMouse();
1268 
1269  if (wxGetApp().GetRecentFiles())
1270  {
1272  }
1273 
1274  if(mTrackPanel) {
1275 #ifdef EXPERIMENTAL_SCRUBBING_BASIC
1277 #endif
1280  }
1281 }
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 1955 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().

1961 {
1962  int namesCnt = (int) names.GetCount();
1963  int perGroup;
1964 
1965 #if defined(__WXGTK__)
1966  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 15);
1967 #else
1968  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 0);
1969 #endif
1970 
1971  int groupCnt = namesCnt;
1972  for (int i = 0; i < namesCnt; i++)
1973  {
1974  while (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
1975  {
1976  i++;
1977  groupCnt--;
1978  }
1979  }
1980 
1981  // The "default" effects shouldn't be broken into subgroups
1982  if (namesCnt > 0 && isDefault)
1983  {
1984  perGroup = 0;
1985  }
1986 
1987  int max = perGroup;
1988  int items = perGroup;
1989 
1990  if (max > groupCnt)
1991  {
1992  max = 0;
1993  }
1994 
1995  int groupNdx = 0;
1996  for (int i = 0; i < namesCnt; i++)
1997  {
1998  if (max > 0 && items == max)
1999  {
2000  int end = groupNdx + max;
2001  if (end + 1 > groupCnt)
2002  {
2003  end = groupCnt;
2004  }
2005  c->BeginSubMenu(wxString::Format(_("Plug-in %d to %d"),
2006  groupNdx + 1,
2007  end));
2008  }
2009 
2010  if (i + 1 < namesCnt && names[i].IsSameAs(names[i + 1]))
2011  {
2012  wxString name = names[i];
2013  c->BeginSubMenu(name);
2014  while (i < namesCnt && names[i].IsSameAs(name))
2015  {
2016  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2017  wxString item = plug->GetPath();
2018  if( plug->GetPluginType() == PluginTypeEffect )
2019  c->AddItem(item,
2020  item,
2021  item.Contains("..."),
2022  FN(OnEffect),
2023  flags[i],
2024  flags[i], true, plugs[i]);
2025 
2026  i++;
2027  }
2028  c->EndSubMenu();
2029  i--;
2030  }
2031  else
2032  {
2033  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(plugs[i]);
2034  if( plug->GetPluginType() == PluginTypeEffect )
2035  c->AddItem(names[i],
2036  names[i],
2037  vHasDialog[i],
2038  FN(OnEffect),
2039  flags[i],
2040  flags[i], true, plugs[i]);
2041  }
2042 
2043  if (max > 0)
2044  {
2045  groupNdx++;
2046  items--;
2047  if (items == 0 || i + 1 == namesCnt)
2048  {
2049  c->EndSubMenu();
2050  items = max;
2051  }
2052  }
2053  }
2054 
2055  return;
2056 }
static wxArrayString names()
Definition: Tags.cpp:697
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:4639
_("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 1814 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().

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

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

Definition at line 7631 of file Menus.cpp.

Referenced by FindNextClipBoundary(), and FindPrevClipBoundary().

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

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

7614 {
7615  auto q = std::find_if(clips.begin(), clips.end(), [&] (const WaveClip* const& clip) {
7616  return clip->GetEndTime() == time; });
7617  if (q != clips.end() && q + 1 != clips.end() &&
7618  (*q)->SharesBoundaryWithNextClip(*(q+1))) {
7619  time = (*(q+1))->GetStartTime();
7620  }
7621 
7622  return time;
7623 }
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 1283 of file Project.cpp.

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

Referenced by Theme::ApplyUpdatedImages().

1284 {
1285  SetBackgroundColour(theTheme.Colour( clrMedium ));
1286  ClearBackground();// For wxGTK.
1288 }
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 1533 of file Project.cpp.

References mRate.

1534 {
1535  return mRate;
1536 }
double mRate
Definition: Project.h:619
const NumericFormatId & AudacityProject::AS_GetSelectionFormat ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1562 of file Project.cpp.

References GetSelectionFormat().

1563 {
1564  return GetSelectionFormat();
1565 }
const NumericFormatId & GetSelectionFormat() const
Definition: Project.cpp:1678
int AudacityProject::AS_GetSnapTo ( )
overridevirtual

Implements SelectionBarListener.

Definition at line 1543 of file Project.cpp.

References GetSnapTo().

1544 {
1545  return GetSnapTo();
1546 }
int GetSnapTo() const
Definition: Project.cpp:5646
void AudacityProject::AS_ModifySelection ( double &  start,
double &  end,
bool  done 
)
overridevirtual

Implements SelectionBarListener.

Definition at line 1684 of file Project.cpp.

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

1685 {
1686  mViewInfo.selectedRegion.setTimes(start, end);
1687  mTrackPanel->Refresh(false);
1688  if (done) {
1689  ModifyState(false);
1690  }
1691 }
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:4740
bool setTimes(double t0, double t1)
TrackPanel * mTrackPanel
Definition: Project.h:672
void AudacityProject::AS_SetRate ( double  rate)
overridevirtual

Implements SelectionBarListener.

Definition at line 1538 of file Project.cpp.

References mRate.

1539 {
1540  mRate = rate;
1541 }
double mRate
Definition: Project.h:619
void AudacityProject::AS_SetSelectionFormat ( const NumericFormatId format)
overridevirtual

Implements SelectionBarListener.

Definition at line 1567 of file Project.cpp.

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

Referenced by SetSelectionFormat().

1568 {
1570 
1571  gPrefs->Write(wxT("/SelectionFormat"), mSelectionFormat.Internal());
1572  gPrefs->Flush();
1573 
1574  if (SnapSelection() && GetTrackPanel())
1575  GetTrackPanel()->Refresh(false);
1576 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1505
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 1548 of file Project.cpp.

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

Referenced by SetSnapTo().

1549 {
1550  mSnapTo = snap;
1551 
1552 // LLL: TODO - what should this be changed to???
1553 // mCommandManager.Check(wxT("Snap"), mSnapTo);
1554  gPrefs->Write(wxT("/SnapTo"), mSnapTo);
1555  gPrefs->Flush();
1556 
1557  SnapSelection();
1558 
1559  RedrawProject();
1560 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1371
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool SnapSelection()
Definition: Project.cpp:1505
void AudacityProject::AutoSave ( )
private

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

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

5955 {
5956  AudacityProject *project = GetActiveProject();
5957  if (project)
5958  {
5959 // wxASSERT(project->mKeyboardCaptureHandler == NULL);
5960  project->mKeyboardCaptureHandler = handler;
5961  }
5962 }
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 6609 of file Menus.cpp.

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

Referenced by FindClipBoundaries(), and FindClips().

6610 {
6611  bool sameClips = false;
6612 
6613  if (wt->GetLinked() && wt->GetLink()) {
6614  auto& left = wt->GetClips();
6615  auto& right = static_cast<const WaveTrack*>(wt->GetLink())->GetClips();
6616  if (left.size() == right.size()) {
6617  sameClips = true;
6618  for (unsigned int i = 0; i < left.size(); i++) {
6619  if (left[i]->GetStartTime() != right[i]->GetStartTime() ||
6620  left[i]->GetEndTime() != right[i]->GetEndTime()) {
6621  sameClips = false;
6622  break;
6623  }
6624  }
6625  }
6626  }
6627 
6628  return sameClips;
6629 }
bool GetLinked() const
Definition: Track.h:278
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 4903 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().

4904 {
4905  TrackListIterator iter(GetTracks());
4906 
4907  Track *n = iter.First();
4908 
4909  while (n) {
4910  if (n->GetSelected() || n->IsSyncLockSelected()) {
4912  }
4913  n = iter.Next();
4914  }
4915 
4916  double seconds = mViewInfo.selectedRegion.duration();
4917 
4919 
4920  PushState(wxString::Format(_("Deleted %.2f seconds at t=%.2f"),
4921  seconds,
4923  _("Delete"));
4924 
4925  RedrawProject();
4926 }
void RedrawProject(const bool bForceWaveTracks=false)
Definition: Project.cpp:1371
double t0() const
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
bool GetSelected() const
Definition: Track.h:275
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:101
virtual void Clear(double WXUNUSED(t0), double WXUNUSED(t1))=0
ViewInfo mViewInfo
Definition: Project.h:558
An iterator for a TrackList.
Definition: Track.h:401
_("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:4695
TrackList * GetTracks()
Definition: Project.h:192
double duration() const
void AudacityProject::ClearClipboard ( )
static

Definition at line 4893 of file Project.cpp.

References msClipboard, msClipProject, msClipT0, and msClipT1.

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

4894 {
4895  msClipT0 = 0.0;
4896  msClipT1 = 0.0;
4897  msClipProject = NULL;
4898  if (msClipboard) {
4899  msClipboard->Clear();
4900  }
4901 }
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 7760 of file Menus.cpp.

References _(), format, and wxPLURAL.

Referenced by OnCursorClipBoundary(), and OnSelectClipBoundary().

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

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

Referenced by OnSelectSomething().

6209 {
6210  TrackListIterator iter(GetTracks());
6211 
6212  int count =0;
6213  for (Track *t = iter.First(); t; t = iter.Next()) {
6214  if( t->GetSelected() )
6215  count++;
6216  }
6217  return count;
6218 }
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:101
An iterator for a TrackList.
Definition: Track.h:401
TrackList * GetTracks()
Definition: Project.h:192
int AudacityProject::CountSelectedWaveTracks ( )
private

Definition at line 6196 of file Menus.cpp.

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

6197 {
6198  TrackListIterator iter(GetTracks());
6199 
6200  int count =0;
6201  for (Track *t = iter.First(); t; t = iter.Next()) {
6202  if( (t->GetKind() == Track::Wave) && t->GetSelected() )
6203  count++;
6204  }
6205  return count;
6206 }
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:101
An iterator for a TrackList.
Definition: Track.h:401
TrackList * GetTracks()
Definition: Project.h:192
int AudacityProject::CountUnnamed ( )
static

Definition at line 2110 of file Project.cpp.

References gAudacityProjects, and GetName().

Referenced by TitleRestorer::TitleRestorer().

2111 {
2112  int j = 0;
2113  for ( size_t i = 0; i < gAudacityProjects.size(); i++) {
2114  if ( gAudacityProjects[i] )
2115  if ( gAudacityProjects[i]->GetName().IsEmpty() )
2116  j++;
2117  }
2118  return j;
2119 }
AProjectArray gAudacityProjects
Definition: Project.cpp:303
wxString GetName()
Definition: Project.cpp:1458
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(), 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, 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("Ctrl+Alt+P"),
690  c->SetLongName( _("Select Next Clip"))->AddItem(wxT("SelNextClip"), XXO("N&ext Clip"), FN(OnSelectNextClip), wxT("Ctrl+Alt+N"),
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&ay"));
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( _("&Record"));
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  // JKC: I decided to duplicate this between play and record, rather than put it
872  // at the top level. AddItem can now cope with simple duplicated items.
873  // PRL: This second registration of wxT("Pause"), with unspecified flags,
874  // in fact will use the same flags as in the previous registration.
875  c->AddItem(wxT("Pause"), XXO("&Pause"), FN(OnPause), wxT("P"));
876  c->EndSubMenu();
877 
878  // Scrubbing sub-menu
880 
881  // JKC: ANSWER-ME: How is 'cursor to' different to 'Skip To' and how is it useful?
882  // GA: 'Skip to' moves the viewpoint to center of the track and preserves the
883  // selection. 'Cursor to' does neither. 'Center at' might describe it better than 'Skip'.
884  c->BeginSubMenu(_("&Cursor to"));
885 
886  c->SetLongName( _("Cursor to Selection Start"))->AddItem(wxT("CursSelStart"), XXO("Selection Star&t"), FN(OnCursorSelStart),
888  c->SetLongName( _("Cursor to Selection End"))->AddItem(wxT("CursSelEnd"), XXO("Selection En&d"), FN(OnCursorSelEnd),
890 
891  c->SetLongName( _("Cursor to Track Start"))->AddItem(wxT("CursTrackStart"), XXO("Track &Start"), FN(OnCursorTrackStart), wxT("J"),
893  c->SetLongName( _("Cursor to Track End"))->AddItem(wxT("CursTrackEnd"), XXO("Track &End"), FN(OnCursorTrackEnd), wxT("K"),
895 
896  c->SetLongName( _("Cursor to Prev Clip Boundary"))->AddItem(wxT("CursPrevClipBoundary"), XXO("Pre&vious Clip Boundary"), FN(OnCursorPrevClipBoundary), wxT(""),
898  c->SetLongName( _("Cursor to Next Clip Boundary"))->AddItem(wxT("CursNextClipBoundary"), XXO("Ne&xt Clip Boundary"), FN(OnCursorNextClipBoundary), wxT(""),
900 
901  c->SetLongName( _("Cursor to Project Start"))->AddItem(wxT("CursProjectStart"), XXO("&Project Start"), FN(OnSkipStart), wxT("Home"));
902  c->SetLongName( _("Cursor to Project End"))->AddItem(wxT("CursProjectEnd"), XXO("Project E&nd"), FN(OnSkipEnd), wxT("End"));
903 
904  c->EndSubMenu();
905 
906  c->AddSeparator();
907 
909 
910  c->BeginSubMenu(_("Pla&y Region"));
911 
912  c->AddItem(wxT("LockPlayRegion"), XXO("&Lock"), FN(OnLockPlayRegion),
915  c->AddItem(wxT("UnlockPlayRegion"), XXO("&Unlock"), FN(OnUnlockPlayRegion),
918 
919  c->EndSubMenu();
920 
921  c->AddSeparator();
922 
923  c->AddItem(wxT("RescanDevices"), XXO("R&escan Audio Devices"), FN(OnRescanDevices),
926 
927  c->BeginSubMenu(_("Transport &Options"));
928  // Sound Activated recording options
929  c->AddItem(wxT("SoundActivationLevel"), XXO("Sound Activation Le&vel..."), FN(OnSoundActivated),
932  c->AddCheck(wxT("SoundActivation"), XXO("Sound A&ctivated Recording (on/off)"), FN(OnToggleSoundActivated), 0,
935  c->AddSeparator();
936 
937  c->AddCheck(wxT("PinnedHead"), XXO("Pinned Play/Record &Head (on/off)"),
939  // Switching of scrolling on and off is permitted even during transport
941 
942  c->AddCheck(wxT("Duplex"), XXO("&Overdub (on/off)"), FN(OnTogglePlayRecording), 0,
945  c->AddCheck(wxT("SWPlaythrough"), XXO("So&ftware Playthrough (on/off)"), FN(OnToggleSWPlaythrough), 0,
948 
949 
950 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
951  c->AddCheck(wxT("AutomatedInputLevelAdjustmentOnOff"), XXO("A&utomated Recording Level Adjustment (on/off)"), FN(OnToggleAutomatedInputLevelAdjustment), 0,
954 #endif
955  c->EndSubMenu();
956 
957  c->EndMenu();
958 
960  // Tracks Menu (formerly Project Menu)
962 
963  c->BeginMenu(_("&Tracks"));
965 
967 
968  c->BeginSubMenu(_("Add &New"));
969 
970  c->AddItem(wxT("NewMonoTrack"), XXO("&Mono Track"), FN(OnNewWaveTrack), wxT("Ctrl+Shift+N"));
971  c->AddItem(wxT("NewStereoTrack"), XXO("&Stereo Track"), FN(OnNewStereoTrack));
972  c->AddItem(wxT("NewLabelTrack"), XXO("&Label Track"), FN(OnNewLabelTrack));
973  c->AddItem(wxT("NewTimeTrack"), XXO("&Time Track"), FN(OnNewTimeTrack));
974 
975  c->EndSubMenu();
976 
978 
979  c->AddSeparator();
980 
981  c->BeginSubMenu(_("Mi&x") );
982  {
983  // Stereo to Mono is an oddball command that is also subject to control by the
984  // plug-in manager, as if an effect. Decide whether to show or hide it.
985  const PluginID ID = EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono"));
986  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
987  if (plug && plug->IsEnabled())
988  c->AddItem(wxT("Stereo to Mono"), XXO("Mix Stereo Down to &Mono"), FN(OnStereoToMono),
991  }
992  c->AddItem(wxT("MixAndRender"), XXO("Mi&x and Render"), FN(OnMixAndRender),
995  c->AddItem(wxT("MixAndRenderToNewTrack"), XXO("Mix and Render to Ne&w Track"), FN(OnMixAndRenderToNewTrack), wxT("Ctrl+Shift+M"),
998  c->EndSubMenu();
999 
1000  c->AddItem(wxT("Resample"), XXO("&Resample..."), FN(OnResample),
1003 
1004  c->AddSeparator();
1005 
1006  c->AddItem(wxT("RemoveTracks"), XXO("Remo&ve Tracks"), FN(OnRemoveTracks),
1009 
1010  c->AddSeparator();
1011 
1012  c->BeginSubMenu(_("M&ute/Unmute"));
1013  c->AddItem(wxT("MuteAllTracks"), XXO("&Mute All Tracks"), FN(OnMuteAllTracks), wxT("Ctrl+U"));
1014  c->AddItem(wxT("UnmuteAllTracks"), XXO("&Unmute All Tracks"), FN(OnUnmuteAllTracks), wxT("Ctrl+Shift+U"));
1015  c->EndSubMenu();
1016 
1017  c->BeginSubMenu(_("&Pan"));
1018  // As Pan changes are not saved on Undo stack, pan settings for all tracks
1019  // in the project could very easily be lost unless we require the tracks to be selcted.
1021  c->SetLongName( _("Pan Left"))->AddItem(wxT("PanLeft"), XXO("&Left"), FN(OnPanLeft));
1022  c->SetLongName( _("Pan Right"))->AddItem(wxT("PanRight"), XXO("&Right"), FN(OnPanRight));
1023  c->SetLongName( _("Pan Center"))->AddItem(wxT("PanCenter"), XXO("&Center"), FN(OnPanCenter));
1024  c->EndSubMenu();
1025 
1026 
1027  c->AddSeparator();
1028 
1030 
1031  const TranslatedInternalString alignLabelsNoSync[] = {
1032  { wxT("EndToEnd"), _("&Align End to End") },
1033  { wxT("Together"), _("Align &Together") },
1034  };
1035 
1036  const TranslatedInternalString alignLabels[] = {
1037  { wxT("StartToZero"), _("Start to &Zero") },
1038  { wxT("StartToSelStart"), _("Start to &Cursor/Selection Start") },
1039  { wxT("StartToSelEnd"), _("Start to Selection &End") },
1040  { wxT("EndToSelStart"), _("End to Cu&rsor/Selection Start") },
1041  { wxT("EndToSelEnd"), _("End to Selection En&d") },
1042  };
1043  mAlignLabelsCount = sizeof(alignLabels) / sizeof(alignLabels[0]);
1044 
1045  // Calling c->SetCommandFlags() after AddItemList for "Align" and "AlignMove"
1046  // does not correctly set flags for submenus, so do it this way.
1049 
1050  c->BeginSubMenu(_("&Align Tracks"));
1051 
1052  //c->BeginSubMenu(_("Just Move Tracks"));
1053  c->AddItemList(wxT("Align"), alignLabelsNoSync, 2u, FN(OnAlignNoSync));
1054  c->AddSeparator();
1055  c->AddItemList(wxT("Align"), alignLabels, mAlignLabelsCount, FN(OnAlign));
1056  c->AddSeparator();
1057  c->AddCheck(wxT("MoveSelectionWithTracks"), XXO("&Move Selection with Tracks (on/off)"),
1059  gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), 0L),
1061  c->EndSubMenu();
1062 
1063 #if 0
1064  // TODO: Can these labels be made clearer? Do we need this sub-menu at all?
1065  c->BeginSubMenu(_("Move Sele&ction and Tracks"));
1066 
1067  c->AddItemList(wxT("AlignMove"), alignLabels, mAlignLabelsCount, FN(OnAlignMoveSel));
1068  c->SetCommandFlags(wxT("AlignMove"),
1071 
1072  c->EndSubMenu();
1073 #endif
1074 
1076 
1077 
1079 
1080 #ifdef EXPERIMENTAL_SCOREALIGN
1081  c->AddItem(wxT("ScoreAlign"), XXO("Synchronize MIDI with Audio"), FN(OnScoreAlign),
1084 #endif // EXPERIMENTAL_SCOREALIGN
1085 
1087 
1088  c->BeginSubMenu(_("S&ort Tracks"));
1089 
1090  c->SetLongName( _("Sort by Time"))->AddItem(wxT("SortByTime"), XXO("By &Start Time"), FN(OnSortTime),
1092  TracksExistFlag);
1093  c->SetLongName( _("Sort by Name"))->AddItem(wxT("SortByName"), XXO("By &Name"), FN(OnSortName),
1095  TracksExistFlag);
1096 
1097  c->EndSubMenu();
1098 
1100 
1101 #ifdef EXPERIMENTAL_SYNC_LOCK
1102  c->AddSeparator();
1103  c->AddCheck(wxT("SyncLock"), XXO("Sync-&Lock Tracks (on/off)"), FN(OnSyncLock),
1104  gPrefs->Read(wxT("/GUI/SyncLockTracks"), 0L),
1106 
1107 #endif
1108 
1109  c->EndMenu();
1110 
1111  // All of this is a bit hacky until we can get more things connected into
1112  // the plugin manager...sorry! :-(
1113 
1114  wxArrayString defaults;
1115 
1117  // Generate Menu
1119 
1120  c->BeginMenu(_("&Generate"));
1122 
1123 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1124  c->AddItem(wxT("ManageGenerators"), XXO("Add / Remove Plug-ins..."), FN(OnManageGenerators));
1125  c->AddSeparator();
1126 #endif
1127 
1128 
1133 
1134  c->EndMenu();
1135 
1137  // Effect Menu
1139 
1140  c->BeginMenu(_("Effe&ct"));
1141 
1142  wxString buildMenuLabel;
1143  if (!mLastEffect.IsEmpty()) {
1144  buildMenuLabel.Printf(_("Repeat %s"),
1145  EffectManager::Get().GetCommandName(mLastEffect));
1146  }
1147  else
1148  buildMenuLabel = _("Repeat Last Effect");
1149 
1150 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1151  c->AddItem(wxT("ManageEffects"), XXO("Add / Remove Plug-ins..."), FN(OnManageEffects));
1152  c->AddSeparator();
1153 #endif
1154 
1155  c->AddItem(wxT("RepeatLastEffect"), buildMenuLabel, false, FN(OnRepeatLastEffect), wxT("Ctrl+R"),
1158 
1159  c->AddSeparator();
1160 
1165 
1166  c->EndMenu();
1167 
1169  // Analyze Menu
1171 
1172  c->BeginMenu(_("&Analyze"));
1173 
1174 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1175  c->AddItem(wxT("ManageAnalyzers"), XXO("Add / Remove Plug-ins..."), FN(OnManageAnalyzers));
1176  c->AddSeparator();
1177 #endif
1178 
1179 
1180  c->AddItem(wxT("ContrastAnalyser"), XXO("Contrast..."), FN(OnContrast), wxT("Ctrl+Shift+T"),
1183  c->AddItem(wxT("PlotSpectrum"), XXO("Plot Spectrum..."), FN(OnPlotSpectrum),
1186 
1191 
1192  c->EndMenu();
1193 
1195  // Tools Menu
1197 
1198  c->BeginMenu(_("T&ools"));
1199 
1200 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1201  c->AddItem(wxT("ManageTools"), XXO("Add / Remove Plug-ins..."), FN(OnManageTools));
1202  //c->AddSeparator();
1203 #endif
1204 
1205  c->AddItem(wxT("ManageMacros"), XXO("&Macros..."), FN(OnManageMacros));
1206 
1207  c->BeginSubMenu(_("&Apply Macro"));
1208  c->AddItem(wxT("ApplyMacrosPalette"), XXO("&Palette..."), FN(OnApplyMacrosPalette));
1209  c->AddSeparator();
1211  c->EndSubMenu();
1212  c->AddSeparator();
1213 
1214  c->AddItem(wxT("FancyScreenshot"), XXO("&Screenshot..."), FN(OnScreenshot));
1215 
1216 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
1217 // as they used to in 1.3.x
1218 //#ifdef IS_ALPHA
1219  // TODO: What should we do here? Make benchmark a plug-in?
1220  // Easy enough to do. We'd call it mod-self-test.
1221  c->AddItem(wxT("Benchmark"), XXO("&Run Benchmark..."), FN(OnBenchmark));
1222 //#endif
1223 
1224 #ifdef IS_ALPHA
1225  c->AddCheck(wxT("SimulateRecordingErrors"),
1226  XXO("Simulate Recording Errors"),
1229  c->AddCheck(wxT("DetectUpstreamDropouts"),
1230  XXO("Detect Upstream Dropouts"),
1233 #endif
1234  c->AddSeparator();
1235 
1240 
1241  c->EndMenu();
1242 
1243 
1244 #ifdef __WXMAC__
1245  // poor imitation of the Mac Windows Menu
1248 
1249  {
1250  c->BeginMenu(_("&Window"));
1251  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1252  * window) shrink to an icon on the dock */
1253  c->AddItem(wxT("MacMinimize"), XXO("&Minimize"), FN(OnMacMinimize),
1254  wxT("Ctrl+M"), NotMinimizedFlag, NotMinimizedFlag);
1255  /* i18n-hint: Standard Macintosh Window menu item: Make (the current
1256  * window) full sized */
1257  c->AddItem(wxT("MacZoom"), XXO("&Zoom"), FN(OnMacZoom),
1259  c->AddSeparator();
1260  /* i18n-hint: Standard Macintosh Window menu item: Make all project
1261  * windows un-hidden */
1262  c->AddItem(wxT("MacBringAllToFront"),
1263  XXO("&Bring All to Front"), FN(OnMacBringAllToFront),
1265  c->EndMenu();
1266  }
1267 #endif
1268 
1270  // Help Menu
1272 
1273 #ifdef __WXMAC__
1274  wxGetApp().s_macHelpMenuTitleName = _("&Help");
1275 #endif
1276 
1277  c->BeginMenu(_("&Help"));
1279 
1280 // DA: Emphasise it is the Audacity Manual (No separate DA manual).
1281 #ifdef EXPERIMENTAL_DA
1282  // 'Getting Started' rather than 'Quick Help' for DarkAudacity.
1283  // At the moment the video tutorials are aspirational (aka do not exist yet).
1284  // Emphasise that manual is for Audacity, not DarkAudacity.
1285  c->AddItem(wxT("QuickHelp"), XXO("&Getting Started"), FN(OnQuickHelp));
1286  c->AddItem(wxT("Manual"), XXO("Audacity &Manual"), FN(OnManual));
1287 #else
1288  c->AddItem(wxT("QuickHelp"), XXO("&Quick Help..."), FN(OnQuickHelp));
1289  c->AddItem(wxT("Manual"), XXO("&Manual..."), FN(OnManual));
1290 #endif
1291  c->AddSeparator();
1292 
1293  c->BeginSubMenu(_("&Diagnostics"));
1294  c->AddItem(wxT("DeviceInfo"), XXO("Au&dio Device Info..."), FN(OnAudioDeviceInfo),
1297 #ifdef EXPERIMENTAL_MIDI_OUT
1298  c->AddItem(wxT("MidiDeviceInfo"), XXO("&MIDI Device Info..."), FN(OnMidiDeviceInfo),
1301 #endif
1302 
1303  c->AddItem(wxT("Log"), XXO("Show &Log..."), FN(OnShowLog));
1304 
1305 #if defined(EXPERIMENTAL_CRASH_REPORT)
1306  c->AddItem(wxT("CrashReport"), XXO("&Generate Support Data..."), FN(OnCrashReport));
1307 #endif
1308  c->AddItem(wxT("CheckDeps"), XXO("Chec&k Dependencies..."), FN(OnCheckDependencies),
1310  c->EndSubMenu();
1311 
1312 #ifndef __WXMAC__
1313  c->AddSeparator();
1314 #endif
1315 
1316 // DA: Does not fully support update checking.
1317 #ifndef EXPERIMENTAL_DA
1318  c->AddItem(wxT("Updates"), XXO("&Check for Updates..."), FN(OnCheckForUpdates));
1319 #endif
1320  c->AddItem(wxT("About"), XXO("&About Audacity..."), FN(OnAbout));
1321 
1322  c->EndMenu();
1323 
1325 
1326 
1328 
1329  bool bShowExtraMenus;
1330  gPrefs->Read(wxT("/GUI/ShowExtraMenus"), &bShowExtraMenus, false);
1331  std::unique_ptr<wxMenuBar> menubar2;
1332  if( !bShowExtraMenus )
1333  {
1334  menubar2 = c->AddMenuBar(wxT("ext-menu"));
1335  c->SetOccultCommands(true);
1336  }
1337 
1339  // Ext-Menu
1341 
1342  // i18n-hint: Extra is a menu with extra commands
1343  c->BeginMenu(_("Ext&ra"));
1344 
1346 
1348  c->BeginSubMenu(_("T&ransport"));
1349 
1350  // PlayStop is already in the menus.
1351  /* i18n-hint: (verb) Start playing audio*/
1352  c->AddItem(wxT("Play"), XXO("Pl&ay"), FN(OnPlayStop),
1355  /* i18n-hint: (verb) Stop playing audio*/
1356  c->AddItem(wxT("Stop"), XXO("Sto&p"), FN(OnStop),
1357  AudioIOBusyFlag | CanStopAudioStreamFlag,
1358  AudioIOBusyFlag | CanStopAudioStreamFlag);
1359 
1361 
1362  c->AddItem(wxT("PlayOneSec"), XXO("Play &One Second"), FN(OnPlayOneSecond), wxT("1"),
1365  c->AddItem(wxT("PlayToSelection"), XXO("Play to &Selection"), FN(OnPlayToSelection), wxT("B"),
1368  c->AddItem(wxT("PlayBeforeSelectionStart"), XXO("Play &Before Selection Start"), FN(OnPlayBeforeSelectionStart), wxT("Shift+F5"));
1369  c->AddItem(wxT("PlayAfterSelectionStart"), XXO("Play Af&ter Selection Start"), FN(OnPlayAfterSelectionStart), wxT("Shift+F6"));
1370  c->AddItem(wxT("PlayBeforeSelectionEnd"), XXO("Play Be&fore Selection End"), FN(OnPlayBeforeSelectionEnd), wxT("Shift+F7"));
1371  c->AddItem(wxT("PlayAfterSelectionEnd"), XXO("Play Aft&er Selection End"), FN(OnPlayAfterSelectionEnd), wxT("Shift+F8"));
1372  c->AddItem(wxT("PlayBeforeAndAfterSelectionStart"), XXO("Play Before a&nd After Selection Start"), FN(OnPlayBeforeAndAfterSelectionStart), wxT("Ctrl+Shift+F5"));
1373  c->AddItem(wxT("PlayBeforeAndAfterSelectionEnd"), XXO("Play Before an&d After Selection End"), FN(OnPlayBeforeAndAfterSelectionEnd), wxT("Ctrl+Shift+F7"));
1374  c->AddItem(wxT("PlayCutPreview"), XXO("Play C&ut Preview"), FN(OnPlayCutPreview), wxT("C"),
1377  c->EndSubMenu();
1378 
1380 
1382  c->BeginSubMenu(_("T&ools"));
1383 
1384  c->AddItem(wxT("SelectTool"), XXO("&Selection Tool"), FN(OnSelectTool), wxT("F1"));
1385  c->AddItem(wxT("EnvelopeTool"), XXO("&Envelope Tool"), FN(OnEnvelopeTool), wxT("F2"));
1386  c->AddItem(wxT("DrawTool"), XXO("&Draw Tool"), FN(OnDrawTool), wxT("F3"));
1387  c->AddItem(wxT("ZoomTool"), XXO("&Zoom Tool"), FN(OnZoomTool), wxT("F4"));
1388  c->AddItem(wxT("TimeShiftTool"), XXO("&Time Shift Tool"), FN(OnTimeShiftTool), wxT("F5"));
1389  c->AddItem(wxT("MultiTool"), XXO("&Multi Tool"), FN(OnMultiTool), wxT("F6"));
1390 
1391  c->AddItem(wxT("PrevTool"), XXO("&Previous Tool"), FN(OnPrevTool), wxT("A"));
1392  c->AddItem(wxT("NextTool"), XXO("&Next Tool"), FN(OnNextTool), wxT("D"));
1393  c->EndSubMenu();
1394 
1396 
1398  c->BeginSubMenu(_("Mi&xer"));
1399 
1400  c->AddItem(wxT("OutputGain"), XXO("Ad&just Playback Volume..."), FN(OnOutputGain));
1401  c->AddItem(wxT("OutputGainInc"), XXO("&Increase Playback Volume"), FN(OnOutputGainInc));
1402  c->AddItem(wxT("OutputGainDec"), XXO("&Decrease Playback Volume"), FN(OnOutputGainDec));
1403  c->AddItem(wxT("InputGain"), XXO("Adj&ust Recording Volume..."), FN(OnInputGain));
1404  c->AddItem(wxT("InputGainInc"), XXO("I&ncrease Recording Volume"), FN(OnInputGainInc));
1405  c->AddItem(wxT("InputGainDec"), XXO("D&ecrease Recording Volume"), FN(OnInputGainDec));
1406  c->EndSubMenu();
1407 
1409 
1411  c->BeginSubMenu(_("&Edit"));
1412 
1413  c->AddItem(wxT("DeleteKey"), XXO("&Delete Key"), FN(OnDelete), wxT("Backspace"),
1416 
1417  c->AddItem(wxT("DeleteKey2"), XXO("Delete Key&2"), FN(OnDelete), wxT("Delete"),
1420  c->EndSubMenu();
1421 
1423 
1425  c->BeginSubMenu(_("Transcri&ption"));
1426 
1427  c->AddItem(wxT("PlayAtSpeed"), XXO("Pl&ay-at-Speed"), FN(OnPlayAtSpeed));
1428  c->AddItem(wxT("PlayAtSpeedLooped"), XXO("&Loop Play-at-Speed"), FN(OnPlayAtSpeedLooped));
1429  c->AddItem(wxT("PlayAtSpeedCutPreview"), XXO("Play C&ut Preview-at-Speed"), FN(OnPlayAtSpeedCutPreview));
1430  c->AddItem(wxT("SetPlaySpeed"), XXO("Ad&just Playback Speed..."), FN(OnSetPlaySpeed));
1431  c->AddItem(wxT("PlaySpeedInc"), XXO("&Increase Playback Speed"), FN(OnPlaySpeedInc));
1432  c->AddItem(wxT("PlaySpeedDec"), XXO("&Decrease Playback Speed"), FN(OnPlaySpeedDec));
1433 
1434  // These were on the original transcription toolbar. But they are not on the
1435  // shortened one.
1436  c->AddItem(wxT("MoveToPrevLabel"), XXO("Move to &Previous Label"), FN(OnMoveToPrevLabel), wxT("Alt+Left"),
1438  c->AddItem(wxT("MoveToNextLabel"), XXO("Move to &Next Label"), FN(OnMoveToNextLabel), wxT("Alt+Right"),
1440  c->EndSubMenu();
1441 
1443 
1444  c->SetDefaultFlags(AudioIOBusyFlag, AudioIOBusyFlag);
1445  c->BeginSubMenu(_("See&k"));
1446 
1447  c->AddItem(wxT("SeekLeftShort"), XXO("Short Seek &Left During Playback"), FN(OnSeekLeftShort), wxT("Left\tallowDup"));
1448  c->AddItem(wxT("SeekRightShort"), XXO("Short Seek &Right During Playback"), FN(OnSeekRightShort), wxT("Right\tallowDup"));
1449  c->AddItem(wxT("SeekLeftLong"), XXO("Long Seek Le&ft During Playback"), FN(OnSeekLeftLong), wxT("Shift+Left\tallowDup"));
1450  c->AddItem(wxT("SeekRightLong"), XXO("Long Seek Rig&ht During Playback"), FN(OnSeekRightLong), wxT("Shift+Right\tallowDup"));
1451  c->EndSubMenu();
1452 
1454 
1456  c->BeginSubMenu(_("De&vice"));
1457 
1458  c->AddItem(wxT("InputDevice"), XXO("Change &Recording Device..."), FN(OnInputDevice), wxT("Shift+I"),
1461  c->AddItem(wxT("OutputDevice"), XXO("Change &Playback Device..."), FN(OnOutputDevice), wxT("Shift+O"),
1464  c->AddItem(wxT("AudioHost"), XXO("Change Audio &Host..."), FN(OnAudioHost), wxT("Shift+H"),
1467  c->AddItem(wxT("InputChannels"), XXO("Change Recording Cha&nnels..."), FN(OnInputChannels), wxT("Shift+N"),
1470  c->EndSubMenu();
1471 
1473 
1475  c->BeginSubMenu(_("&Selection"));
1476 
1477  c->AddItem(wxT("SnapToOff"), XXO("Snap-To &Off"), FN(OnSnapToOff));
1478  c->AddItem(wxT("SnapToNearest"), XXO("Snap-To &Nearest"), FN(OnSnapToNearest));
1479  c->AddItem(wxT("SnapToPrior"), XXO("Snap-To &Prior"), FN(OnSnapToPrior));
1480 
1481  c->AddItem(wxT("SelStart"), XXO("Selection to &Start"), FN(OnSelToStart), wxT("Shift+Home"));
1482  c->AddItem(wxT("SelEnd"), XXO("Selection to En&d"), FN(OnSelToEnd), wxT("Shift+End"));
1483  c->AddItem(wxT("SelExtLeft"), XXO("Selection Extend &Left"), FN(OnSelExtendLeft), wxT("Shift+Left\twantKeyup\tallowDup"),
1486  c->AddItem(wxT("SelExtRight"), XXO("Selection Extend &Right"), FN(OnSelExtendRight), wxT("Shift+Right\twantKeyup\tallowDup"),
1489 
1490  c->AddItem(wxT("SelSetExtLeft"), XXO("Set (or Extend) Le&ft Selection"), FN(OnSelSetExtendLeft),
1493  c->AddItem(wxT("SelSetExtRight"), XXO("Set (or Extend) Rig&ht Selection"), FN(OnSelSetExtendRight),
1496 
1497  c->AddItem(wxT("SelCntrLeft"), XXO("Selection Contract L&eft"), FN(OnSelContractLeft), wxT("Ctrl+Shift+Right\twantKeyup"),
1500  c->AddItem(wxT("SelCntrRight"), XXO("Selection Contract R&ight"), FN(OnSelContractRight), wxT("Ctrl+Shift+Left\twantKeyup"),
1503 
1504  c->EndSubMenu();
1505 
1506 
1508  c->AddSeparator();
1509 
1510  c->AddGlobalCommand(wxT("PrevWindow"), XXO("Move Backward Through Active Windows"), FN(PrevWindow), wxT("Alt+Shift+F6"));
1511  c->AddGlobalCommand(wxT("NextWindow"), XXO("Move Forward Through Active Windows"), FN(NextWindow), wxT("Alt+F6"));
1512 
1514 
1516  c->BeginSubMenu(_("F&ocus"));
1517 
1518  c->AddItem(wxT("PrevFrame"), XXO("Move &Backward from Toolbars to Tracks"), FN(PrevFrame), wxT("Ctrl+Shift+F6"));
1519  c->AddItem(wxT("NextFrame"), XXO("Move F&orward from Toolbars to Tracks"), FN(NextFrame), wxT("Ctrl+F6"));
1520 
1523  c->AddItem(wxT("PrevTrack"), XXO("Move Focus to &Previous Track"), FN(OnCursorUp), wxT("Up"));
1524  c->AddItem(wxT("NextTrack"), XXO("Move Focus to &Next Track"), FN(OnCursorDown), wxT("Down"));
1525  c->AddItem(wxT("FirstTrack"), XXO("Move Focus to &First Track"), FN(OnFirstTrack), wxT("Ctrl+Home"));
1526  c->AddItem(wxT("LastTrack"), XXO("Move Focus to &Last Track"), FN(OnLastTrack), wxT("Ctrl+End"));
1527 
1528  c->AddItem(wxT("ShiftUp"), XXO("Move Focus to P&revious and Select"), FN(OnShiftUp), wxT("Shift+Up"));
1529  c->AddItem(wxT("ShiftDown"), XXO("Move Focus to N&ext and Select"), FN(OnShiftDown), wxT("Shift+Down"));
1530 
1531  c->AddItem(wxT("Toggle"), XXO("&Toggle Focused Track"), FN(OnToggle), wxT("Return"));
1532  c->AddItem(wxT("ToggleAlt"), XXO("Toggle Focuse&d Track"), FN(OnToggle), wxT("NUMPAD_ENTER"));
1533  c->EndSubMenu();
1534 
1536 
1538  c->BeginSubMenu(_("&Cursor"));
1539 
1540  c->AddItem(wxT("CursorLeft"), XXO("Cursor &Left"), FN(OnCursorLeft), wxT("Left\twantKeyup\tallowDup"),
1543  c->AddItem(wxT("CursorRight"), XXO("Cursor &Right"), FN(OnCursorRight), wxT("Right\twantKeyup\tallowDup"),
1546  c->AddItem(wxT("CursorShortJumpLeft"), XXO("Cursor Sh&ort Jump Left"), FN(OnCursorShortJumpLeft), wxT(","),
1549  c->AddItem(wxT("CursorShortJumpRight"), XXO("Cursor Shor&t Jump Right"), FN(OnCursorShortJumpRight), wxT("."),
1552  c->AddItem(wxT("CursorLongJumpLeft"), XXO("Cursor Long J&ump Left"), FN(OnCursorLongJumpLeft), wxT("Shift+,"),
1555  c->AddItem(wxT("CursorLongJumpRight"), XXO("Cursor Long Ju&mp Right"), FN(OnCursorLongJumpRight), wxT("Shift+."),
1558 
1559  c->AddItem(wxT("ClipLeft"), XXO("Clip L&eft"), FN(OnClipLeft), wxT("\twantKeyup"),
1562  c->AddItem(wxT("ClipRight"), XXO("Clip Rig&ht"), FN(OnClipRight), wxT("\twantKeyup"),
1565  c->EndSubMenu();
1566 
1568 
1570  c->BeginSubMenu(_("&Track"));
1571 
1572  c->AddItem(wxT("TrackPan"), XXO("Change P&an on Focused Track..."), FN(OnTrackPan), wxT("Shift+P"),
1575  c->AddItem(wxT("TrackPanLeft"), XXO("Pan &Left on Focused Track"), FN(OnTrackPanLeft), wxT("Alt+Shift+Left"),
1578  c->AddItem(wxT("TrackPanRight"), XXO("Pan &Right on Focused Track"), FN(OnTrackPanRight), wxT("Alt+Shift+Right"),
1581  c->AddItem(wxT("TrackGain"), XXO("Change Gai&n on Focused Track..."), FN(OnTrackGain), wxT("Shift+G"),
1584  c->AddItem(wxT("TrackGainInc"), XXO("&Increase Gain on Focused Track"), FN(OnTrackGainInc), wxT("Alt+Shift+Up"),
1587  c->AddItem(wxT("TrackGainDec"), XXO("&Decrease Gain on Focused Track"), FN(OnTrackGainDec), wxT("Alt+Shift+Down"),
1590  c->AddItem(wxT("TrackMenu"), XXO("Op&en Menu on Focused Track..."), FN(OnTrackMenu), wxT("Shift+M\tskipKeydown"),
1593  c->AddItem(wxT("TrackMute"), XXO("M&ute/Unmute Focused Track"), FN(OnTrackMute), wxT("Shift+U"),
1596  c->AddItem(wxT("TrackSolo"), XXO("&Solo/Unsolo Focused Track"), FN(OnTrackSolo), wxT("Shift+S"),
1599  c->AddItem(wxT("TrackClose"), XXO("&Close Focused Track"), FN(OnTrackClose), wxT("Shift+C"),