16#include <wx/evtloop.h>
67 auto result = std::make_shared< ProjectFileManager >( parent );
88 projectFileManager.ReadProjectFile(filename,
true);
90 if (projectFileManager.mLastSavedTracks) {
91 for (
auto wt : projectFileManager.mLastSavedTracks->Any<
WaveTrack>())
93 projectFileManager.mLastSavedTracks.reset();
110 "FAQ:Errors_on_opening_or_recovering_an_Audacity_project";
112using Pair = std::pair< const char *, const char * >;
115 "not well-formed (invalid token)",
116 "Error:_not_well-formed_(invalid_token)_at_line_x"
119 "reference to invalid character number",
120 "Error_Opening_Project:_Reference_to_invalid_character_number_at_line_x"
133 if ( !libraryError.
empty() ) {
136 auto msgid = libraryError.
MSGID().
GET();
138 [&](
const Pair &pair ) {
139 return msgid.Contains( pair.first ); }
142 auto url = found->second;
156 const FilePath &fileName,
bool discardAutosave )
166 auto parseResult = projectFileIO.LoadProject(fileName, discardAutosave);
167 const bool bParseSuccess = parseResult.has_value();
170 bool waveTrackLinkTypeChanged =
false;
178 const auto linkType = t->GetLinkType();
182 if (!t->LinkConsistencyFix()) {
183 otherError =
XO(
"A channel of a stereo track was missing.");
192 if(
const auto left =
dynamic_cast<WaveTrack*
>(t))
195 if(
const auto right =
dynamic_cast<WaveTrack*
>(*
tracks.Find(left).advance(1)))
197 waveTrackLinkTypeChanged =
true;
201 if (
const auto message = t->GetErrorOpening()) {
203 wxT(
"Track %s had error reading clip values from project file."),
207 otherError = *message;
212 if(waveTrackLinkTypeChanged && !discardAutosave)
215"This project contained stereo tracks with non-aligned content.\n"
216"This feature is not supported in Audacity versions past 3.3.3.\n"
217"These stereo tracks have been split into mono tracks.\n"
218"As a result, some realtime effects may be missing.\n"
219"Please verify that everything works as intended before saving."
223 parseResult->Commit();
226 projectFileIO.AutoSaveDelete();
227 else if (projectFileIO.IsRecovered()) {
228 bool resaved =
false;
230 if (!projectFileIO.IsTemporary() &&
231 !waveTrackLinkTypeChanged)
235 resaved = projectFileIO.SaveProject(fileName,
nullptr);
241"This project was not saved properly the last time Audacity ran.\n\n"
242"It has been recovered to the last snapshot.")
244"This project was not saved properly the last time Audacity ran.\n\n"
245"It has been recovered to the last snapshot, but you must save it\n"
246"to preserve its contents."),
247 XO(
"Project Recovered"),
259 mLastSavedTracks->Append(std::move(*t->Duplicate()));
266 (bParseSuccess ? otherError : projectFileIO.GetLastError()),
276 if (projectFileIO.IsTemporary())
281 return DoSave(projectFileIO.GetFileName(),
false);
301 ProjectDisabler(wxWindow *w)
304 mWindow->GetEventHandler()->SetEvtHandlerEnabled(
false);
308 mWindow->GetEventHandler()->SetEvtHandlerEnabled(
true);
340 "Your project is now empty.\nIf saved, the project will have no tracks.\n\nTo save any previously open tracks:\nClick 'No', Edit > Undo until all tracks\nare open, then File > Save Project.\n\nSave anyway?"),
341 XO(
"Warning - Empty Project"),
342 wxYES_NO | wxICON_QUESTION,
351 wxULongLong fileSize = wxFileName::GetSize(projectFileIO.GetFileName());
353 wxDiskspaceSize_t freeSpace;
356 if (freeSpace.GetValue() <= fileSize.GetValue())
359 XO(
"Insufficient Disk Space"),
360 XO(
"The project size exceeds the available free space on the target disk.\n\n"
361 "Please select a different disk with more free space."),
362 "Error:_Disk_full_or_not_writable"
372 std::optional<ProjectFileIO::BackupProject> pBackupProject;
373 if (fromSaveAs && wxFileExists(fileName))
375 pBackupProject.emplace(projectFileIO, fileName);
376 if (!pBackupProject->IsOk())
382 if (wxFileName::GetSize(projectFileIO.GetFileName()) > UINT32_MAX)
385 XO(
"Error Saving Project"),
386 XO(
"The project exceeds the maximum size of 4GB when writing to a FAT32 formatted filesystem."),
387 "Error:_Unsuitable_drive"
398 if (!projectFileIO.HasConnection()) {
401 XO(
"Error Saving Project"),
403 "Error:_Disk_full_or_not_writable",
409 proj.SetProjectName(wxFileName(fileName).GetName());
410 projectFileIO.SetProjectTitle();
428 pBackupProject->Discard();
440 auto oldFileName = projectFileIO.GetFileName();
442 bool bOwnsNewName = !projectFileIO.IsTemporary() && (oldFileName == newFileName);
446 if( !bOwnsNewName && wxFileExists(newFileName)) {
449 XO(
"The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."),
450 XO(
"Error Saving Project"),
456 auto success =
DoSave(newFileName, !bOwnsNewName);
457 if (success && addToHistory) {
473 if (projectFileIO.IsTemporary()) {
474 filename.SetPath(defaultSavePath);
475 filename.SetName(
project.GetProjectName());
478 filename = projectFileIO.GetFileName();
483 filename.SetPath(defaultSavePath);
489'Save Project' is for an Audacity project, not an audio file.\n\
490For an audio file that will open in other apps, use 'Export'.\n");
496 bool bPrompt = (
project.mBatchMode == 0) || (projectFileIO.GetFileName().empty());
504 fName =
SelectFile(FileNames::Operation::Save,
507 filename.GetFullName(),
510 wxFD_SAVE | wxRESIZE_BORDER,
519 filename.SetExt(
wxT(
"aup3"));
521 if ((!bPrompt || !allowOverwrite) && filename.FileExists()) {
525 XO(
"The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name."),
526 XO(
"Error Saving Project"),
532 fName = filename.GetFullPath();
534 bOwnsNewName = !projectFileIO.IsTemporary() && ( projectFileIO.GetFileName() == fName );
538 if (!bOwnsNewName && filename.FileExists()) {
545 int mayOverwrite = ( projectFileIO.GetFileName() == fName ) ? 2 : 1;
548 if (openProjectName.SameAs(fName)) {
550 if (mayOverwrite == 0)
555 if (mayOverwrite > 0) {
559 Do you want to overwrite the project:\n\"%s\"?\n\n\
560 If you select \"Yes\" the project\n\"%s\"\n\
561 will be irreversibly overwritten.").Format( fName, fName );
567 XO(
"Overwrite Project Warning"),
568 wxYES_NO | wxNO_DEFAULT | wxICON_WARNING,
570 if (result == wxNO) {
573 if (result == wxCANCEL) {
581 XO(
"The project was not saved because the selected project is open in another window.\nPlease try again and select an original name."),
582 XO(
"Error Saving Project"),
593 auto success =
DoSave(fName, !bOwnsNewName);
607 wxFileName filename = fileName;
610 if (fileName.empty())
612 if (projectFileIO.IsTemporary())
614 filename.SetPath(defaultSavePath);
618 filename = projectFileIO.GetFileName();
625 filename.SetPath(defaultSavePath);
629 XO(
"%sSave Copy of Project \"%s\" As...")
632 bool bPrompt = (
project.mBatchMode == 0) || (projectFileIO.GetFileName().empty());
644 fName =
SelectFile(FileNames::Operation::Export,
647 filename.GetFullName(),
650 wxFD_SAVE | wxRESIZE_BORDER,
661 filename.SetExt(
wxT(
"aup3"));
673 if (filename.FileExists())
677 XO(
"Saving a copy must not overwrite an existing saved project.\nPlease try again and select an original name."),
678 XO(
"Error Saving Copy of Project"),
679 wxOK | wxICON_ERROR);
690 wxULongLong fileSize = wxFileName::GetSize(projectFileIO.GetFileName());
692 wxDiskspaceSize_t freeSpace;
695 if (freeSpace.GetValue() <= fileSize.GetValue())
698 XO(
"Insufficient Disk Space"),
699 XO(
"The project size exceeds the available free space on the target disk.\n\n"
700 "Please select a different disk with more free space."),
701 "Error:_Unsuitable_drive"
710 if (fileSize > UINT32_MAX)
713 XO(
"Error Saving Project"),
714 XO(
"The project exceeds the maximum size of 4GB when writing to a FAT32 formatted filesystem."),
715 "Error:_Unsuitable_drive"
727 fName = filename.GetFullPath();
731 if (!projectFileIO.SaveCopy(fName))
735 nullptr, msg,
XO(
"Error Saving Project"), wxOK | wxICON_ERROR);
753 wxString sNewFileName = fnFile.GetFullPath();
758 if (!projectFileIO.IsModified()) {
759 sOldFilename = projectFileIO.GetFileName();
765 if (wxFileExists(sNewFileName)) {
769 auto success =
DoSave(sNewFileName,
true);
794 if ( !projectFileIO.WasCompacted() &&
812 return projectFileIO.OpenProject();
836 projectFileIO.CloseProject();
858 wxArrayString selected;
861 XO(
"Select one or more files"),
865 wxFD_OPEN | wxFD_MULTIPLE | wxRESIZE_BORDER);
873 const auto &saveType = fileTypes[ index ];
878 if (dialogResult == wxID_OK) {
892 const wxFileName newProjPathName(projPathName);
894 iter = std::find_if( start, finish,
898 if (iter != finish) {
900 XO(
"%s is already open in another window.")
901 .Format( newProjPathName.GetName() );
902 wxLogError(errMsg.Translation());
905 XO(
"Error Opening Project"),
913 const FilePath &fileNameArg,
bool addtohistory)
933 if (fileName.Lower().EndsWith(
wxT(
".aup3.bak")))
937"You are trying to open an automatically created backup file.\nDoing this may result in severe data loss.\n\nPlease open the actual Audacity project file instead."),
938 XO(
"Warning - Backup File Detected"),
944 if (!::wxFileExists(fileName)) {
946 XO(
"Could not open file: %s").
Format( fileName ),
947 XO(
"Error Opening File"),
955 wxFFile ff(fileName,
wxT(
"rb"));
957 auto cleanup =
finally([&]
965 if (!ff.IsOpened()) {
967 XO(
"Could not open file: %s").
Format( fileName ),
968 XO(
"Error opening file"),
975 auto numRead = ff.Read(buf, 6);
978 XO(
"File may be invalid or corrupted: \n%s").
Format( fileName ),
979 XO(
"Error Opening File or Project"),
985 if (wxStrncmp(buf,
"SQLite", 6) != 0)
988#ifdef EXPERIMENTAL_DRAG_DROP_PLUG_INS
999 auto &
project = chooser(
false);
1007 auto &
project = chooser(
false);
1012 if (!fileName.AfterLast(
'.').IsSameAs(
wxT(
"lof"),
false))
1023 XO(
"Project resides on FAT formatted drive.\n"
1024 "Copy it to another drive to open it.")))
1029 auto &
project = chooser(
true);
1034 const FilePath &fileName,
bool addtohistory)
1044 const bool bParseSuccess = results.parseSuccess;
1045 const auto &errorStr = results.errorString;
1046 const bool err = results.trackError;
1048 if (bParseSuccess && !err) {
1051 window.mbInitializingScrollbar =
true;
1055 selectionManager.AS_SetSelectionFormat(formats.GetSelectionFormat());
1056 selectionManager.TT_SetAudioTimeFormat(formats.GetAudioTimeFormat());
1057 selectionManager.SSBL_SetFrequencySelectionFormatName(
1058 formats.GetFrequencySelectionFormatName());
1059 selectionManager.SSBL_SetBandwidthSelectionFormatName(
1060 formats.GetBandwidthSelectionFormatName());
1064 window.HandleResize();
1065 trackPanel.Refresh(
false);
1069 trackPanel.Update();
1077 if (bParseSuccess && !err) {
1078 if (projectFileIO.IsRecovered())
1081 history.PushState(
XO(
"Project was recovered"),
XO(
"Recover"));
1097 pTrack->CloseLock();
1101 wxLogError(
wxT(
"Could not parse file \"%s\". \nError: %s"), fileName, errorStr.Debug());
1104 XO(
"Error Opening Project"),
1121 std::vector<Track*> results;
1125 wxFileName
fn(fileName);
1127 bool initiallyEmpty =
tracks.empty();
1129 wxString trackNameBase =
fn.GetName();
1135 const bool projectHasSolo =
1137 if (projectHasSolo) {
1138 for (
auto &group : newTracks)
1139 for (
const auto pTrack : group->Any<
WaveTrack>())
1140 pTrack->SetMute(
true);
1144 for (
auto &group : newTracks) {
1145 if (group->empty()) {
1149 for (
const auto pTrack : group->Any<
WaveTrack>())
1150 results.push_back(pTrack);
1151 tracks.Append(std::move(*group));
1159 const bool useSuffix = results.size() > 1;
1161 for (
const auto &newTrack : results) {
1163 newTrack->SetSelected(
true);
1166 newTrack->SetName(
XC(
"%s %d",
"clip name template")
1167 .
Format(trackNameBase, i + 1).Translation());
1169 newTrack->SetName(trackNameBase);
1171 newTrack->TypeSwitch([&](
WaveTrack &wt) {
1174 const auto trackName = wt.
GetName();
1175 for(
const auto& interval : wt.
Intervals())
1176 interval->SetName(trackName);
1180 history.PushState(
XO(
"Imported '%s'").
Format( fileName ),
1183#if defined(__WXGTK__)
1189 wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT);
1194 if (initiallyEmpty && projectFileIO.IsTemporary()) {
1196 project.SetInitialImportPath(
fn.GetPath());
1197 projectFileIO.SetProjectTitle();
1211 if (!projectFileIO.LoadProject(fileName,
false))
1215 for (
const Track *pTrack : srcTracks)
1216 pTrack->PasteInto(dest, destTracks);
1236 mImportFileHandle = &importFileHandle;
1242 if (ImportDlg.ShowModal() == wxID_CANCEL)
1253 constexpr double ProgressSteps { 1000.0 };
1254 if(!mProgressDialog)
1256 wxFileName ff( mImportFileHandle->GetFilename() );
1257 auto title =
XO(
"Importing %s").Format( mImportFileHandle->GetFileDescription() );
1260 auto result = mProgressDialog->Poll(progress * ProgressSteps, ProgressSteps);
1262 mImportFileHandle->Cancel();
1264 mImportFileHandle->Stop();
1269 mProgressDialog.reset();
1270 if(result == ImportResult::Error)
1272 auto message = mImportFileHandle->GetErrorMessage();
1273 if(!message.empty())
1302#ifdef EXPERIMENTAL_IMPORT_AUP3
1304 if (fileName.AfterLast(
'.').IsSameAs(
wxT(
"aup3"),
false)) {
1310 if (initiallyEmpty && projectFileIO.IsTemporary()) {
1311 wxFileName
fn(fileName);
1313 project.SetInitialImportPath(
fn.GetPath());
1314 projectFileIO.SetProjectTitle();
1317 history.PushState(
XO(
"Imported '%s'").
Format(fileName),
XO(
"Import"));
1324 errorMessage = projectFileIO.GetLastError();
1325 if (errorMessage.
empty()) {
1326 errorMessage =
XO(
"Failed to import project");
1331 XO(
"Error Importing"),
1332 errorMessage,
wxT(
"Importing_Audio"));
1341 bool committed =
false;
1342 auto cleanup =
finally([&]{
1346 auto newTags = oldTags->Duplicate();
1349#ifndef EXPERIMENTAL_IMPORT_AUP3
1351 if (fileName.AfterLast(
'.').IsSameAs(
wxT(
"aup3"),
false)) {
1353 XO(
"Error Importing"),
1354 XO(
"Cannot import AUP3 format. Use File > Open instead"),
1359 ImportProgress importProgress(
project);
1366 if (!errorMessage.
empty()) {
1370 XO(
"Error Importing"), errorMessage,
wxT(
"Importing_Audio"));
1385 if (fileName.AfterLast(
'.').IsSameAs(
wxT(
"lof"),
false)) {
1395 if (fileName.AfterLast(
'.').IsSameAs(
wxT(
"aup"),
false)) {
1398 if (initiallyEmpty && projectFileIO.IsTemporary()) {
1399 wxFileName
fn(fileName);
1401 project.SetInitialImportPath(
fn.GetPath());
1402 projectFileIO.SetProjectTitle();
1407 history.PushState(
XO(
"Imported '%s'").
Format( fileName ),
XO(
"Import"));
1432 S.StartVerticalLay(
true);
1434 S.AddFixedText(text,
false, 500);
1440 FindWindowById(wxID_YES,
this)->Bind(wxEVT_BUTTON, &CompactDialog::OnYes,
this);
1441 FindWindowById(wxID_NO,
this)->Bind(wxEVT_BUTTON, &CompactDialog::OnNo,
this);
1442 FindWindowById(wxID_HELP,
this)->Bind(wxEVT_BUTTON, &CompactDialog::OnGetURL,
this);
1449 void OnYes(wxCommandEvent &WXUNUSED(evt))
1454 void OnNo(wxCommandEvent &WXUNUSED(evt))
1472 bool isBatch =
project.mBatchMode > 0;
1475 projectFileIO.ReopenProject();
1477 auto savedState = undoManager.GetSavedState();
1478 const auto currentState = undoManager.GetCurrentState();
1479 if (savedState < 0) {
1480 undoManager.StateSaved();
1481 savedState = undoManager.GetSavedState();
1482 if (savedState < 0) {
1487 const auto least = std::min<size_t>(savedState, currentState);
1488 const auto greatest = std::max<size_t>(savedState, currentState);
1489 std::vector<const TrackList*> trackLists;
1492 trackLists.push_back(pTracks);
1494 undoManager.VisitStates(
fn, least, 1 + least);
1495 if (least != greatest)
1496 undoManager.VisitStates(
fn, greatest, 1 + greatest);
1498 int64_t total = projectFileIO.GetTotalUsage();
1499 int64_t used = projectFileIO.GetCurrentUsage(trackLists);
1501 auto before = wxFileName::GetSize(projectFileIO.GetFileName());
1504 XO(
"Compacting this project will free up disk space by removing unused bytes within the file.\n\n"
1505 "There is %s of free disk space and this project is currently using %s.\n"
1507 "If you proceed, the current Undo/Redo History and clipboard contents will be discarded "
1508 "and you will recover approximately %s of disk space.\n"
1510 "Do you want to continue?")
1514 if (isBatch || dlg.ShowModal() == wxYES)
1517 undoManager.RemoveStates(1 + greatest, undoManager.GetNumStates());
1520 if (least < greatest)
1521 undoManager.RemoveStates(least + 1, greatest);
1524 undoManager.RemoveStates(0, least);
1527 if (&
mProject == clipboard.Project().lock().get())
1532 auto before = wxFileName::GetSize(projectFileIO.GetFileName());
1534 projectFileIO.Compact(trackLists,
true);
1536 auto after = wxFileName::GetSize(projectFileIO.GetFileName());
1541 XO(
"Compacting actually freed %s of disk space.")
1543 XO(
"Compact Project"));
1546 undoManager.RenameState( undoManager.GetCurrentState(),
1547 XO(
"Compacted project file"),
1557 bShowProjectNumbers ? pProject->GetProjectNumber() : -1 );
1565 if( window.IsIconized() )
1576 return ptr->GetProjectName().empty();
1581 _(
"[Project %02i] "),
project.GetProjectNumber() + 1 );
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Toolkit-neutral facade for basic user interface services.
Declare functions to perform UTF-8 to std::wstring conversions.
bool DoImportMIDI(AudacityProject &project, const FilePath &fileName)
The interface that all file import "plugins" (if you want to call them that) must implement....
std::vector< std::shared_ptr< TrackList > > TrackHolders
std::unique_ptr< const BasicUI::WindowPlacement > ProjectFramePlacement(AudacityProject *project)
Make a WindowPlacement object suitable for project (which may be null)
static const AudacityProject::AttachedObjects::RegisteredFactory sFileManagerKey
static void RefreshAllTitles(bool bShowProjectNumbers)
an object holding per-project preferred sample rate
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 ...
accessors for certain important windows associated with each project
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
static Settings & settings()
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
int ShowWarningDialog(wxWindow *parent, const wxString &internalDialogName, const TranslatableString &message, bool showCancelButton, const TranslatableString &footer)
const_iterator end() const
Container::value_type value_type
const_iterator begin() const
Wrap wxMessageDialog so that caption IS translatable.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
virtual int GetFilterIndex() const
virtual wxString GetPath() const
virtual void GetPaths(wxArrayString &paths) const
virtual void SetFilterIndex(int filterIndex)
static TranslatableString WriteFailureMessage(const wxFileName &fileName)
void Append(const FilePath &file)
static FileHistory & Global()
FILES_API const FileType AudacityProjects
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Base class for FlacImportFileHandle, LOFImportFileHandle, MP3ImportFileHandle, OggImportFileHandle an...
virtual wxInt32 GetStreamCount()=0
virtual void SetStreamUsage(wxInt32 StreamID, bool Use)=0
Interface used to report on import state and progress.
bool Import(AudacityProject &project, const FilePath &fName, ImportProgressListener *importProgressListener, WaveTrackFactory *trackFactory, TrackHolders &tracks, Tags *tags, TranslatableString &errorMessage)
static void SetLastOpenType(const FileNames::FileType &type)
FileNames::FileTypes GetFileTypes(const FileNames::FileType &extraType={})
static size_t SelectDefaultOpenType(const FileNames::FileTypes &fileTypes)
static void SetDefaultOpenType(const FileNames::FileType &type)
static TranslatableString FormatSize(wxLongLong size)
Convert a number to a string while formatting it in bytes, KB, MB, GB.
Makes a temporary project that doesn't display on the screen.
AudacityProject & Project()
AudioTrack subclass that can also be audibly replayed by the program.
static PluginManager & Get()
void SetProjectTitle(int number=-1)
static ProjectFileIO & Get(AudacityProject &project)
const FilePath & GetFileName() const
std::shared_ptr< TrackList > mLastSavedTracks
static bool IsAlreadyOpen(const FilePath &projPathName)
AudacityProject & mProject
void CompactProjectOnClose()
bool Import(const FilePath &fileName, bool addToHistory=true)
bool SaveCopy(const FilePath &fileName=wxT(""))
bool SaveAs(bool allowOverwrite=false)
static void DiscardAutosave(const FilePath &filename)
void AddImportedTracks(const FilePath &fileName, TrackHolders &&newTracks)
static wxArrayString ShowOpenDialog(FileNames::Operation op, const FileNames::FileType &extraType={})
Show an open dialogue for opening audio files, and possibly other sorts of files.
bool DoSave(const FilePath &fileName, bool fromSaveAs)
bool SaveFromTimerRecording(wxFileName fnFile)
static AudacityProject * OpenFile(const ProjectChooserFn &chooser, const FilePath &fileName, bool addtohistory=true)
ReadProjectResults ReadProjectFile(const FilePath &fileName, bool discardAutosave=false)
std::function< AudacityProject &(bool)> ProjectChooserFn
A function that returns a project to use for opening a file; argument is true if opening a project fi...
static ProjectFileManager & Get(AudacityProject &project)
ProjectFileManager(AudacityProject &project)
AudacityProject * OpenProjectFile(const FilePath &fileName, bool addtohistory)
static ProjectHistory & Get(AudacityProject &project)
static ProjectSelectionManager & Get(AudacityProject &project)
static ProjectSettings & Get(AudacityProject &project)
static ProjectStatus & Get(AudacityProject &project)
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
void ZoomAfterImport(Track *pTrack)
static ProjectWindow & Get(AudacityProject &project)
static RealtimeEffectList & Get(AudacityProject &project)
void Clear()
Use only in the main thread. Sends Remove messages.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
TitleRestorer(wxTopLevelWindow &window, AudacityProject &project)
Abstract base class for an object holding data associated with points on a time axis.
const wxString & GetName() const
Name is always the same for all channels of a group.
static TrackListHolder Create(AudacityProject *pOwner)
static TrackList * FindUndoTracks(const UndoStackElem &state)
static TrackList & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
Identifier MSGID() const
MSGID is the English lookup key in the catalog, not necessarily for user's eyes if locale is some oth...
static UndoManager & Get(AudacityProject &project)
bool UnsavedChanges() const
An error dialog about unwritable location, that allows to navigate to settings quickly.
static WaveTrackFactory & Get(AudacityProject &project)
A Track that contains audio waveform data.
double GetRate() const override
void OnYes(wxCommandEvent &WXUNUSED(evt))
void OnGetURL(wxCommandEvent &WXUNUSED(evt))
CompactDialog(TranslatableString text)
void OnNo(wxCommandEvent &WXUNUSED(evt))
void OnImportResult(ImportResult result) override
Used to report on import result for file handle passed as argument to OnImportFileOpened.
ImportProgress(AudacityProject &project)
void OnImportProgress(double progress) override
bool OnImportFileOpened(ImportFileHandle &importFileHandle) override
wxWeakRef< AudacityProject > mProject
std::unique_ptr< BasicUI::ProgressDialog > mProgressDialog
void ShowErrorDialog(const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
Show an error dialog with a link to the manual for further help.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
std::unique_ptr< ProgressDialog > MakeProgress(const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={})
Create and display a progress dialog.
FILES_API bool IsMidi(const FilePath &fName)
FILES_API bool IsOnFATFileSystem(const FilePath &path)
FILES_API bool IsPathAvailable(const FilePath &Path)
FILES_API wxString AbbreviatePath(const wxFileName &fileName)
Give enough of the path to identify the device. (On Windows, drive letter plus ':')
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
FILES_API FilePath FindDefaultPath(Operation op)
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
void SelectNone(AudacityProject &project)
FILES_API bool FATFilesystemDenied(const FilePath &path, const TranslatableString &msg, const BasicUI::WindowPlacement &placement={})
FILES_API wxString UnsavedProjectFileName()
bool ImportProject(AudacityProject &dest, const FilePath &fileName)
std::pair< const char *, const char * > Pair
const Pair helpURLTable[]
wxString FindHelpUrl(const TranslatableString &libraryError)
const char *const defaultHelpUrl
TranslatableString Message(unsigned trackCount)
Options for variations of error dialogs; the default is for modal dialogs.
Holds one item with description and time range for the UndoManager.