Audacity 3.2.0
Functions
ExportProgressUI Namespace Reference

Functions

IMPORT_EXPORT_API ExportResult Show (ExportTask exportTask)
 
template<typename Callable >
void ExceptionWrappedCall (Callable callable)
 

Function Documentation

◆ ExceptionWrappedCall()

template<typename Callable >
void ExportProgressUI::ExceptionWrappedCall ( Callable  callable)

Definition at line 29 of file ExportProgressUI.h.

30{
31 try
32 {
33 callable();
34 }
35 catch (ExportDiskFullError& e)
36 {
38 }
39 catch (ExportErrorException& e)
40 {
42 e.GetMessage(), XO("Warning"), e.GetHelpPageId(), true);
43 }
44 catch (ExportException& e)
45 {
47 }
48 catch (...)
49 {
50 BasicUI::ShowMessageBox(XO("Export error"));
51 }
52}
void ShowDiskFullExportErrorDialog(const wxFileNameWrapper &fileName)
Definition: Export.cpp:135
void ShowExportErrorDialog(const TranslatableString &message, const TranslatableString &caption, bool allowReporting)
Definition: Export.cpp:144
XO("Cut/Copy/Paste")
const wxFileNameWrapper & GetFileName() const noexcept
const TranslatableString & GetMessage() const noexcept
const wxString & GetHelpPageId() const noexcept
const wxString & What() const noexcept
Holds a msgid for the translation catalog; may also bind format arguments.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:287

References ExportDiskFullError::GetFileName(), ShowDiskFullExportErrorDialog(), ShowExportErrorDialog(), BasicUI::ShowMessageBox(), and XO().

Referenced by ExportCommand::Apply(), anonymous_namespace{FileMenus.cpp}::DoExport(), TimerRecordDialog::ExecutePostRecordActions(), audacity::cloud::audiocom::ShareAudioDialog::ExportProject(), ExportAudioDialog::OnExport(), and Show().

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

◆ Show()

ExportResult ExportProgressUI::Show ( ExportTask  exportTask)

Definition at line 80 of file ExportProgressUI.cpp.

81{
82 assert(exportTask.valid());
83
84 auto f = exportTask.get_future();
85 DialogExportProgressDelegate delegate;
86 std::thread(std::move(exportTask), std::ref(delegate)).detach();
87 auto result = ExportResult::Error;
88 while(f.wait_for(std::chrono::milliseconds(50)) != std::future_status::ready)
89 delegate.UpdateUI();
90
91 ExceptionWrappedCall([&] { result = f.get(); });
92
93 if(result == ExportResult::Error)
94 {
96 {}, XO("Export error"),
97 XO("Export completed with error."), {},
99 }
100
101 return result;
102}
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.
Definition: BasicUI.h:272
void ExceptionWrappedCall(Callable callable)
Options for variations of error dialogs; the default is for modal dialogs.
Definition: BasicUI.h:52

References Error, ExceptionWrappedCall(), BasicUI::ModalError, BasicUI::ShowErrorDialog(), and XO().

Referenced by ExportCommand::Apply(), ApplyMacroDialog::ApplyMacroToProject(), anonymous_namespace{FileMenus.cpp}::DoExport(), TimerRecordDialog::ExecutePostRecordActions(), ToolBar::Expose(), ApplyMacroDialog::OnApplyToFiles(), NyqBench::OnClose(), ContrastDialog::OnClose(), ExportAudioDialog::OnExport(), AudacityApp::OnMenuAbout(), WhatsNewDialog::OnOK(), anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::OnSave(), ProgressDialog::Reinit(), PitchAndSpeedDialog::SetFocus(), PitchAndSpeedDialog::Show(), AudacityTextEntryDialog::Show(), ExportAudioDialog::Show(), FrequencyPlotDialog::Show(), HistoryDialog::Show(), LabelDialog::Show(), audacity::cloud::audiocom::sync::AudioComDialogBase::ShowDialog(), NyqBench::ShowNyqBench(), and ProgressDialog::~ProgressDialog().

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