forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportExportPrefs.h
77 lines (54 loc) · 2.08 KB
/
ImportExportPrefs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**********************************************************************
Audacity: A Digital Audio Editor
ImportExportPrefs.h
Joshua Haberman
Dominic Mazzoni
James Crook
**********************************************************************/
#ifndef __AUDACITY_IMPORT_EXPORT_PREFS__
#define __AUDACITY_IMPORT_EXPORT_PREFS__
#include <wx/defs.h>
#include "PrefsPanel.h"
class ShuttleGui;
#define IMPORT_EXPORT_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("IMPORT EXPORT") }
template< typename Enum > class EnumSetting;
class AUDACITY_DLL_API ImportExportPrefs final : public PrefsPanel
{
struct PopulatorItem;
public:
//! Type of function that adds to the Import/Export preference page
using Populator = std::function<void(ShuttleGui&)>;
//! To be statically constructed, it registers additions to the
//! Import/Export preference page
struct AUDACITY_DLL_API RegisteredControls
: public Registry::RegisteredItem<PopulatorItem>
{
// Whether any controls have been registered
static bool Any();
RegisteredControls(const Identifier &id, Populator populator,
const Registry::Placement &placement = { wxEmptyString, {} });
struct AUDACITY_DLL_API Init{ Init(); };
};
static EnumSetting<bool> MusicFileImportSetting;
ImportExportPrefs(wxWindow * parent, wxWindowID winid);
~ImportExportPrefs();
ComponentInterfaceSymbol GetSymbol() const override;
TranslatableString GetDescription() const override;
bool Commit() override;
ManualPageID HelpPageName() override;
void PopulateOrExchange(ShuttleGui & S) override;
private:
struct Traits : Registry::DefaultTraits {
using LeafTypes = List<PopulatorItem>;
};
struct AUDACITY_DLL_API PopulatorItem final : Registry::SingleItem {
static Registry::GroupItem<Traits> &Registry();
PopulatorItem(const Identifier &id, Populator populator);
Populator mPopulator;
};
void Populate();
};
// Guarantees registry exists before attempts to use it
static ImportExportPrefs::RegisteredControls::Init
sInitRegisteredImpExpControls;
#endif