MCPcopy Create free account
hub / github.com/audacity/audacity / WithCancellableProgress

Method WithCancellableProgress

libraries/lib-exceptions/UserException.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20void UserException::WithCancellableProgress(
21 std::function<void(const ProgressReporter&)> action,
22 TranslatableString title, TranslatableString message)
23{
24 using namespace BasicUI;
25 auto progress =
26 MakeProgress(std::move(title), std::move(message), ProgressShowCancel);
27 const auto reportProgress = [&](double progressFraction) {
28 const auto result = progress->Poll(progressFraction * 1000, 1000);
29 if (result != ProgressResult::Success)
30 throw UserException {};
31 };
32 action(reportProgress);
33}

Callers

nothing calls this directly

Calls 3

moveFunction · 0.85
MakeProgressFunction · 0.50
PollMethod · 0.45

Tested by

no test coverage detected