Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EffectsPrefs Class Referencefinal

A PrefsPanel for general GUI preferences. More...

#include <EffectsPrefs.h>

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

Public Member Functions

 EffectsPrefs (wxWindow *parent, wxWindowID winid)
 
 ~EffectsPrefs ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
bool Commit () override
 
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 

Private Attributes

std::vector< std::pair< PluginProvider *, EffectsLocationPanel * > > mLocations
 

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Detailed Description

A PrefsPanel for general GUI preferences.

Definition at line 27 of file EffectsPrefs.h.

Constructor & Destructor Documentation

◆ EffectsPrefs()

EffectsPrefs::EffectsPrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 196 of file EffectsPrefs.cpp.

197: PrefsPanel(parent, winid, XO("Effects"))
198{
199 Populate();
200}
XO("Cut/Copy/Paste")
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:94

References Populate().

Here is the call graph for this function:

◆ ~EffectsPrefs()

EffectsPrefs::~EffectsPrefs ( )

Definition at line 202 of file EffectsPrefs.cpp.

203{
204}

Member Function Documentation

◆ Commit()

bool EffectsPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 350 of file EffectsPrefs.cpp.

351{
352 auto& pluginManager = PluginManager::Get();
353
354 for(auto [provider, panel] : mLocations)
355 pluginManager.StoreCustomPaths(*provider, panel->GetLocations());
356
359
360 return true;
361}
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S) override
std::vector< std::pair< PluginProvider *, EffectsLocationPanel * > > mLocations
Definition: EffectsPrefs.h:42
static PluginManager & Get()
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

References eIsSavingToPrefs, PluginManager::Get(), mLocations, PopulateOrExchange(), and S.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString EffectsPrefs::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 211 of file EffectsPrefs.cpp.

212{
213 return XO("Preferences for Effects");
214}

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol EffectsPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 206 of file EffectsPrefs.cpp.

207{
209}
#define EFFECTS_PREFS_PLUGIN_SYMBOL
Definition: EffectsPrefs.h:25

References EFFECTS_PREFS_PLUGIN_SYMBOL.

◆ HelpPageName()

ManualPageID EffectsPrefs::HelpPageName ( )
overridevirtual

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 216 of file EffectsPrefs.cpp.

217{
218 return "Effects_Preferences";
219}

◆ Populate()

void EffectsPrefs::Populate ( )
private

Definition at line 221 of file EffectsPrefs.cpp.

222{
223 //------------------------- Main section --------------------
224 // Now construct the GUI itself.
225 // Use 'eIsCreatingFromPrefs' so that the GUI is
226 // initialised with values from gPrefs.
229 // ----------------------- End of main section --------------
230}
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46

References eIsCreatingFromPrefs, PopulateOrExchange(), and S.

Referenced by EffectsPrefs().

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

◆ PopulateOrExchange()

void EffectsPrefs::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 271 of file EffectsPrefs.cpp.

272{
273 const auto scroller = S.StartScroller();
274
275 S.StartStatic(XO("Effect Options"));
276 {
277 S.StartMultiColumn(2);
278 {
279 S.SetBorder(3);
280 S.MinSize()
281 .TieChoice( XXO("Effect menu &organization:"), EffectsGroupBy);
282 S.MinSize()
283 .TieChoice( XXO("Realtime effect o&rganization:"), RealtimeEffectsGroupBy);
284 }
285 S.EndMultiColumn();
286 }
287 S.EndStatic();
288
289#ifdef EXPERIMENTAL_EQ_SSE_THREADED
290 S.StartStatic(XO("Instruction Set"));
291 {
292 S.TieCheckBox(XXO("&Use SSE/SSE2/.../AVX"),
293 {wxT("/SSE/GUI"),
294 true});
295 }
296 S.EndStatic();
297#endif
298
299 auto& pluginManager = PluginManager::Get();
300 for(auto& [id, provider] : ModuleManager::Get().Providers())
301 {
302 if(!provider->SupportsCustomModulePaths())
303 continue;
304
305 /*i18n-hint: Title of the panel containing user-defined paths where plugins could be found
306 * First argument is replaced with plugin type (e.g. "LV2 plugin locations")
307 */
308 const auto panelTitle = XO("%s plugin locations")
309 .Format(provider->GetOptionalFamilySymbol().Translation());
310 S.StartStatic(panelTitle);
311 {
312 if(S.GetMode() == eIsCreating)
313 {
314 const auto panel = safenew EffectsLocationPanel(S.GetParent());
315#if wxUSE_ACCESSIBILITY
316 panel->SetName(panelTitle);
318#endif
319
320 panel->AddLocations(pluginManager.ReadCustomPaths(*provider.get()));
321 S.Prop(1).AddWindow(panel, wxEXPAND);
322 mLocations.emplace_back(provider.get(), panel);
323
324 panel->Bind(EVT_PLUGIN_LOCATIONS_CHANGED, [wnd = wxWeakRef(scroller)](const auto&)
325 {
326 if(!wnd)
327 return;
328 wnd->Layout();
329 wnd->FitInside();
330 });
331 }
332 }
333 S.EndStatic();
334 }
335
336 S.TieCheckBox(XXO("&Skip effects scanning at startup"), SkipEffectsScanAtStartup);
337
338 if (auto pButton = S.AddButton(XXO("Open Plugin &Manager"), wxALIGN_LEFT))
339 pButton->Bind(wxEVT_BUTTON, [this](auto) {
340 //Adding dependency on PluginRegistrationDialog, not good. Alternatively
341 //that could be done with events, though event should be visible here too...
342 PluginRegistrationDialog dialog(wxGetTopLevelParent(this));
343 if(dialog.ShowModal() == wxID_OK)
345 });
346
347 S.EndScroller();
348}
wxT("CloseDown"))
ChoiceSetting EffectsGroupBy
BoolSetting SkipEffectsScanAtStartup
ChoiceSetting RealtimeEffectsGroupBy
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:10
@ eIsCreating
Definition: ShuttleGui.h:37
static void RebuildAllMenuBars()
static ModuleManager & Get()
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...

References EffectsGroupBy, eIsCreating, ModuleManager::Get(), PluginManager::Get(), mLocations, RealtimeEffectsGroupBy, MenuCreator::RebuildAllMenuBars(), S, safenew, SkipEffectsScanAtStartup, wxT(), XO(), and XXO().

Referenced by Commit(), and Populate().

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

Member Data Documentation

◆ mLocations

std::vector<std::pair<PluginProvider*, EffectsLocationPanel*> > EffectsPrefs::mLocations
private

Definition at line 42 of file EffectsPrefs.h.

Referenced by Commit(), and PopulateOrExchange().


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