Audacity  3.0.3
Classes | Namespaces | Enumerations | Functions | Variables
ProjectWindow.cpp File Reference
#include "ProjectWindow.h"
#include "ActiveProject.h"
#include "AllThemeResources.h"
#include "AudioIO.h"
#include "Menus.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectWindows.h"
#include "ProjectStatus.h"
#include "RefreshCode.h"
#include "TrackPanelMouseEvent.h"
#include "TrackPanelAx.h"
#include "UndoManager.h"
#include "ViewInfo.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "prefs/ThemePrefs.h"
#include "prefs/TracksPrefs.h"
#include "toolbars/ToolManager.h"
#include "tracks/ui/Scrubbing.h"
#include "tracks/ui/TrackView.h"
#include "widgets/wxPanelWrapper.h"
#include "widgets/WindowAccessible.h"
#include <wx/app.h>
#include <wx/display.h>
#include <wx/scrolbar.h>
#include <wx/sizer.h>
Include dependency graph for ProjectWindow.cpp:

Go to the source code of this file.

Classes

class  anonymous_namespace{ProjectWindow.cpp}::ScrollBar
 
struct  anonymous_namespace{ProjectWindow.cpp}::MouseWheelHandler
 
struct  InstallTopPanelHook
 

Namespaces

 anonymous_namespace{ProjectWindow.cpp}
 

Enumerations

enum  {
  IndicatorSmallWidth = 9, IndicatorMediumWidth = 13, IndicatorOffset = 1, TopMargin = 1,
  BottomMargin = 2, LeftMargin = 1, RightMargin = 1, ID_QUIT_AUDACITY = 10000,
  ID_DISCARD_SELECTED, ID_RECOVER_SELECTED, ID_SKIP, ID_FILE_LIST,
  AddButtonID = 10000, RemoveButtonID, RenameButtonID, RestoreButtonID,
  ImportButtonID, ExportButtonID, SaveButtonID, DefaultsButtonID,
  InsertButtonID, EditButtonID, DeleteButtonID, UpButtonID,
  DownButtonID, ApplyToProjectButtonID = ApplyToProjectID, ApplyToFilesButtonID = ApplyToFilesID, RunID = 1000,
  BSaveID, ClearID, StaticTextID, BlockSizeID,
  DataSizeID, NumEditsID, RandSeedID, kCommands,
  kMenus, kPreferences, kTracks, kClips,
  kEnvelopes, kLabels, kBoxes, nTypes,
  kJson, kLisp, kBrief, nFormats,
  FileListID = 6000, CopySelectedFilesButtonID, CopyNamesToClipboardID, FutureActionChoiceID,
  ID_Amp = 10000, ID_Peak, ID_Clip, ID_Bass = 10000,
  ID_Treble, ID_Gain, ID_Link, ID_PercentChange = 10000,
  ID_Multiplier, ID_FromVinyl, ID_ToVinyl, ID_ToLength,
  ID_Thresh = 10000, ID_Width, ID_Threshold = 10000, ID_NoiseFloor,
  ID_Ratio, ID_Attack, ID_Decay, ID_BUTTON_USECURRENTF = 10001,
  ID_BUTTON_USECURRENTB, ID_BUTTON_EXPORT, ID_BUTTON_RESET, ID_FOREGROUNDSTART_T,
  ID_FOREGROUNDEND_T, ID_BACKGROUNDSTART_T, ID_BACKGROUNDEND_T, ID_FOREGROUNDDB_TEXT,
  ID_BACKGROUNDDB_TEXT, ID_RESULTS_TEXT, ID_RESULTSDB_TEXT, ID_Sequence,
  ID_Amplitude, ID_Duration, ID_DutyCycle, ID_Length = 10000,
  ID_dBMax, ID_dBMin, ID_Clear, ID_Invert,
  ID_Mode, ID_Draw, ID_Graphic, ID_Interp,
  ID_Linear, ID_Grid, ID_Curve, ID_Manage,
  ID_Delete, ID_Slider, ID_Duration = 20000, ID_Toggles = 21000,
  ID_Sliders = 22000, ID_Texts = 23000, ID_Duration = 10000, ID_Triggers = 11000,
  ID_Toggles = 12000, ID_Sliders = 13000, ID_Choices = 14000, ID_Texts = 15000,
  ID_TIMER = 20000, ID_BUTTON_GETPROFILE = 10001, ID_RADIOBUTTON_KEEPSIGNAL, ID_RADIOBUTTON_RESIDUE,
  ID_GAIN_SLIDER, ID_GAIN_TEXT, ID_NEW_SENSITIVITY_SLIDER, ID_NEW_SENSITIVITY_TEXT,
  ID_FREQ_SLIDER, ID_FREQ_TEXT, END_OF_BASIC_SLIDERS, END_OF_SLIDERS = END_OF_BASIC_SLIDERS,
  FIRST_SLIDER = ID_GAIN_SLIDER, ID_BUTTON_GETPROFILE = 10001, ID_BUTTON_LEAVENOISE, ID_RADIOBUTTON_KEEPSIGNAL,
  ID_RADIOBUTTON_KEEPNOISE, ID_SENSITIVITY_SLIDER, ID_GAIN_SLIDER, ID_FREQ_SLIDER,
  ID_TIME_SLIDER, ID_SENSITIVITY_TEXT, ID_GAIN_TEXT, ID_FREQ_TEXT,
  ID_TIME_TEXT, ID_Editor = 10000, ID_Load, ID_Save,
  ID_Slider = 11000, ID_Choice = 13000, ID_FILE = 15000, ID_Stages = 10000,
  ID_DryWet, ID_Freq, ID_Phase, ID_Depth,
  ID_Feedback, ID_OutGain, ID_RoomSize = 10000, ID_PreDelay,
  ID_Reverberance, ID_HfDamping, ID_ToneLow, ID_ToneHigh,
  ID_WetGain, ID_DryGain, ID_StereoWidth, ID_WetOnly,
  SBSMSOutBlockSize = 512, ID_FilterPanel = 10000, ID_dBMax, ID_dBMin,
  ID_Type, ID_SubType, ID_Order, ID_Ripple,
  ID_Cutoff, ID_StopbandRipple, ID_RatePercentChangeStart = 10000, ID_RatePercentChangeEnd,
  ID_PitchHalfStepsStart, ID_PitchHalfStepsEnd, ID_PitchPercentChangeStart, ID_PitchPercentChangeEnd,
  ID_Program = 10000, ID_Sliders = 11000, ID_Choices = 12000, ID_Texts = 13000,
  ID_Toggles = 14000, ID_Duration = 20000, ID_Sliders = 21000, ID_Freq = 10000,
  ID_Phase, ID_Depth, ID_Res, ID_FreqOfs,
  ID_OutGain, ID_MIXERPANEL = 10001, ID_SLIDER_CHANNEL, QUALITY_2 = 2,
  PRESET_INSANE = 0, PRESET_EXTREME = 1, PRESET_STANDARD = 2, PRESET_MEDIUM = 3,
  FormatID = 10001, OptionsID, DirID, CreateID,
  ChooseID, LabelID, FirstID, FirstFileNameID,
  TrackID, ByNameAndNumberID, ByNameID, ByNumberID,
  PrefixID, OverwriteID, FirstID = 7000, FreqZoomSliderID,
  FreqPanScrollerID, FreqExportButtonID, FreqAlgChoiceID, FreqSizeChoiceID,
  FreqFuncChoiceID, FreqAxisChoiceID, ReplotButtonID, GridOnOffID,
  ID_AVAIL = 1000, ID_FILESIZE, ID_TOTAL, ID_LEVELS,
  ID_DISCARD, ID_DISCARD_CLIPBOARD, ID_COMPACT, ChoiceID = 9000,
  PlayID, DetectID, ID_INSERTA = 11000, ID_INSERTB,
  ID_REMOVE, ID_IMPORT, ID_EXPORT, LoggerID_Save = wxID_HIGHEST + 1,
  LoggerID_Clear, LoggerID_Close, kID_RadioButton_BouncingBall = 10101, kID_RadioButton_Highlight,
  ID_BITMAPBUTTON_MUSICAL_INSTRUMENT = 13000, ID_SLIDER_PAN, ID_SLIDER_GAIN, ID_TOGGLEBUTTON_MUTE,
  ID_TOGGLEBUTTON_SOLO, kModuleDisabled = 0, kModuleEnabled = 1, kModuleAsk = 2,
  kModuleFailed = 3, kModuleNew = 4, STATE_Enabled, STATE_Disabled,
  STATE_New, STATE_COUNT, HostID = 10000, PlayID,
  RecordID, ChannelsID, ToolColumn, ActionColumn,
  ButtonsColumn, CommentColumn, UseCustomTrackNameID = 1000, ID_WINDOW_SIZE = 10001,
  ID_WINDOW_TYPE, ID_PADDING_SIZE, ID_SCALE, ID_ALGORITHM,
  ID_MINIMUM, ID_MAXIMUM, ID_GAIN, ID_RANGE,
  ID_FREQUENCY_GAIN, ID_COLOR_SCHEME, ID_SPECTRAL_SELECTION, ID_DEFAULTS,
  ID_DEFAULTS = 10001, ID_SCALE, ID_RANGE, FSCKstatus_CLOSE_REQ = 0x1,
  FSCKstatus_CHANGED = 0x2, FSCKstatus_SAVE_AUP = 0x4, SNAP_OFF, SNAP_NEAREST,
  SNAP_PRIOR, FirstID = 1000, HSBarID, VSBarID,
  NextID, FFT_SinCosBRTable, FFT_SinCosTableVBR16, FFT_SinCosTableBR16,
  FFT_FastMathBR16, FFT_FastMathBR24, IdMainWindowSmall = 19200, IdMainWindowLarge,
  IdDirectory, IdDirChoose, IdOneSec, IdTenSec,
  IdOneMin, IdFiveMin, IdOneHour, IdShortTracks,
  IdMedTracks, IdTallTracks, IdDelayCheckBox, IdCaptureFirst,
  IdCaptureEffects = IdCaptureFirst, IdCaptureScriptables, IdCapturePreferences, IdCaptureToolbars,
  IdAllDelayedEvents, IdCaptureWindowContents =IdAllDelayedEvents, IdCaptureFullWindow, IdCaptureWindowPlus,
  IdCaptureFullScreen, IdCaptureSelectionBar, IdCaptureSpectralSelection, IdCaptureTimer,
  IdCaptureTools, IdCaptureTransport, IdCaptureMixer, IdCaptureMeter,
  IdCapturePlayMeter, IdCaptureRecordMeter, IdCaptureEdit, IdCaptureDevice,
  IdCaptureTranscription, IdCaptureScrub, IdCaptureTrackPanel, IdCaptureRuler,
  IdCaptureTracks, IdCaptureFirstTrack, IdCaptureSecondTrack, IdCaptureLast = IdCaptureSecondTrack,
  IdLastDelayedEvent, IdToggleBackgroundBlue, IdToggleBackgroundWhite, eOkButton = 0x0001,
  eCancelButton = 0x0002, eYesButton = 0x0004, eNoButton = 0x0008, eHelpButton = 0x0010,
  ePreviewButton = 0x0020, eDebugButton = 0x0040, eSettingsButton = 0x0080, ePreviewDryButton = 0x0100,
  eApplyButton = 0x0200, eCloseButton = 0x0400, DontShowID =1000, ID_DATEPICKER_START = 10000,
  ID_TIMETEXT_START, ID_DATEPICKER_END, ID_TIMETEXT_END, ID_TIMETEXT_DURATION,
  ID_AUTOSAVEPATH_BUTTON, ID_AUTOSAVEPATH_TEXT, ID_AUTOEXPORTPATH_BUTTON, ID_AUTOEXPORTPATH_TEXT,
  ID_AUTOSAVE_CHECKBOX, ID_AUTOEXPORT_CHECKBOX, POST_TIMER_RECORD_STOPPED = -3, POST_TIMER_RECORD_CANCEL_WAIT,
  POST_TIMER_RECORD_CANCEL, POST_TIMER_RECORD_NOTHING = 0, POST_TIMER_RECORD_CLOSE, ETBCutID,
  ETBCopyID, ETBPasteID, ETBTrimID, ETBSilenceID,
  ETBUndoID, ETBRedoID, ETBZoomInID, ETBZoomOutID,
  ETBZoomSelID, ETBZoomFitID, ETBNumButtons, STBScrubID,
  STBSeekID, STBRulerID, STBNumButtons, STBFirstButton = STBScrubID,
  SelectionBarFirstID = 2700, RateID, SnapToID, OnMenuID,
  ChoiceID, StartTimeID, LengthTimeID, CenterTimeID,
  EndTimeID, AudioTimeID, TimeBarFirstID = 2800, AudioPositionID,
  ToolBarFloatMargin = 1, NoDockID = 0, TopDockID, BotDockID,
  DockCount = 2, TTB_PlaySpeed, TTB_PlaySpeedSlider, TTBNumButtons,
  @0::kTimerInterval = 50, kAffordancesAreaHeight = 18, kTopInset = 4, kTopMargin = kTopInset + kBorderThickness,
  kBottomMargin = kShadowThickness + kBorderThickness, kTrackSeparatorThickness = kBottomMargin + kTopMargin, kChannelSeparatorThickness = 1, OnSetFontID = 30000,
  OnCutSelectedTextID = 1, OnCopySelectedTextID, OnPasteSelectedTextID, OnDeleteSelectedLabelID,
  OnEditSelectedLabelID, OnUpOctaveID = 30000, OnDownOctaveID, OnZoomFitVerticalID = 20000,
  OnZoomResetID, OnZoomDiv2ID, OnZoomTimes2ID, OnZoomHalfWaveID,
  OnZoomInVerticalID, OnZoomOutVerticalID, OnZoomMaxID, OnUpOctaveID,
  OnDownOctaveID, reserveDisplays = 100, OnRate8ID = 30000, OnRate11ID,
  OnRate16ID, OnRate22ID, OnRate44ID, OnRate48ID,
  OnRate88ID, OnRate96ID, OnRate176ID, OnRate192ID,
  OnRate352ID, OnRate384ID, OnRateOtherID, On16BitID,
  On24BitID, OnFloatID, OnMultiViewID, OnSetDisplayId,
  lastDisplayId = (OnSetDisplayId + reserveDisplays - 1), OnChannelLeftID, OnChannelRightID, OnChannelMonoID,
  OnMergeStereoID, OnSwapChannelsID, OnSplitStereoID, OnSplitStereoMonoID,
  ChannelMenuID, FirstAttachedItemId, OnZoomFitVerticalID = 20000, OnZoomResetID,
  OnZoomDiv2ID, OnZoomTimes2ID, OnZoomHalfWaveID, OnZoomInVerticalID,
  OnZoomOutVerticalID, OnFirstWaveformScaleID, OnLastWaveformScaleID = OnFirstWaveformScaleID + 9, OnFirstSpectrumScaleID,
  OnLastSpectrumScaleID = OnFirstSpectrumScaleID + 19, OnTimeTrackLinID = 30000, OnTimeTrackLogID, OnTimeTrackLogIntID,
  OnSetTimeTrackRangeID, SELECTION_RESIZE_REGION = 3, FREQ_SNAP_DISTANCE = 10, OnSetNameID = 2000,
  OnMoveUpID, OnMoveDownID, OnMoveTopID, OnMoveBottomID,
  SCRUBBING_PIXEL_TOLERANCE = 10, kOneSecondCountdown = 1000 / ScrubPollInterval_ms, SELECTION_RESIZE_REGION = 3, FREQ_SNAP_DISTANCE = 10,
  ID_TIMER = wxID_HIGHEST + 1, DontShowID = wxID_HIGHEST + 1, kToggleButtonID = 5000, kTimerID,
  OnMeterUpdateID = 6000, OnMonitorID, OnPreferencesID, AV_FRAME_CROP_UNALIGNED = 1 << 0,
  AV_FRAME_CROP_UNALIGNED = 1 << 0, MAX_HFFT = 10, kVerticalPadding = 7, kBorderThickness = 1,
  kShadowThickness = 1, kLeftInset = 4, kRightInset = kLeftInset, kLeftMargin = kLeftInset + kBorderThickness,
  kRightMargin = kRightInset + kShadowThickness + kBorderThickness, kTrackInfoWidth = 100 - kLeftMargin, ID_AUTOLOAD = 20000, ID_AUTOWRAP,
  ID_FONT, ID_SPLITV, ID_SPLITH, ID_TOGGLECODE,
  ID_TOGGLEOUTPUT, ID_SMALLICONS, ID_LARGEICONS, ID_MATCH,
  ID_TOP, ID_UP, ID_PREVIOUS, ID_NEXT,
  ID_GO, ID_STOP, ID_SCRIPT, ID_OUTPUT
}
 

Functions

int ScreenContaining (wxRect &r)
 
bool CornersOnScreen (wxRect &r)
 
bool IsWindowAccessible (wxRect *requestedRect)
 
void GetDefaultWindowRect (wxRect *defRect)
 
void GetNextWindowPlacement (wxRect *nextRect, bool *pMaximized, bool *pIconized)
 

Variables

static struct anonymous_namespace{ProjectWindow.cpp}::MouseWheelHandler anonymous_namespace{ProjectWindow.cpp}::sMouseWheelHandler
 
AttachedWindows::RegisteredFactory anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey
 
const int sbarSpaceWidth = 15
 
const int sbarControlWidth = 15
 
const int sbarExtraLen = 0
 
const int sbarHjump = 30
 
static struct InstallTopPanelHook installTopPanelHook
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IndicatorSmallWidth 
IndicatorMediumWidth 
IndicatorOffset 
TopMargin 
BottomMargin 
LeftMargin 
RightMargin 
ID_QUIT_AUDACITY 
ID_DISCARD_SELECTED 
ID_RECOVER_SELECTED 
ID_SKIP 
ID_FILE_LIST 
AddButtonID 
RemoveButtonID 
RenameButtonID 
RestoreButtonID 
ImportButtonID 
ExportButtonID 
SaveButtonID 
DefaultsButtonID 
InsertButtonID 
EditButtonID 
DeleteButtonID 
UpButtonID 
DownButtonID 
ApplyToProjectButtonID 
ApplyToFilesButtonID 
RunID 
BSaveID 
ClearID 
StaticTextID 
BlockSizeID 
DataSizeID 
NumEditsID 
RandSeedID 
kCommands 
kMenus 
kPreferences 
kTracks 
kClips 
kEnvelopes 
kLabels 
kBoxes 
nTypes 
kJson 
kLisp 
kBrief 
nFormats 
FileListID 
CopySelectedFilesButtonID 
CopyNamesToClipboardID 
FutureActionChoiceID 
ID_Amp 
ID_Peak 
ID_Clip 
ID_Bass 
ID_Treble 
ID_Gain 
ID_Link 
ID_PercentChange 
ID_Multiplier 
ID_FromVinyl 
ID_ToVinyl 
ID_ToLength 
ID_Thresh 
ID_Width 
ID_Threshold 
ID_NoiseFloor 
ID_Ratio 
ID_Attack 
ID_Decay 
ID_BUTTON_USECURRENTF 
ID_BUTTON_USECURRENTB 
ID_BUTTON_EXPORT 
ID_BUTTON_RESET 
ID_FOREGROUNDSTART_T 
ID_FOREGROUNDEND_T 
ID_BACKGROUNDSTART_T 
ID_BACKGROUNDEND_T 
ID_FOREGROUNDDB_TEXT 
ID_BACKGROUNDDB_TEXT 
ID_RESULTS_TEXT 
ID_RESULTSDB_TEXT 
ID_Sequence 
ID_Amplitude 
ID_Duration 
ID_DutyCycle 
ID_Length 
ID_dBMax 
ID_dBMin 
ID_Clear 
ID_Invert 
ID_Mode 
ID_Draw 
ID_Graphic 
ID_Interp 
ID_Linear 
ID_Grid 
ID_Curve 
ID_Manage 
ID_Delete 
ID_Slider 
ID_Duration 
ID_Toggles 
ID_Sliders 
ID_Texts 
ID_Duration 
ID_Triggers 
ID_Toggles 
ID_Sliders 
ID_Choices 
ID_Texts 
ID_TIMER 
ID_BUTTON_GETPROFILE 
ID_RADIOBUTTON_KEEPSIGNAL 
ID_RADIOBUTTON_RESIDUE 
ID_GAIN_SLIDER 
ID_GAIN_TEXT 
ID_NEW_SENSITIVITY_SLIDER 
ID_NEW_SENSITIVITY_TEXT 
ID_FREQ_SLIDER 
ID_FREQ_TEXT 
END_OF_BASIC_SLIDERS 
END_OF_SLIDERS 
FIRST_SLIDER 
ID_BUTTON_GETPROFILE 
ID_BUTTON_LEAVENOISE 
ID_RADIOBUTTON_KEEPSIGNAL 
ID_RADIOBUTTON_KEEPNOISE 
ID_SENSITIVITY_SLIDER 
ID_GAIN_SLIDER 
ID_FREQ_SLIDER 
ID_TIME_SLIDER 
ID_SENSITIVITY_TEXT 
ID_GAIN_TEXT 
ID_FREQ_TEXT 
ID_TIME_TEXT 
ID_Editor 
ID_Load 
ID_Save 
ID_Slider 
ID_Choice 
ID_FILE 
ID_Stages 
ID_DryWet 
ID_Freq 
ID_Phase 
ID_Depth 
ID_Feedback 
ID_OutGain 
ID_RoomSize 
ID_PreDelay 
ID_Reverberance 
ID_HfDamping 
ID_ToneLow 
ID_ToneHigh 
ID_WetGain 
ID_DryGain 
ID_StereoWidth 
ID_WetOnly 
SBSMSOutBlockSize 
ID_FilterPanel 
ID_dBMax 
ID_dBMin 
ID_Type 
ID_SubType 
ID_Order 
ID_Ripple 
ID_Cutoff 
ID_StopbandRipple 
ID_RatePercentChangeStart 
ID_RatePercentChangeEnd 
ID_PitchHalfStepsStart 
ID_PitchHalfStepsEnd 
ID_PitchPercentChangeStart 
ID_PitchPercentChangeEnd 
ID_Program 
ID_Sliders 
ID_Choices 
ID_Texts 
ID_Toggles 
ID_Duration 
ID_Sliders 
ID_Freq 
ID_Phase 
ID_Depth 
ID_Res 
ID_FreqOfs 
ID_OutGain 
ID_MIXERPANEL 
ID_SLIDER_CHANNEL 
QUALITY_2 
PRESET_INSANE 
PRESET_EXTREME 
PRESET_STANDARD 
PRESET_MEDIUM 
FormatID 
OptionsID 
DirID 
CreateID 
ChooseID 
LabelID 
FirstID 
FirstFileNameID 
TrackID 
ByNameAndNumberID 
ByNameID 
ByNumberID 
PrefixID 
OverwriteID 
FirstID 
FreqZoomSliderID 
FreqPanScrollerID 
FreqExportButtonID 
FreqAlgChoiceID 
FreqSizeChoiceID 
FreqFuncChoiceID 
FreqAxisChoiceID 
ReplotButtonID 
GridOnOffID 
ID_AVAIL 
ID_FILESIZE 
ID_TOTAL 
ID_LEVELS 
ID_DISCARD 
ID_DISCARD_CLIPBOARD 
ID_COMPACT 
ChoiceID 
PlayID 
DetectID 
ID_INSERTA 
ID_INSERTB 
ID_REMOVE 
ID_IMPORT 
ID_EXPORT 
LoggerID_Save 
LoggerID_Clear 
LoggerID_Close 
kID_RadioButton_BouncingBall 
kID_RadioButton_Highlight 
ID_BITMAPBUTTON_MUSICAL_INSTRUMENT 
ID_SLIDER_PAN 
ID_SLIDER_GAIN 
ID_TOGGLEBUTTON_MUTE 
ID_TOGGLEBUTTON_SOLO 
kModuleDisabled 
kModuleEnabled 
kModuleAsk 
kModuleFailed 
kModuleNew 
STATE_Enabled 
STATE_Disabled 
STATE_New 
STATE_COUNT 
HostID 
PlayID 
RecordID 
ChannelsID 
ToolColumn 
ActionColumn 
ButtonsColumn 
CommentColumn 
UseCustomTrackNameID 
ID_WINDOW_SIZE 
ID_WINDOW_TYPE 
ID_PADDING_SIZE 
ID_SCALE 
ID_ALGORITHM 
ID_MINIMUM 
ID_MAXIMUM 
ID_GAIN 
ID_RANGE 
ID_FREQUENCY_GAIN 
ID_COLOR_SCHEME 
ID_SPECTRAL_SELECTION 
ID_DEFAULTS 
ID_DEFAULTS 
ID_SCALE 
ID_RANGE 
FSCKstatus_CLOSE_REQ 
FSCKstatus_CHANGED 
FSCKstatus_SAVE_AUP 
SNAP_OFF 
SNAP_NEAREST 
SNAP_PRIOR 
FirstID 
HSBarID 
VSBarID 
NextID 
FFT_SinCosBRTable 
FFT_SinCosTableVBR16 
FFT_SinCosTableBR16 
FFT_FastMathBR16 
FFT_FastMathBR24 
IdMainWindowSmall 
IdMainWindowLarge 
IdDirectory 
IdDirChoose 
IdOneSec 
IdTenSec 
IdOneMin 
IdFiveMin 
IdOneHour 
IdShortTracks 
IdMedTracks 
IdTallTracks 
IdDelayCheckBox 
IdCaptureFirst 
IdCaptureEffects 
IdCaptureScriptables 
IdCapturePreferences 
IdCaptureToolbars 
IdAllDelayedEvents 
IdCaptureWindowContents 
IdCaptureFullWindow 
IdCaptureWindowPlus 
IdCaptureFullScreen 
IdCaptureSelectionBar 
IdCaptureSpectralSelection 
IdCaptureTimer 
IdCaptureTools 
IdCaptureTransport 
IdCaptureMixer 
IdCaptureMeter 
IdCapturePlayMeter 
IdCaptureRecordMeter 
IdCaptureEdit 
IdCaptureDevice 
IdCaptureTranscription 
IdCaptureScrub 
IdCaptureTrackPanel 
IdCaptureRuler 
IdCaptureTracks 
IdCaptureFirstTrack 
IdCaptureSecondTrack 
IdCaptureLast 
IdLastDelayedEvent 
IdToggleBackgroundBlue 
IdToggleBackgroundWhite 
eOkButton 
eCancelButton 
eYesButton 
eNoButton 
eHelpButton 
ePreviewButton 
eDebugButton 
eSettingsButton 
ePreviewDryButton 
eApplyButton 
eCloseButton 
DontShowID 
ID_DATEPICKER_START 
ID_TIMETEXT_START 
ID_DATEPICKER_END 
ID_TIMETEXT_END 
ID_TIMETEXT_DURATION 
ID_AUTOSAVEPATH_BUTTON 
ID_AUTOSAVEPATH_TEXT 
ID_AUTOEXPORTPATH_BUTTON 
ID_AUTOEXPORTPATH_TEXT 
ID_AUTOSAVE_CHECKBOX 
ID_AUTOEXPORT_CHECKBOX 
POST_TIMER_RECORD_STOPPED 
POST_TIMER_RECORD_CANCEL_WAIT 
POST_TIMER_RECORD_CANCEL 
POST_TIMER_RECORD_NOTHING 
POST_TIMER_RECORD_CLOSE 
ETBCutID 
ETBCopyID 
ETBPasteID 
ETBTrimID 
ETBSilenceID 
ETBUndoID 
ETBRedoID 
ETBZoomInID 
ETBZoomOutID 
ETBZoomSelID 
ETBZoomFitID 
ETBNumButtons 
STBScrubID 
STBSeekID 
STBRulerID 
STBNumButtons 
STBFirstButton 
SelectionBarFirstID 
RateID 
SnapToID 
OnMenuID 
ChoiceID 
StartTimeID 
LengthTimeID 
CenterTimeID 
EndTimeID 
AudioTimeID 
TimeBarFirstID 
AudioPositionID 
ToolBarFloatMargin 
NoDockID 
TopDockID 
BotDockID 
DockCount 
TTB_PlaySpeed 
TTB_PlaySpeedSlider 
TTBNumButtons 
kTimerInterval 
kAffordancesAreaHeight 
kTopInset 
kTopMargin 
kBottomMargin 
kTrackSeparatorThickness 
kChannelSeparatorThickness 
OnSetFontID 
OnCutSelectedTextID 
OnCopySelectedTextID 
OnPasteSelectedTextID 
OnDeleteSelectedLabelID 
OnEditSelectedLabelID 
OnUpOctaveID 
OnDownOctaveID 
OnZoomFitVerticalID 
OnZoomResetID 
OnZoomDiv2ID 
OnZoomTimes2ID 
OnZoomHalfWaveID 
OnZoomInVerticalID 
OnZoomOutVerticalID 
OnZoomMaxID 
OnUpOctaveID 
OnDownOctaveID 
reserveDisplays 
OnRate8ID 
OnRate11ID 
OnRate16ID 
OnRate22ID 
OnRate44ID 
OnRate48ID 
OnRate88ID 
OnRate96ID 
OnRate176ID 
OnRate192ID 
OnRate352ID 
OnRate384ID 
OnRateOtherID 
On16BitID 
On24BitID 
OnFloatID 
OnMultiViewID 
OnSetDisplayId 
lastDisplayId 
OnChannelLeftID 
OnChannelRightID 
OnChannelMonoID 
OnMergeStereoID 
OnSwapChannelsID 
OnSplitStereoID 
OnSplitStereoMonoID 
ChannelMenuID 
FirstAttachedItemId 
OnZoomFitVerticalID 
OnZoomResetID 
OnZoomDiv2ID 
OnZoomTimes2ID 
OnZoomHalfWaveID 
OnZoomInVerticalID 
OnZoomOutVerticalID 
OnFirstWaveformScaleID 
OnLastWaveformScaleID 
OnFirstSpectrumScaleID 
OnLastSpectrumScaleID 
OnTimeTrackLinID 
OnTimeTrackLogID 
OnTimeTrackLogIntID 
OnSetTimeTrackRangeID 
SELECTION_RESIZE_REGION 
FREQ_SNAP_DISTANCE 
OnSetNameID 
OnMoveUpID 
OnMoveDownID 
OnMoveTopID 
OnMoveBottomID 
SCRUBBING_PIXEL_TOLERANCE 
kOneSecondCountdown 
SELECTION_RESIZE_REGION 
FREQ_SNAP_DISTANCE 
ID_TIMER 
DontShowID 
kToggleButtonID 
kTimerID 
OnMeterUpdateID 
OnMonitorID 
OnPreferencesID 
AV_FRAME_CROP_UNALIGNED 
AV_FRAME_CROP_UNALIGNED 
MAX_HFFT 
kVerticalPadding 

Width of padding below each channel group

kBorderThickness 
kShadowThickness 
kLeftInset 
kRightInset 
kLeftMargin 
kRightMargin 
kTrackInfoWidth 
ID_AUTOLOAD 
ID_AUTOWRAP 
ID_FONT 
ID_SPLITV 
ID_SPLITH 
ID_TOGGLECODE 
ID_TOGGLEOUTPUT 
ID_SMALLICONS 
ID_LARGEICONS 
ID_MATCH 
ID_TOP 
ID_UP 
ID_PREVIOUS 
ID_NEXT 
ID_GO 
ID_STOP 
ID_SCRIPT 
ID_OUTPUT 

Definition at line 562 of file ProjectWindow.cpp.

562  {
563  FirstID = 1000,
564 
565  // Window controls
566 
567  HSBarID,
568  VSBarID,
569 
570  NextID,
571 };

Function Documentation

◆ CornersOnScreen()

bool CornersOnScreen ( wxRect &  r)

Definition at line 59 of file ProjectWindow.cpp.

59  {
60  if( wxDisplay::GetFromPoint( r.GetTopLeft() ) == wxNOT_FOUND) return false;
61  if( wxDisplay::GetFromPoint( r.GetBottomRight() ) == wxNOT_FOUND) return false;
62  return true;
63 }

Referenced by GetNextWindowPlacement().

Here is the caller graph for this function:

◆ GetDefaultWindowRect()

void GetDefaultWindowRect ( wxRect *  defRect)

Definition at line 92 of file ProjectWindow.cpp.

93 {
94  *defRect = wxGetClientDisplayRect();
95 
96  int width = 940;
97  int height = 674;
98 
99  //These conditional values assist in improving placement and size
100  //of NEW windows on different platforms.
101 #ifdef __WXGTK__
102  height += 20;
103 #endif
104 
105 #ifdef __WXMSW__
106  height += 40;
107 #endif
108 
109 #ifdef __WXMAC__
110  height += 55;
111 #endif
112 
113  // Use screen size where it is smaller than the values we would like.
114  // Otherwise use the values we would like, and centred.
115  if (width < defRect->width)
116  {
117  defRect->x = (defRect->width - width)/2;
118  defRect->width = width;
119  }
120 
121  if (height < defRect->height)
122  {
123  defRect->y = (defRect->height - height)/2;
124  // Bug 1119 workaround
125  // Small adjustment for very small Mac screens.
126  // If there is only a tiny space at the top
127  // then instead of vertical centre, align to bottom.
128  const int pixelsFormenu = 60;
129  if( defRect->y < pixelsFormenu )
130  defRect->y *=2;
131  defRect->height = height;
132  }
133 }

Referenced by GetNextWindowPlacement(), and ProjectManager::SaveWindowSize().

Here is the caller graph for this function:

◆ GetNextWindowPlacement()

void GetNextWindowPlacement ( wxRect *  nextRect,
bool *  pMaximized,
bool *  pIconized 
)

Definition at line 139 of file ProjectWindow.cpp.

140 {
141  int inc = 25;
142 
143  wxRect defaultRect;
144  GetDefaultWindowRect(&defaultRect);
145 
146  gPrefs->Read(wxT("/Window/Maximized"), pMaximized, false);
147  gPrefs->Read(wxT("/Window/Iconized"), pIconized, false);
148 
149  wxRect windowRect;
150  gPrefs->Read(wxT("/Window/X"), &windowRect.x, defaultRect.x);
151  gPrefs->Read(wxT("/Window/Y"), &windowRect.y, defaultRect.y);
152  gPrefs->Read(wxT("/Window/Width"), &windowRect.width, defaultRect.width);
153  gPrefs->Read(wxT("/Window/Height"), &windowRect.height, defaultRect.height);
154 
155  wxRect normalRect;
156  gPrefs->Read(wxT("/Window/Normal_X"), &normalRect.x, defaultRect.x);
157  gPrefs->Read(wxT("/Window/Normal_Y"), &normalRect.y, defaultRect.y);
158  gPrefs->Read(wxT("/Window/Normal_Width"), &normalRect.width, defaultRect.width);
159  gPrefs->Read(wxT("/Window/Normal_Height"), &normalRect.height, defaultRect.height);
160 
161  // Workaround 2.1.1 and earlier bug on OSX...affects only normalRect, but let's just
162  // validate for all rects and plats
163  if (normalRect.width == 0 || normalRect.height == 0) {
164  normalRect = defaultRect;
165  }
166  if (windowRect.width == 0 || windowRect.height == 0) {
167  windowRect = defaultRect;
168  }
169 
170 
171  wxRect screenRect( wxGetClientDisplayRect());
172 #if defined(__WXMAC__)
173 
174  // On OSX, the top of the window should never be less than the menu height,
175  // so something is amiss if it is
176  if (normalRect.y < screenRect.y) {
177  normalRect = defaultRect;
178  }
179  if (windowRect.y < screenRect.y) {
180  windowRect = defaultRect;
181  }
182 #endif
183 
184  // IF projects empty, THEN it's the first window.
185  // It lands where the config says it should, and can straddle screen.
186  if (AllProjects{}.empty()) {
187  if (*pMaximized || *pIconized) {
188  *nextRect = normalRect;
189  }
190  else {
191  *nextRect = windowRect;
192  }
193  // Resize, for example if one monitor that was on is now off.
194  if (!CornersOnScreen( wxRect(*nextRect).Deflate( 32, 32 ))) {
195  *nextRect = defaultRect;
196  }
197  if (!IsWindowAccessible(nextRect)) {
198  *nextRect = defaultRect;
199  }
200  // Do not trim the first project window down.
201  // All corners are on screen (or almost so), and
202  // the rect may straddle screens.
203  return;
204  }
205 
206 
207  // ELSE a subsequent NEW window. It will NOT straddle screens.
208 
209  // We don't mind being 32 pixels off the screen in any direction.
210  // Make sure initial sizes (pretty much) fit within the display bounds
211  // We used to trim the sizes which could result in ridiculously small windows.
212  // contributing to bug 1243.
213  // Now instead if the window significantly doesn't fit the screen, we use the default
214  // window instead, which we know does.
215  if (ScreenContaining( wxRect(normalRect).Deflate( 32, 32 ))<0) {
216  normalRect = defaultRect;
217  }
218  if (ScreenContaining( wxRect(windowRect).Deflate( 32, 32 ) )<0) {
219  windowRect = defaultRect;
220  }
221 
222  bool validWindowSize = false;
223  ProjectWindow * validProject = NULL;
224  for ( auto iter = AllProjects{}.rbegin(), end = AllProjects{}.rend();
225  iter != end; ++iter
226  ) {
227  auto pProject = *iter;
228  if (!GetProjectFrame( *pProject ).IsIconized()) {
229  validWindowSize = true;
230  validProject = &ProjectWindow::Get( *pProject );
231  break;
232  }
233  }
234  if (validWindowSize) {
235  *nextRect = validProject->GetRect();
236  *pMaximized = validProject->IsMaximized();
237  *pIconized = validProject->IsIconized();
238  // Do not straddle screens.
239  if (ScreenContaining( wxRect(*nextRect).Deflate( 32, 32 ) )<0) {
240  *nextRect = defaultRect;
241  }
242  }
243  else {
244  *nextRect = normalRect;
245  }
246 
247  //Placement depends on the increments
248  nextRect->x += inc;
249  nextRect->y += inc;
250 
251  // defaultrect is a rectangle on the first screen. It's the right fallback to
252  // use most of the time if things are not working out right with sizing.
253  // windowRect is a saved rectangle size.
254  // normalRect seems to be a substitute for windowRect when iconized or maximised.
255 
256  // Windows can say that we are off screen when actually we are not.
257  // On Windows 10 I am seeing miscalculation by about 6 pixels.
258  // To fix this we allow some sloppiness on the edge being counted as off screen.
259  // This matters most when restoring very carefully sized windows that are maximised
260  // in one dimension (height or width) but not both.
261  const int edgeSlop = 10;
262 
263  // Next four lines are getting the rectangle for the screen that contains the
264  // top left corner of nextRect (and defaulting to rect of screen 0 otherwise).
265  wxPoint p = nextRect->GetLeftTop();
266  int scr = std::max( 0, wxDisplay::GetFromPoint( p ));
267  wxDisplay d( scr );
268  screenRect = d.GetClientArea();
269 
270  // Now we (possibly) start trimming our rectangle down.
271  // Have we hit the right side of the screen?
272  wxPoint bottomRight = nextRect->GetBottomRight();
273  if (bottomRight.x > (screenRect.GetRight()+edgeSlop)) {
274  int newWidth = screenRect.GetWidth() - nextRect->GetLeft();
275  if (newWidth < defaultRect.GetWidth()) {
276  nextRect->x = windowRect.x;
277  nextRect->y = windowRect.y;
278  nextRect->width = windowRect.width;
279  }
280  else {
281  nextRect->width = newWidth;
282  }
283  }
284 
285  // Have we hit the bottom of the screen?
286  bottomRight = nextRect->GetBottomRight();
287  if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
288  nextRect->y -= inc;
289  bottomRight = nextRect->GetBottomRight();
290  if (bottomRight.y > (screenRect.GetBottom()+edgeSlop)) {
291  nextRect->SetBottom(screenRect.GetBottom());
292  }
293  }
294 
295  // After all that we could have a window that does not have a visible
296  // top bar. [It is unlikely, but something might have gone wrong]
297  // If so, use the safe fallback size.
298  if (!IsWindowAccessible(nextRect)) {
299  *nextRect = defaultRect;
300  }
301 }

References CornersOnScreen(), AllProjects::empty(), ProjectWindow::Get(), GetDefaultWindowRect(), GetProjectFrame(), gPrefs, ProjectWindow::IsIconized(), IsWindowAccessible(), AllProjects::rbegin(), AllProjects::rend(), and ScreenContaining().

Referenced by AudacityApp::InitPart2(), and ProjectManager::New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsWindowAccessible()

bool IsWindowAccessible ( wxRect *  requestedRect)

Definition at line 66 of file ProjectWindow.cpp.

67 {
68  wxDisplay display;
69  wxRect targetTitleRect(requestedRect->GetLeftTop(), requestedRect->GetBottomRight());
70  // Hackery to approximate a window top bar size from a window size.
71  // and exclude the open/close and borders.
72  targetTitleRect.x += 15;
73  targetTitleRect.width -= 100;
74  if (targetTitleRect.width < 165) targetTitleRect.width = 165;
75  targetTitleRect.height = 15;
76  int targetBottom = targetTitleRect.GetBottom();
77  int targetRight = targetTitleRect.GetRight();
78  // This looks like overkill to check each and every pixel in the ranges.
79  // and decide that if any is visible on screen we are OK.
80  for (int i = targetTitleRect.GetLeft(); i < targetRight; i++) {
81  for (int j = targetTitleRect.GetTop(); j < targetBottom; j++) {
82  int monitor = display.GetFromPoint(wxPoint(i, j));
83  if (monitor != wxNOT_FOUND) {
84  return TRUE;
85  }
86  }
87  }
88  return FALSE;
89 }

References monitor.

Referenced by GetNextWindowPlacement().

Here is the caller graph for this function:

◆ ScreenContaining()

int ScreenContaining ( wxRect &  r)

Definition at line 44 of file ProjectWindow.cpp.

44  {
45  unsigned int n = wxDisplay::GetCount();
46  for(unsigned int i = 0;i<n;i++){
47  wxDisplay d(i);
48  wxRect scr = d.GetClientArea();
49  if( scr.Contains( r ) )
50  return (int)i;
51  }
52  return -1;
53 }

Referenced by GetNextWindowPlacement().

Here is the caller graph for this function:

Variable Documentation

◆ installTopPanelHook

struct InstallTopPanelHook installTopPanelHook
static

◆ sbarControlWidth

const int sbarControlWidth = 15

Definition at line 779 of file ProjectWindow.cpp.

◆ sbarExtraLen

const int sbarExtraLen = 0

Definition at line 780 of file ProjectWindow.cpp.

◆ sbarHjump

const int sbarHjump = 30

◆ sbarSpaceWidth

const int sbarSpaceWidth = 15

Definition at line 778 of file ProjectWindow.cpp.

VSBarID
@ VSBarID
Definition: ProjectWindow.cpp:568
monitor
EventMonitor monitor
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
FirstID
@ FirstID
Definition: ProjectWindow.cpp:563
CornersOnScreen
bool CornersOnScreen(wxRect &r)
Definition: ProjectWindow.cpp:59
AllProjects::empty
bool empty() const
Definition: Project.h:46
AllProjects::rbegin
const_reverse_iterator rbegin() const
Definition: Project.cpp:34
NextID
@ NextID
Definition: ProjectWindow.cpp:570
ProjectWindow
A top-level window associated with a project, and handling scrollbars and zooming.
Definition: ProjectWindow.h:32
HSBarID
@ HSBarID
Definition: ProjectWindow.cpp:567
GetDefaultWindowRect
void GetDefaultWindowRect(wxRect *defRect)
Definition: ProjectWindow.cpp:92
ScreenContaining
int ScreenContaining(wxRect &r)
Definition: ProjectWindow.cpp:44
ProjectWindow::IsIconized
bool IsIconized() const override
Definition: ProjectWindow.cpp:1226
IsWindowAccessible
bool IsWindowAccessible(wxRect *requestedRect)
Definition: ProjectWindow.cpp:66
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
AllProjects
Definition: Project.h:35
AllProjects::rend
const_reverse_iterator rend() const
Definition: Project.cpp:39