Audacity 3.2.0
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
35{ XO("Demo") };
36
37//Don't register the demo command.
38//namespace{ BuiltinCommandsModule::Registration< DemoCommand > reg; }
39
40template<bool Const>
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
48 { return VisitSettings<false>(S); }
49
51 { return VisitSettings<true>(S); }
52
53bool DemoCommand::Apply(const CommandContext & context){
54 context.Status( "A Message");
55 return true;
56}
57
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("CloseDown"))
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
virtual void Status(const wxString &message, bool bFlush=false) const
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
bool Apply(const CommandContext &context) override
Definition: Demo.cpp:53
double delay
Definition: Demo.h:37
double decay
Definition: Demo.h:38
static const ComponentInterfaceSymbol Symbol
Definition: Demo.h:22
void PopulateOrExchange(ShuttleGui &S) override
Definition: Demo.cpp:58
bool VisitSettings(SettingsVisitorBase< Const > &S)
Definition: Demo.cpp:41
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640