Audacity  3.0.3
Classes | Typedefs | Enumerations | Functions
Dependencies.cpp File Reference
#include "Audacity.h"
#include "Dependencies.h"
#include <wx/button.h>
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/filename.h>
#include <wx/listctrl.h>
#include <wx/menu.h>
#include <wx/choice.h>
#include <wx/clipbrd.h>
#include <wx/dataobj.h>
#include <wx/frame.h>
#include <wx/stattext.h>
#include "blockfile/SimpleBlockFile.h"
#include "DirManager.h"
#include "FileFormats.h"
#include "Prefs.h"
#include "Project.h"
#include "Sequence.h"
#include "ShuttleGui.h"
#include "WaveTrack.h"
#include "WaveClip.h"
#include "prefs/QualityPrefs.h"
#include "widgets/AudacityMessageBox.h"
#include "widgets/ProgressDialog.h"
#include <unordered_map>
Include dependency graph for Dependencies.cpp:

Go to the source code of this file.

Classes

class  DependencyDialog
 DependencyDialog shows dependencies of an AudacityProject on AliasedFile s. More...
 

Typedefs

using AliasedFileHash = std::unordered_map< wxString, AliasedFile * >
 
using ReplacedBlockFileHash = std::unordered_map< BlockFile *, BlockFilePtr >
 
using BoolBlockFileHash = std::unordered_map< BlockFile *, bool >
 

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_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, 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

static void GetAllSeqBlocks (AudacityProject *project, BlockPtrArray *outBlocks)
 
static void ReplaceBlockFiles (BlockPtrArray &blocks, ReplacedBlockFileHash &hash)
 
void FindDependencies (AudacityProject *project, AliasedFileArray &outAliasedFiles)
 
static void RemoveDependencies (AudacityProject *project, AliasedFileArray &aliasedFiles)
 
 EVT_BUTTON (wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
 
DependencyDialog::OnYes EVT_BUTTON (wxID_CANCEL, DependencyDialog::OnCancel) DependencyDialog
 
static const TranslatableString kStdMsg ()
 
static const TranslatableString kExtraMsgForMissingFiles ()
 
bool ShowDependencyDialogIfNeeded (AudacityProject *project, bool isSaving)
 

Typedef Documentation

◆ AliasedFileHash

using AliasedFileHash = std::unordered_map<wxString, AliasedFile*>

Definition at line 67 of file Dependencies.cpp.

◆ BoolBlockFileHash

using BoolBlockFileHash = std::unordered_map<BlockFile *, bool>

Definition at line 72 of file Dependencies.cpp.

◆ ReplacedBlockFileHash

using ReplacedBlockFileHash = std::unordered_map<BlockFile *, BlockFilePtr>

Definition at line 71 of file Dependencies.cpp.

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_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 
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 287 of file Dependencies.cpp.

287  {
288  FileListID = 6000,
292 };

Function Documentation

◆ EVT_BUTTON() [1/2]

DependencyDialog::OnYes EVT_BUTTON ( wxID_CANCEL  ,
DependencyDialog::OnCancel   
)

Definition at line 302 of file Dependencies.cpp.

311 : wxDialogWrapper(parent, id, XO("Project Depends on Other Audio Files"),
312  wxDefaultPosition, wxDefaultSize,
313  (isSaving ?
314  (wxDEFAULT_DIALOG_STYLE & ~wxCLOSE_BOX) : // no close box when saving
315  wxDEFAULT_DIALOG_STYLE) |
316  wxRESIZE_BORDER),
317  mProject(project),
318  mAliasedFiles(aliasedFiles),
319  mIsSaving(isSaving),
320  mHasMissingFiles(false),
321  mHasNonMissingFiles(false),
322  mMessageStaticText(NULL),
323  mFileListCtrl(NULL),
324  mCopySelectedFilesButton(NULL),
325  mCopyAllFilesButton(NULL),
326  mFutureActionChoice(NULL)
327 {
328  SetName();
329  ShuttleGui S(this, eIsCreating);
330  PopulateOrExchange(S);
331 }

References eIsCreating.

◆ EVT_BUTTON() [2/2]

EVT_BUTTON ( wxID_NO  ,
DependencyDialog::OnNo   
)

◆ FindDependencies()

void FindDependencies ( AudacityProject project,
AliasedFileArray outAliasedFiles 
)

Definition at line 109 of file Dependencies.cpp.

111 {
113 
114  BlockPtrArray blocks;
115  GetAllSeqBlocks(project, &blocks);
116 
117  AliasedFileHash aliasedFileHash;
118  BoolBlockFileHash blockFileHash;
119 
120  for (const auto &blockFile : blocks) {
121  const auto &f = blockFile->f;
122  if (f->IsAlias() && (blockFileHash.count( &*f ) == 0))
123  {
124  // f is an alias block we have not yet counted.
125  blockFileHash[ &*f ] = true; // Don't count the same blockfile twice.
126  auto aliasBlockFile = static_cast<AliasBlockFile*>( &*f );
127  const wxFileName &fileName = aliasBlockFile->GetAliasedFileName();
128 
129  // In ProjectFSCK(), if the user has chosen to
130  // "Replace missing audio with silence", the code there puts in an empty wxFileName.
131  // Don't count those in dependencies.
132  if (!fileName.IsOk())
133  continue;
134 
135  const wxString &fileNameStr = fileName.GetFullPath();
136  auto blockBytes = (SAMPLE_SIZE(format) *
137  aliasBlockFile->GetLength());
138  if (aliasedFileHash.count(fileNameStr) > 0)
139  // Already put this AliasBlockFile in aliasedFileHash.
140  // Update block count.
141  aliasedFileHash[fileNameStr]->mByteCount += blockBytes;
142  else
143  {
144  // Haven't counted this AliasBlockFile yet.
145  // Add to return array and internal hash.
146 
147  // PRL: do this in two steps so that we move instead of copying.
148  // We don't have a moving push_back in all compilers.
149  outAliasedFiles.push_back(AliasedFile{});
150  outAliasedFiles.back() =
151  AliasedFile {
152  wxFileNameWrapper { fileName },
153  wxLongLong(blockBytes), fileName.FileExists()
154  };
155  aliasedFileHash[fileNameStr] = &outAliasedFiles.back();
156  }
157  }
158  }
159 }

References format, GetAllSeqBlocks(), SAMPLE_SIZE, and QualitySettings::SampleFormatChoice().

Referenced by ShowDependencyDialogIfNeeded().

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

◆ GetAllSeqBlocks()

static void GetAllSeqBlocks ( AudacityProject project,
BlockPtrArray outBlocks 
)
static

Definition at line 77 of file Dependencies.cpp.

79 {
80  for (auto waveTrack : TrackList::Get( *project ).Any< WaveTrack >()) {
81  for(const auto &clip : waveTrack->GetAllClips()) {
82  Sequence *sequence = clip->GetSequence();
83  BlockArray &blocks = sequence->GetBlockArray();
84  for (size_t i = 0; i < blocks.size(); i++)
85  outBlocks->push_back(&blocks[i]);
86  }
87  }
88 }

References TrackList::Any(), TrackList::Get(), and Sequence::GetBlockArray().

Referenced by FindDependencies(), and RemoveDependencies().

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

◆ kExtraMsgForMissingFiles()

static const TranslatableString kExtraMsgForMissingFiles ( )
static

Definition at line 340 of file Dependencies.cpp.

341 {
342  return
343 XO("\n\nFiles shown as MISSING have been moved or deleted and cannot be copied.\
344 \nRestore them to their original location to be able to copy into project.");
345 }

References XO.

Referenced by DependencyDialog::PopulateList().

Here is the caller graph for this function:

◆ kStdMsg()

static const TranslatableString kStdMsg ( )
static

Definition at line 333 of file Dependencies.cpp.

334 {
335  return
336 XO("Copying these files into your project will remove this dependency.\
337 \nThis is safer, but needs more disk space.");
338 }

References XO.

Referenced by DependencyDialog::PopulateList(), and DependencyDialog::PopulateOrExchange().

Here is the caller graph for this function:

◆ RemoveDependencies()

static void RemoveDependencies ( AudacityProject project,
AliasedFileArray aliasedFiles 
)
static

Definition at line 164 of file Dependencies.cpp.

167 {
168  auto &dirManager = DirManager::Get( *project );
169 
170  ProgressDialog progress(
171  XO("Removing Dependencies"),
172  XO("Copying audio data into project..."));
173  auto updateResult = ProgressResult::Success;
174 
175  // Hash aliasedFiles based on their full paths and
176  // count total number of bytes to process.
177  AliasedFileHash aliasedFileHash;
178  wxLongLong totalBytesToProcess = 0;
179  for (auto &aliasedFile : aliasedFiles) {
180  totalBytesToProcess += aliasedFile.mByteCount;
181  const wxString &fileNameStr = aliasedFile.mFileName.GetFullPath();
182  aliasedFileHash[fileNameStr] = &aliasedFile;
183  }
184 
185  BlockPtrArray blocks;
186  GetAllSeqBlocks(project, &blocks);
187 
189  ReplacedBlockFileHash blockFileHash;
190  wxLongLong completedBytes = 0;
191  for (const auto blockFile : blocks) {
192  const auto &f = blockFile->f;
193  if (f->IsAlias() && (blockFileHash.count( &*f ) == 0))
194  {
195  // f is an alias block we have not yet processed.
196  auto aliasBlockFile = static_cast<AliasBlockFile*>( &*f );
197  const wxFileName &fileName = aliasBlockFile->GetAliasedFileName();
198  const wxString &fileNameStr = fileName.GetFullPath();
199 
200  if (aliasedFileHash.count(fileNameStr) == 0)
201  // This aliased file was not selected to be replaced. Skip it.
202  continue;
203 
204  // Convert it from an aliased file to an actual file in the project.
205  auto len = aliasBlockFile->GetLength();
206  BlockFilePtr newBlockFile;
207  {
208  SampleBuffer buffer(len, format);
209  // We tolerate exceptions from NewBlockFile
210  // and so we can allow exceptions from ReadData too
211  f->ReadData(buffer.ptr(), format, 0, len);
212  newBlockFile =
213  dirManager.NewBlockFile( [&]( wxFileNameWrapper filePath ) {
214  return make_blockfile<SimpleBlockFile>(
215  std::move(filePath), buffer.ptr(), len, format);
216  } );
217  }
218 
219  // Update our hash so we know what block files we've done
220  blockFileHash[ &*f ] = newBlockFile;
221 
222  // Update the progress bar
223  completedBytes += SAMPLE_SIZE(format) * len;
224  updateResult = progress.Update(completedBytes, totalBytesToProcess);
225  if (updateResult != ProgressResult::Success)
226  // leave the project unchanged
227  return;
228  }
229  }
230 
231  // COMMIT OPERATIONS needing NOFAIL-GUARANTEE:
232 
233  // Above, we created a SimpleBlockFile contained in our project
234  // to go with each AliasBlockFile that we wanted to migrate.
235  // However, that didn't actually change any references to these
236  // blockfiles in the Sequences, so we do that next...
237  ReplaceBlockFiles(blocks, blockFileHash);
238 }

References format, BasicUI::Get(), GetAllSeqBlocks(), SampleBuffer::ptr(), ReplaceBlockFiles(), SAMPLE_SIZE, QualitySettings::SampleFormatChoice(), BasicUI::Success, ProgressDialog::Update(), and XO.

Referenced by DependencyDialog::OnCopySelectedFiles(), and ShowDependencyDialogIfNeeded().

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

◆ ReplaceBlockFiles()

static void ReplaceBlockFiles ( BlockPtrArray blocks,
ReplacedBlockFileHash hash 
)
static

Definition at line 95 of file Dependencies.cpp.

98 {
99  for (const auto &pBlock : blocks) {
100  auto &f = pBlock->f;
101  const auto src = &*f;
102  if (hash.count( src ) > 0) {
103  const auto &dst = hash[src];
104  f = dst;
105  }
106  }
107 }

Referenced by RemoveDependencies().

Here is the caller graph for this function:

◆ ShowDependencyDialogIfNeeded()

bool ShowDependencyDialogIfNeeded ( AudacityProject project,
bool  isSaving 
)

Definition at line 602 of file Dependencies.cpp.

604 {
605  auto pWindow = FindProjectFrame( project );
606  AliasedFileArray aliasedFiles;
607  FindDependencies(project, aliasedFiles);
608 
609  if (aliasedFiles.empty()) {
610  if (!isSaving)
611  {
612  auto msg =
613 XO("Your project is self-contained; it does not depend on any external audio files. \
614 \n\nSome older Audacity projects may not be self-contained, and care \n\
615 is needed to keep their external dependencies in the right place.\n\
616 New projects will be self-contained and are less risky.");
618  msg,
619  XO("Dependency Check"),
620  wxOK | wxICON_INFORMATION,
621  pWindow);
622  }
623  return true; // Nothing to do.
624  }
625 
626  if (isSaving)
627  {
628  RemoveDependencies(project, aliasedFiles);
629  return true;
630  }
631 
632  DependencyDialog dlog(pWindow, -1, project, aliasedFiles, isSaving);
633  int returnCode = dlog.ShowModal();
634  if (returnCode == wxID_CANCEL)
635  return false;
636  else if (returnCode == wxID_YES)
637  RemoveDependencies(project, aliasedFiles);
638 
639  return true;
640 }

References AudacityMessageBox(), FindDependencies(), FindProjectFrame(), RemoveDependencies(), and XO.

Here is the call graph for this function:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
BasicUI::ProgressResult::Success
@ Success
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
wxFileNameWrapper
Definition: wxFileNameWrapper.h:21
GetAllSeqBlocks
static void GetAllSeqBlocks(AudacityProject *project, BlockPtrArray *outBlocks)
Definition: Dependencies.cpp:77
SAMPLE_SIZE
#define SAMPLE_SIZE(SampleFormat)
Definition: SampleFormat.h:44
XO
#define XO(s)
Definition: Internat.h:31
FileListID
@ FileListID
Definition: Dependencies.cpp:288
ReplacedBlockFileHash
std::unordered_map< BlockFile *, BlockFilePtr > ReplacedBlockFileHash
Definition: Dependencies.cpp:71
Sequence::GetBlockArray
BlockArray & GetBlockArray()
Definition: Sequence.h:186
Sequence
A WaveTrack contains WaveClip(s). A WaveClip contains a Sequence. A Sequence is primarily an interfac...
Definition: Sequence.h:61
FutureActionChoiceID
@ FutureActionChoiceID
Definition: Dependencies.cpp:291
CopyNamesToClipboardID
@ CopyNamesToClipboardID
Definition: Dependencies.cpp:290
ProgressDialog
ProgressDialog Class.
Definition: ProgressDialog.h:51
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
BlockPtrArray
std::vector< SeqBlock * > BlockPtrArray
Definition: Sequence.h:50
ReplaceBlockFiles
static void ReplaceBlockFiles(BlockPtrArray &blocks, ReplacedBlockFileHash &hash)
Definition: Dependencies.cpp:95
format
int format
Definition: ExportPCM.cpp:56
AliasedFileArray
std::list< AliasedFile > AliasedFileArray
Definition: Dependencies.h:52
DependencyDialog
DependencyDialog shows dependencies of an AudacityProject on AliasedFile s.
Definition: Dependencies.cpp:245
AliasedFile
An audio file that is referenced (pointed into) directly from an Audacity .aup file rather than Audac...
Definition: Dependencies.h:24
SampleBuffer
Definition: SampleFormat.h:69
sampleFormat
sampleFormat
Definition: SampleFormat.h:29
wxDialogWrapper
Definition: wxPanelWrapper.h:81
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
BlockArray
Definition: Sequence.h:49
QualitySettings::SampleFormatChoice
PROJECT_RATE_API sampleFormat SampleFormatChoice()
Definition: QualitySettings.cpp:38
AliasedFileHash
std::unordered_map< wxString, AliasedFile * > AliasedFileHash
Definition: Dependencies.cpp:67
FindDependencies
void FindDependencies(AudacityProject *project, AliasedFileArray &outAliasedFiles)
Definition: Dependencies.cpp:109
FindProjectFrame
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
Definition: ProjectWindows.cpp:88
RemoveDependencies
static void RemoveDependencies(AudacityProject *project, AliasedFileArray &aliasedFiles)
Definition: Dependencies.cpp:164
CopySelectedFilesButtonID
@ CopySelectedFilesButtonID
Definition: Dependencies.cpp:289
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1371
BoolBlockFileHash
std::unordered_map< BlockFile *, bool > BoolBlockFileHash
Definition: Dependencies.cpp:72
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631