Audacity 3.2.0
LibraryPrefs.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 FileFormatPrefs.h
6
7 Joshua Haberman
8 Dominic Mazzoni
9 James Crook
10
11**********************************************************************/
12
13#ifndef __AUDACITY_FILE_FORMAT_PREFS__
14#define __AUDACITY_FILE_FORMAT_PREFS__
15
16#include <functional>
17#include <wx/defs.h>
18
19#include "PrefsPanel.h"
20
21class wxStaticText;
22class wxTextCtrl;
23class ShuttleGui;
24
25#define LIBRARY_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Library") }
26
27class LibraryPrefs final : public PrefsPanel
28{
29 struct PopulatorItem;
30 public:
31
33 using Populator = std::function< void(ShuttleGui&) >;
34
36 struct PREFERENCE_PAGES_API RegisteredControls
37 : Registry::RegisteredItem<PopulatorItem>
38 {
39 // Whether any controls have been registered
40 static bool Any();
41
42 RegisteredControls( const Identifier &id, Populator populator,
43 const Registry::Placement &placement = { wxEmptyString, {} } );
44
45 struct PREFERENCE_PAGES_API Init{ Init(); };
46 };
47
48 LibraryPrefs(wxWindow * parent, wxWindowID winid);
50 ComponentInterfaceSymbol GetSymbol() const override;
51 TranslatableString GetDescription() const override;
52
53 bool Commit() override;
54 ManualPageID HelpPageName() override;
55 void PopulateOrExchange(ShuttleGui & S) override;
56
57
58 private:
61 };
62 struct PREFERENCE_PAGES_API PopulatorItem final : Registry::SingleItem {
64
65 PopulatorItem(const Identifier &id, Populator populator);
66
68 };
69
70 void Populate();
71};
72
73// Guarantees registry exists before attempts to use it
75
76#endif
static LibraryPrefs::RegisteredControls::Init sInitRegisteredControls
Definition: LibraryPrefs.h:74
#define S(N)
Definition: ToChars.cpp:64
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
A PrefsPanel used to select manage external libraries like the MP3 and FFmpeg encoding libraries.
Definition: LibraryPrefs.h:28
bool Commit() override
ComponentInterfaceSymbol GetSymbol() const override
std::function< void(ShuttleGui &) > Populator
Type of function that adds to the Library preference page.
Definition: LibraryPrefs.h:33
TranslatableString GetDescription() const override
void Populate()
Creates the dialog and its contents.
void PopulateOrExchange(ShuttleGui &S) override
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
LibraryPrefs(wxWindow *parent, wxWindowID winid)
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
Generates classes whose instances register items at construction.
Definition: Registry.h:388
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
To be statically constructed, it registers additions to the Library preference page.
Definition: LibraryPrefs.h:38
Common abstract base class for items that are not groups.
Definition: Registry.h:224
Primary template for a list of arbitrary types.
Definition: TypeList.h:61