Audacity
3.2.0
src
commands
Demo.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
3
Audacity: A Digital Audio Editor
4
5
Demo.cpp
6
7
James Crook
8
9
*******************************************************************/
/****************************************************************/
/*******************************************************************/
21
22
23
#include "
Demo.h
"
24
#include "
LoadCommands.h
"
25
26
#include <float.h>
27
28
#include "
SettingsVisitor.h
"
29
#include "
ShuttleGui.h
"
30
#include "
AudacityMessageBox.h
"
31
#include "../widgets/valnum.h"
32
#include "
CommandContext.h
"
33
34
const
ComponentInterfaceSymbol
DemoCommand::Symbol
35
{
XO
(
"Demo"
) };
36
37
//Don't register the demo command.
38
//namespace{ BuiltinCommandsModule::Registration< DemoCommand > reg; }
39
40
template
<
bool
Const>
41
bool
DemoCommand::VisitSettings
(
SettingsVisitorBase<Const>
&
S
){
42
S
.Define(
delay
,
wxT
(
"Delay"
), 1.0f, 0.001f, FLT_MAX, 1.0f );
43
S
.Define(
decay
,
wxT
(
"Decay"
), 0.5f, 0.0f, FLT_MAX, 1.0f );
44
return
true
;
45
}
46
47
bool
DemoCommand::VisitSettings
(
SettingsVisitor
&
S
)
48
{
return
VisitSettings<false>(
S
); }
49
50
bool
DemoCommand::VisitSettings
(
ConstSettingsVisitor
&
S
)
51
{
return
VisitSettings<true>(
S
); }
52
53
bool
DemoCommand::Apply
(
const
CommandContext
& context){
54
context.
Status
(
"A Message"
);
55
return
true
;
56
}
57
58
void
DemoCommand::PopulateOrExchange
(
ShuttleGui
&
S
)
59
{
60
S
.AddSpace(0, 5);
61
62
S
.StartMultiColumn(2, wxALIGN_CENTER);
63
{
64
S
.TieTextBox(
XXO
(
"Delay time (seconds):"
),
delay
);
65
S
.TieTextBox(
XXO
(
"Decay factor:"
),
decay
);
66
}
67
S
.EndMultiColumn();
68
}
69
70
71
wxT
wxT("CloseDown"))
AudacityMessageBox.h
CommandContext.h
Demo.h
XO
XO("Cut/Copy/Paste")
XXO
XXO("&Cut/Copy/Paste Toolbar")
LoadCommands.h
SettingsVisitor.h
ShuttleGui.h
S
#define S(N)
Definition:
ToChars.cpp:64
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition:
CommandContext.h:37
CommandContext::Status
virtual void Status(const wxString &message, bool bFlush=false) const
Definition:
CommandContext.cpp:60
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition:
ComponentInterfaceSymbol.h:27
DemoCommand::Apply
bool Apply(const CommandContext &context) override
Definition:
Demo.cpp:53
DemoCommand::delay
double delay
Definition:
Demo.h:37
DemoCommand::decay
double decay
Definition:
Demo.h:38
DemoCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition:
Demo.h:22
DemoCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition:
Demo.cpp:58
DemoCommand::VisitSettings
bool VisitSettings(SettingsVisitorBase< Const > &S)
Definition:
Demo.cpp:41
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
Generated by
1.9.3