Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
PrefsListener Class Referenceabstract

A listener notified of changes in preferences. More...

#include <Prefs.h>

Inheritance diagram for PrefsListener:
[legend]
Collaboration diagram for PrefsListener:
[legend]

Classes

struct  Impl
 

Public Member Functions

 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 

Static Public Member Functions

static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Protected Member Functions

virtual void UpdateSelectedPrefs (int id)
 

Private Attributes

std::unique_ptr< ImplmpImpl
 

Detailed Description

A listener notified of changes in preferences.

Definition at line 651 of file Prefs.h.

Constructor & Destructor Documentation

◆ PrefsListener()

PrefsListener::PrefsListener ( )

Definition at line 145 of file Prefs.cpp.

146 : mpImpl{ std::make_unique<Impl>( *this ) }
147{
148}
std::unique_ptr< Impl > mpImpl
Definition: Prefs.h:679

◆ ~PrefsListener()

PrefsListener::~PrefsListener ( )
virtual

Definition at line 150 of file Prefs.cpp.

151{
152}

Member Function Documentation

◆ Broadcast()

void PrefsListener::Broadcast ( int  id = 0)
static

Call this static function to notify all PrefsListener objects.

Parameters
idwhen positive, passed to UpdateSelectedPrefs() of all listeners, meant to indicate that only a certain subset of preferences have changed; else their UpdatePrefs() methods are called. (That is supposed to happen when the user OK's changes in the Preferences dialog.) Callbacks are delayed, in the main thread, using BasicUI::CallAfter

Definition at line 128 of file Prefs.cpp.

129{
131 hub().Publish(id);
132 });
133}
CallbackReturn Publish(const Message &message)
Send a message to connected callbacks.
Definition: Observer.h:207
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:214

References BasicUI::CallAfter(), anonymous_namespace{Prefs.cpp}::hub(), and Observer::Publisher< Message, NotifyAll >::Publish().

Referenced by AudioSetupToolBar::CommonMenuItemSteps(), InitPreferences(), AdornedRulerPanel::OnAutoScroll(), DeviceToolBar::OnChoice(), PrefsDialog::OnOK(), MeterPanel::OnPreferences(), and anonymous_namespace{ViewMenus.cpp}::OnShowClipping().

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

◆ UpdatePrefs()

void PrefsListener::UpdatePrefs ( )
pure virtual

Implemented in CommandManager, audacity::network_manager::anonymous_namespace{CurlHandleManager.cpp}::CurlConfig, anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BeatsFormatter, anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatter, ProjectFileIO, ProjectStatus, ViewInfo, anonymous_namespace{LogWindow.cpp}::LogWindowUpdater, SpinControl, audacity::cloud::audiocom::sync::CloudSyncStatusField::StatusWidget, AdornedRulerPanel, MacrosWindow, FrequencyPlotDialog, HistoryDialog, NavigationActions::Handler, SelectActions::Handler, MixerBoard, SpectrogramSettings, WaveformSettings, ProjectSettings, ProjectWindow, RealtimeEffectListWindow, RealtimeEffectPanel::PrefsListenerHelper, ThemedButtonWrapper< ButtonBase >, ThemedAButtonWrapper< AButtonBase >, ThemedAButtonWrapper< AButton >, AudioSetupToolBar, ControlToolBar, CutCopyPasteToolBar, DeviceToolBar, EditToolBar, MeterToolBar, SelectionBar, SnappingToolBar, SpectralSelectionBar, TimeSignatureToolBar, TimeToolBar, ToolBar, ToolsToolBar, TranscriptionToolBar, TrackArtist, Settings, TrackPanel, NoteTrackVRulerMenuTable, WaveChannelVRulerMenuTable, TrackMenuTable, Scrubber, and MeterPanel.

Definition at line 154 of file Prefs.cpp.

155{
156}

Referenced by PrefsListener::Impl::OnEvent(), ThemedButtonWrapper< ButtonBase >::UpdatePrefs(), and ThemedAButtonWrapper< AButtonBase >::UpdatePrefs().

Here is the caller graph for this function:

◆ UpdateSelectedPrefs()

void PrefsListener::UpdateSelectedPrefs ( int  id)
protectedvirtual

Reimplemented in ViewInfo, TrackArtist, AudioSetupToolBar, DeviceToolBar, and MeterPanel.

Definition at line 158 of file Prefs.cpp.

159{
160}

Referenced by PrefsListener::Impl::OnEvent(), AudioSetupToolBar::UpdateSelectedPrefs(), and DeviceToolBar::UpdateSelectedPrefs().

Here is the caller graph for this function:

Member Data Documentation

◆ mpImpl

std::unique_ptr<Impl> PrefsListener::mpImpl
private

Definition at line 680 of file Prefs.h.


The documentation for this class was generated from the following files: