27 const auto reportProgress = [&](
double progressFraction) {
28 const auto result = progress->Poll(progressFraction * 1000, 1000);
32 action(reportProgress);
Toolkit-neutral facade for basic user interface services.
An AudacityException with no visible message.
Holds a msgid for the translation catalog; may also bind format arguments.
Can be thrown when user cancels operations, as with a progress dialog. Delayed handler does nothing.
~UserException() override
std::function< void(double)> ProgressReporter
static void WithCancellableProgress(std::function< void(const ProgressReporter &)> action, TranslatableString title, TranslatableString message)
A frequently useful convenience wraps a lambda and may throw this type.
void DelayedHandlerAction() override
Action to do in the main thread at idle time of the event loop.
std::unique_ptr< ProgressDialog > MakeProgress(const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={})
Create and display a progress dialog.