Audacity
3.2.0
src
commands
PreferenceCommands.h
Go to the documentation of this file.
1
/**********************************************************************
2
3
Audacity: A Digital Audio Editor
4
Audacity(R) is copyright (c) 1999-2018 Audacity Team.
5
File License: wxwidgets
6
7
PreferenceCommands.h
8
Dan Horgan
9
James Crook
10
11
******************************************************************/
/*******************************************************************/
20
21
#ifndef __PREFERENCE_COMMANDS__
22
#define __PREFERENCE_COMMANDS__
23
24
#include "
Command.h
"
25
#include "
CommandType.h
"
26
27
// GetPreference
28
29
class
GetPreferenceCommand
final :
public
AudacityCommand
30
{
31
public
:
32
static
const
ComponentInterfaceSymbol
Symbol
;
33
34
// ComponentInterface overrides
35
ComponentInterfaceSymbol
GetSymbol
()
const override
{
return
Symbol
;};
36
TranslatableString
GetDescription
()
const override
{
return
XO
(
"Gets the value of a single preference."
);};
37
template
<
bool
Const>
bool
VisitSettings
(
SettingsVisitorBase<Const>
&
S
);
38
bool
VisitSettings
(
SettingsVisitor
&
S
)
override
;
39
bool
VisitSettings
(
ConstSettingsVisitor
&
S
)
override
;
40
void
PopulateOrExchange
(
ShuttleGui
&
S
)
override
;
41
bool
Apply
(
const
CommandContext
& context)
override
;
42
43
// AudacityCommand overrides
44
ManualPageID
ManualPage
()
override
{
return
L
"Extra_Menu:_Scriptables_I#get_preference"
;}
45
46
wxString
mName
;
47
};
48
49
// SetPreference
50
51
class
SetPreferenceCommand
final :
public
AudacityCommand
52
{
53
public
:
54
static
const
ComponentInterfaceSymbol
Symbol
;
55
56
// ComponentInterface overrides
57
ComponentInterfaceSymbol
GetSymbol
()
const override
{
return
Symbol
;};
58
TranslatableString
GetDescription
()
const override
{
return
XO
(
"Sets the value of a single preference."
);};
59
template
<
bool
Const>
bool
VisitSettings
(
SettingsVisitorBase<Const>
&
S
);
60
bool
VisitSettings
(
SettingsVisitor
&
S
)
override
;
61
bool
VisitSettings
(
ConstSettingsVisitor
&
S
)
override
;
62
void
PopulateOrExchange
(
ShuttleGui
&
S
)
override
;
63
bool
Apply
(
const
CommandContext
& context)
override
;
64
65
// AudacityCommand overrides
66
ManualPageID
ManualPage
()
override
{
return
L
"Extra_Menu:_Scriptables_I#set_preference"
;}
67
68
wxString
mName
;
69
wxString
mValue
;
70
bool
mbReload
;
71
bool
bHasReload
;
72
};
73
74
#endif
/* End of include guard: __PREFERENCE_COMMANDS__ */
Command.h
Contains declaration of Command base class.
CommandType.h
Contains declarations for CommandType class.
XO
XO("Cut/Copy/Paste")
S
#define S(N)
Definition:
ToChars.cpp:64
AudacityCommand
Base class for command in Audacity.
Definition:
AudacityCommand.h:40
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition:
CommandContext.h:37
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition:
ComponentInterfaceSymbol.h:27
GetPreferenceCommand
Command for getting the value of a preference.
Definition:
PreferenceCommands.h:30
GetPreferenceCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition:
PreferenceCommands.h:32
GetPreferenceCommand::VisitSettings
bool VisitSettings(SettingsVisitorBase< Const > &S)
Definition:
PreferenceCommands.cpp:37
GetPreferenceCommand::Apply
bool Apply(const CommandContext &context) override
Definition:
PreferenceCommands.cpp:60
GetPreferenceCommand::GetDescription
TranslatableString GetDescription() const override
Definition:
PreferenceCommands.h:36
GetPreferenceCommand::mName
wxString mName
Definition:
PreferenceCommands.h:46
GetPreferenceCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() const override
Definition:
PreferenceCommands.h:35
GetPreferenceCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition:
PreferenceCommands.cpp:48
GetPreferenceCommand::ManualPage
ManualPageID ManualPage() override
Definition:
PreferenceCommands.h:44
SetPreferenceCommand
Command for setting a preference to a given value.
Definition:
PreferenceCommands.h:52
SetPreferenceCommand::mName
wxString mName
Definition:
PreferenceCommands.h:68
SetPreferenceCommand::mbReload
bool mbReload
Definition:
PreferenceCommands.h:70
SetPreferenceCommand::GetDescription
TranslatableString GetDescription() const override
Definition:
PreferenceCommands.h:58
SetPreferenceCommand::Apply
bool Apply(const CommandContext &context) override
Definition:
PreferenceCommands.cpp:102
SetPreferenceCommand::mValue
wxString mValue
Definition:
PreferenceCommands.h:69
SetPreferenceCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition:
PreferenceCommands.cpp:89
SetPreferenceCommand::VisitSettings
bool VisitSettings(SettingsVisitorBase< Const > &S)
Definition:
PreferenceCommands.cpp:76
SetPreferenceCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition:
PreferenceCommands.h:54
SetPreferenceCommand::ManualPage
ManualPageID ManualPage() override
Definition:
PreferenceCommands.h:66
SetPreferenceCommand::GetSymbol
ComponentInterfaceSymbol GetSymbol() const override
Definition:
PreferenceCommands.h:57
SetPreferenceCommand::bHasReload
bool bHasReload
Definition:
PreferenceCommands.h:71
SettingsVisitorBase
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Definition:
SettingsVisitor.h:79
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition:
ShuttleGui.h:640
TaggedIdentifier< ManualPageIDTag >
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition:
TranslatableString.h:32
Generated by
1.9.3