Audacity 3.2.0
|
Classes | |
struct | ErrorDialogOptions |
Options for variations of error dialogs; the default is for modal dialogs. More... | |
class | GenericProgressDialog |
Abstraction of a progress dialog with undefined time-to-completion estimate. More... | |
struct | MessageBoxOptions |
struct | Point |
A pair of screen coordinates, x increasing rightward, y downward. More... | |
class | ProgressDialog |
Abstraction of a progress dialog with well defined time-to-completion estimate. More... | |
class | Services |
Abstract class defines a few user interface services, not mentioning particular toolkits. More... | |
class | WindowPlacement |
Subclasses may hold information such as a parent window pointer for a dialog. More... | |
Functions | |
Services * | Get () |
Fetch the global instance, or nullptr if none is yet installed. More... | |
Services * | Install (Services *pInstance) |
Install an implementation; return the previously installed instance. More... | |
Functions that invoke global Services | |
These dispatch to the global Services, if supplied. If none was supplied, they are mostly no-ops, with exceptions as noted. All should be called on the main thread only, except as noted. | |
void | CallAfter (Action action) |
Schedule an action to be done later, and in the main thread. More... | |
void | Yield () |
Dispatch waiting events, including actions enqueued by CallAfter. More... | |
bool | OpenInDefaultBrowser (const wxString &url) |
Open an URL in default browser. More... | |
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. More... | |
MessageBoxResult | ShowMessageBox (const TranslatableString &message, MessageBoxOptions options={}) |
Show a modal message box with either Ok or Yes and No, and optionally Cancel. More... | |
std::unique_ptr< ProgressDialog > | MakeProgress (const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={}) |
Create and display a progress dialog. More... | |
std::unique_ptr< GenericProgressDialog > | MakeGenericProgress (const WindowPlacement &placement, const TranslatableString &title, const TranslatableString &message) |
Create and display a progress dialog (return nullptr if Services not installed) More... | |
template<typename ItType , typename FnType > | |
void | SplitProgress (ItType first, ItType last, FnType action, ProgressReporter parent) |
Helper for the update of a task's progress bar when this task is made of a range's subtasks. More... | |
int | ShowMultiDialog (const TranslatableString &message, const TranslatableString &title, const TranslatableStrings &buttons, const ManualPageID &helpPage, const TranslatableString &boxMsg, bool log) |
Display a dialog with radio buttons. More... | |
std::unique_ptr< WindowPlacement > | FindFocus () |
Find the window that is accepting keyboard input, if any. More... | |
void | SetFocus (const WindowPlacement &focus) |
Set the window that accepts keyboard input. More... | |
bool | IsUsingRtlLayout () |
Whether using a right-to-left language layout. More... | |
Variables | |
static Services * | theInstance = nullptr |
static std::recursive_mutex | sActionsMutex |
static std::vector< Action > | sActions |
Types used in the Services interface | |
enum class | ErrorDialogType { ModelessError , ModalError , ModalErrorReport } |
enum class | Icon { None , Warning , Error , Question , Information } |
enum class | Button { Default , Ok , YesNo } |
enum class | MessageBoxResult : int { None , Yes , No , Ok , Cancel } |
enum | ProgressDialogOptions : unsigned { ProgressShowStop = (1 << 0) , ProgressShowCancel = (1 << 1) , ProgressHideTime = (1 << 2) , ProgressConfirmStopOrCancel = (1 << 3) } |
enum class | ProgressResult : unsigned { Cancelled = 0 , Success , Failed , Stopped } |
using | Action = std::function< void()> |
using | ProgressReporter = std::function< void(double)> |
TranslatableString | DefaultCaption () |
"Message", suitably translated More... | |
using BasicUI::Action = typedef std::function<void()> |
using BasicUI::ProgressReporter = typedef std::function<void(double)> |
|
strong |
Enumerator | |
---|---|
Default | Like Ok, except maybe minor difference of dialog position. |
Ok | One button. |
YesNo | Two buttons. |
Definition at line 88 of file BasicUI.h.
|
strong |
Enumerator | |
---|---|
ModelessError | |
ModalError | |
ModalErrorReport | If error reporting is enabled, may give option to send; if not, then like ModalError |
Definition at line 43 of file BasicUI.h.
|
strong |
|
strong |
enum BasicUI::ProgressDialogOptions : unsigned |
Enumerator | |
---|---|
ProgressShowStop | |
ProgressShowCancel | |
ProgressHideTime | |
ProgressConfirmStopOrCancel |
Definition at line 140 of file BasicUI.h.
|
strong |
Enumerator | |
---|---|
Cancelled | |
Success | |
Failed | |
Stopped |
Definition at line 147 of file BasicUI.h.
BASIC_UI_API void BasicUI::CallAfter | ( | Action | action | ) |
Schedule an action to be done later, and in the main thread.
This function may be called in other threads than the main. If no Services are yet installed, the action is not lost, but may be dispatched by Yield(). The action may itself invoke CallAfter to enqueue other actions.
Definition at line 208 of file BasicUI.cpp.
References Get(), sActions, and sActionsMutex.
Referenced by AdornedRulerPanel::AdornedRulerPanel(), Clipboard::Assign(), PrefsListener::Broadcast(), AudioIO::CallAfterRecording(), Clipboard::Clear(), cloud::audiocom::UserService::ClearUserData(), cloud::audiocom::OAuthService::DoAuthorise(), ClipPitchAndSpeedButtonHandle::DoRelease(), cloud::audiocom::UserService::DownloadAvatar(), AudacityException::EnqueueAction(), UndoManager::EnqueueMessage(), Journal::Events::FailedEventSerialization(), AsyncPluginValidator::Impl::HandleInternalError(), Viewport::HandleResize(), AsyncPluginValidator::Impl::HandleResult(), ProjectFileManager::Import(), AudacityApp::InitPart2(), NotifyingSelectedRegion::Notify(), AudioSetupToolBar::OnAudioDeviceRescan(), TrackPanel::OnAudioIO(), AudacityApp::OnExceptionInMainLoop(), App::OnInit(), AudacityApp::OnInit(), AudacityApp::OnInit0(), AdornedRulerPanel::OnLeave(), TrackPanel::OnMouseEvent(), IncompatiblePluginsDialog::OnPluginManagerClicked(), anonymous_namespace{SnappingToolBar.cpp}::SnapModePopup::OnPopup(), ErrorReportDialog::OnSend(), SelectionBar::Populate(), TimeToolBar::Populate(), CLExportProcessor::Process(), TrackList::QueueEvent(), Viewport::Redraw(), AdornedRulerPanel::Refresh(), TrackPanel::Refresh(), cloud::audiocom::OAuthService::SafePublish(), ProjectFileIO::SaveProject(), TrackFocus::SetFocus(), ProjectFileIO::SetProjectTitle(), AudioIO::StopStream(), and cloud::audiocom::UserService::UpdateUserData().
BASIC_UI_API TranslatableString BasicUI::DefaultCaption | ( | ) |
"Message", suitably translated
Definition at line 253 of file BasicUI.cpp.
References XO().
Referenced by MessageBoxException::DelayedHandlerAction().
|
inline |
Find the window that is accepting keyboard input, if any.
result: result != nullptr
(but may point to an empty WindowPlacement) Definition at line 373 of file BasicUI.h.
References Get().
Referenced by TagsEditorDialog::DoCancel(), EffectUI::DoEffect(), wxWidgetsBasicUI::DoFindFocus(), anonymous_namespace{TrackPanel.cpp}::LabeledChannelGroup::Draw(), EffectPreview(), DeviceToolBar::EnableDisableButtons(), TrackPanelAx::EndChangeFocus(), EventMonitor::FilterEvent(), MenuCreator::FilterKeyEvent(), EventMonitor::HandleCapture(), ProgressDialog::Init(), ProjectWindow::MacShowUndockedToolbars(), TrackPanelAx::MessageForScreenReader(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), NyqBench::OnAutoWrap(), DeviceToolBar::OnCaptureKey(), SelectionBar::OnCaptureKey(), TranscriptionToolBar::OnCaptureKey(), RealtimeEffectPanel::OnCharHook(), NyqBench::OnClear(), NyqBench::OnClearUpdate(), NyqBench::OnCopy(), NyqBench::OnCopyUpdate(), NyqBench::OnCut(), NyqBench::OnCutUpdate(), KeyView::OnDrawBackground(), KeyView::OnDrawItem(), RealtimeEffectListWindow::OnEffectListItemChange(), ToolBarResizer::OnEnter(), NyqBench::OnFind(), NyqBench::OnFont(), EffectUIHost::OnInitDialog(), NavigationActions::Handler::OnNextWindow(), NyqBench::OnOutputUpdate(), NumericTextCtrl::OnPaint(), NyqBench::OnPaste(), NyqBench::OnPasteUpdate(), NavigationActions::Handler::OnPrevWindow(), NyqBench::OnRedo(), NyqBench::OnRedoUpdate(), LabelDialog::OnRemove(), NyqBench::OnScriptUpdate(), NyqBench::OnSelectAll(), NyqBench::OnUndo(), NyqBench::OnUndoUpdate(), SelectionBar::OnUpdate(), MenuCreator::RebuildMenuBar(), FrequencyPlotDialog::Recalc(), RealtimeEffectListWindow::ReloadEffectsList(), LabelTrackView::ShowContextMenu(), TrackPanelHasFocus(), HistoryDialog::UpdateLevels(), and wxTabTraversalWrapperCharHook().
BASIC_UI_API Services * BasicUI::Get | ( | ) |
Fetch the global instance, or nullptr if none is yet installed.
Definition at line 196 of file BasicUI.cpp.
References theInstance.
Referenced by audacity::sentry::AddExceptionContext(), audacity::sentry::anonymous_namespace{SentryReport.cpp}::AddOSContext(), CallAfter(), WaveTrack::ConvertToSampleFormat(), audacity::network_manager::CurlHandleManager::CurlHandleManager(), WaveChannelView::DoGetMultiView(), PlayableTrack::DoGetMute(), WaveChannelView::DoGetPlacements(), PlayableTrack::DoGetSolo(), WaveTrack::DoSetGain(), PlayableTrack::DoSetMute(), WaveTrack::DoSetPan(), WaveTrack::DoSetRate(), PlayableTrack::DoSetSolo(), WaveTrack::EmptyCopy(), FindFocus(), VST3EffectsModule::FindModulePaths(), FindProjectFrame(), UndoManager::Get(), anonymous_namespace{ProjectWindows.cpp}::ProjectWindows::Get(), anonymous_namespace{PlayableTrack.cpp}::MuteAndSolo::Get(), anonymous_namespace{WaveChannelView.cpp}::PlacementArray::Get(), GetAttachedWindows(), PlatformCompatibility::GetExecutablePath(), WaveTrack::GetGain(), Languages::GetLanguages(), WaveTrack::GetPan(), GetProjectFrame(), GetProjectPanel(), WaveTrack::GetRate(), WaveTrack::GetSampleFormat(), UpdateManager::GetUpdates(), anonymous_namespace{FileNames.cpp}::GetUserTargetDir(), WaveTrack::GetWaveColorIndex(), WaveTrack::HandleXMLTag(), UpdateDataParser::HandleXMLTag(), anonymous_namespace{AudacityApp.cpp}::InitCrashreports(), IsUsingRtlLayout(), WaveTrack::LinkConsistencyFix(), MakeGenericProgress(), EffectSettingsAccess::ModifySettings(), WaveTrack::MoveTo(), WaveTrack::NewestOrNewClip(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnChangePitchAndSpeed(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnEditClipName(), Grid::OnKeyDown(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnRenderClipStretching(), OpenInDefaultBrowser(), ClipPitchAndSpeedButtonHandle::Preview(), NyquistEffect::Process(), PreferencesResetHandler::Register(), RemoveDependencies(), ResetPreferences(), WaveTrack::RightmostOrNewClip(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::SelectedIntervalOfFocusedTrack(), audacity::sentry::anonymous_namespace{SentryReport.cpp}::SerializeException(), SetFocus(), SetProjectFrame(), SetProjectPanel(), WaveTrack::SetWaveColorIndex(), ShowMultiDialog(), WaveTrack::WaveTrack(), and Yield().
Install an implementation; return the previously installed instance.
Definition at line 198 of file BasicUI.cpp.
References theInstance.
Referenced by AudacityApp::OnInit0().
|
inline |
Whether using a right-to-left language layout.
Definition at line 389 of file BasicUI.h.
References Get().
Referenced by CommandManager::DescribeCommandsAndShortcuts().
|
inline |
Create and display a progress dialog (return nullptr if Services not installed)
This function makes a "generic" progress dialog, for the case when time to completion cannot be estimated, but some indication of progress is still given
Definition at line 310 of file BasicUI.h.
Referenced by DBConnection::Close(), ProjectFileIO::RenameOrWarn(), and ProjectFileIO::SaveProject().
|
inline |
Create and display a progress dialog.
flags | bitwise OR of values in ProgressDialogOptions |
remainingLabelText | if not empty substitutes for "Remaining Time:" |
Definition at line 292 of file BasicUI.h.
Referenced by ProjectFileIO::CopyTo(), EffectBase::DoEffect(), EffectPreview(), UpdateManager::GetUpdates(), MixAndRender(), anonymous_namespace{EditMenus.cpp}::NotificationScope(), SqliteSampleBlockFactory::OnBeginPurge(), anonymous_namespace{ProjectFileManager.cpp}::ImportProgress::OnImportProgress(), anonymous_namespace{TrackMenus.cpp}::OnResample(), anonymous_namespace{ProjectFileManager.cpp}::RunTempoDetection(), anonymous_namespace{ExportProgressUI.cpp}::DialogExportProgressDelegate::UpdateUI(), and WaveTrackUtilities::WithClipRenderingProgress().
BASIC_UI_API bool BasicUI::OpenInDefaultBrowser | ( | const wxString & | url | ) |
Open an URL in default browser.
This function may be called in other threads than the main.
Definition at line 240 of file BasicUI.cpp.
References Get().
Referenced by cloud::audiocom::ShareAudioDialog::HandleUploadSucceeded(), cloud::audiocom::ShareAudioDialog::InitialStatePanel::OnLinkButtonPressed(), OpenInDefaultBrowser(), RealtimeEffectListWindow::PickEffect(), RealtimeEffectListWindow::RealtimeEffectListWindow(), and AudacityFileConfig::Warn().
|
inline |
Set the window that accepts keyboard input.
Definition at line 382 of file BasicUI.h.
References Get().
Referenced by EffectPreview(), NumericTextCtrl::OnContext(), KeyView::OnLeftDown(), NumericTextCtrl::OnMouse(), TrackPanel::OnTrackFocusChange(), wxSliderWrapper::SetFocus(), ListNavigationEnabled< WindowBase >::SetFocus(), AdornedRulerPanel::SetFocusFromKbd(), AButton::SetFocusFromKbd(), ASlider::SetFocusFromKbd(), MeterPanel::SetFocusFromKbd(), and UpdateNoticeDialog::UpdateNoticeDialog().
|
inline |
Show an error dialog with a link to the manual for further help.
placement | how to parent the dialog |
dlogTitle | Text for title bar |
message | The main message text |
helpPage | Identifies manual page (and maybe an anchor) |
Definition at line 262 of file BasicUI.h.
Referenced by MessageBoxException::DelayedHandlerAction(), ProjectAudioManager::DoRecord(), ClipPitchAndSpeedButtonHandle::DoRelease(), ProjectFileManager::DoSave(), EffectPreview(), TempDirectory::FATFilesystemDenied(), UpdateManager::GetUpdates(), cloud::audiocom::ShareAudioDialog::HandleExportFailure(), cloud::audiocom::ShareAudioDialog::HandleUploadFailed(), ProjectFileManager::Import(), ProjectAudioManager::PlayPlayRegion(), ProjectFileIO::ProjectFileIO(), ProjectFileManager::SaveCopy(), PitchAndSpeedDialog::SetClipSpeedFromDialog(), ExportProgressUI::Show(), ShowDiskFullExportErrorDialog(), ProjectFileIO::ShowError(), ShowExportErrorDialog(), AudioIO::StartMonitoring(), CommandManager::TellUserWhyDisallowed(), and TempDirectory::TempDir().
|
inline |
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition at line 277 of file BasicUI.h.
Referenced by AudioIO::AllocateBuffers(), AudioIO::AudioIO(), anonymous_namespace{Registry.cpp}::BadPath(), ExportMP3::CheckFileName(), ConfirmSave(), CreateDirectory(), ThemeBase::CreateImageCache(), ThemeBase::CreateOneImageCache(), MessageBoxException::DelayedHandlerAction(), EffectUI::DoEffect(), DoMessageBox(), PluginManager::DropFile(), ExportProgressUI::ExceptionWrappedCall(), Journal::Events::FailedEventSerialization(), FrequencyPlotDialog::GetAudio(), gtk_filedialog_ok_callback(), VSTWrapper::HandleXMLTag(), ExportOptionsCLEditor::IsValidCommand(), VSTWrapper::LoadFXB(), VSTWrapper::LoadFXP(), MP3Exporter::LoadLibrary(), ThemeBase::LoadOneThemeComponents(), Effect::LoadSettingsFromString(), VSTWrapper::LoadXML(), anonymous_namespace{MIDIPlay.h}::MIDIPlay::MIDIPlay(), RealtimeEffectListWindow::OnAddEffectClicked(), WaveTrackMenuTable::OnMergeStereo(), SelectActions::Handler::OnZeroCrossing(), SFFileCloser::operator()(), ThemeBase::ReadImageCache(), ProjectFileManager::ReadProjectFile(), VSTWrapper::SaveFXB(), VSTWrapper::SaveFXP(), ImportUtils::ShowMessageBox(), AudioIO::StartStream(), MessageBoxTarget::Update(), and Sequence::WriteXML().
|
inline |
Display a dialog with radio buttons.
message | main message in the dialog |
title | dialog title |
buttons | labels for individual radio buttons |
boxMsg | label for the group of buttons |
helpPage | identifies a manual page |
log | whether to add a "Show Log for Details" push button |
Definition at line 357 of file BasicUI.h.
Referenced by wxWidgetsBasicUI::DoMultiDialog(), ProjectFSCK(), and ModuleManager::TryLoadModules().
void BasicUI::SplitProgress | ( | ItType | first, |
ItType | last, | ||
FnType | action, | ||
ProgressReporter | parent | ||
) |
Helper for the update of a task's progress bar when this task is made of a range's subtasks.
For each item from first
till last
, forwards the item as argument to action
, as well as a progress reporter that will contribute by a fraction to the parent progress reporter. This fraction is the inverse of the number of elements in the range.
Definition at line 329 of file BasicUI.h.
Referenced by anonymous_namespace{LabelMenus.cpp}::EditByLabel(), EffectOutputTracks::EffectOutputTracks(), anonymous_namespace{EditMenus.cpp}::OnJoin(), and anonymous_namespace{EditMenus.cpp}::OnSilence().
BASIC_UI_API void BasicUI::Yield | ( | ) |
Dispatch waiting events, including actions enqueued by CallAfter.
This function must be called by the main thread. Actions enqueued by CallAfter before Services were installed will be dispatched in the sequence they were enqueued, unless an exception thrown by one of them stops the dispatching.
Definition at line 219 of file BasicUI.cpp.
References Get(), sActions, and sActionsMutex.
Referenced by Viewport::OnScroll(), CLExportProcessor::Process(), cloud::audiocom::ShareAudioDialog::ResetProgress(), and NyquistEffect::ShowHostInterface().
|
static |
Definition at line 206 of file BasicUI.cpp.
Referenced by CallAfter(), and Yield().
|
static |
Definition at line 205 of file BasicUI.cpp.
Referenced by CallAfter(), and Yield().
|
static |
Definition at line 194 of file BasicUI.cpp.