Audacity  3.0.3
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 <wx/intl.h>
29 
30 #include "../Shuttle.h"
31 #include "../ShuttleGui.h"
32 #include "../widgets/AudacityMessageBox.h"
33 #include "../widgets/valnum.h"
34 #include "../commands/CommandContext.h"
35 
37 { XO("Demo") };
38 
39 //Don't register the demo command.
40 //namespace{ BuiltinCommandsModule::Registration< DemoCommand > reg; }
41 
43  S.Define( delay, wxT("Delay"), 1.0f, 0.001f, FLT_MAX, 1.0f );
44  S.Define( decay, wxT("Decay"), 0.5f, 0.0f, FLT_MAX, 1.0f );
45  return true;
46 }
47 
48 bool DemoCommand::Apply(const CommandContext & context){
49  context.Status( "A Message");
50  return true;
51 }
52 
54 {
55  S.AddSpace(0, 5);
56 
57  S.StartMultiColumn(2, wxALIGN_CENTER);
58  {
59  S.TieTextBox(XXO("Delay time (seconds):"),delay);
60  S.TieTextBox(XXO("Decay factor:"),decay);
61  }
62  S.EndMultiColumn();
63 }
64 
65 
66 
Demo.h
LoadCommands.h
DemoCommand::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Demo.cpp:42
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2447
XO
#define XO(s)
Definition: Internat.h:31
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:62
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
DemoCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Demo.h:22
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
CommandContext::Status
virtual void Status(const wxString &message, bool bFlush=false) const
Definition: CommandContext.cpp:63
XXO
#define XXO(s)
Definition: Internat.h:44
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
DemoCommand::decay
double decay
Definition: Demo.h:36
DemoCommand::delay
double delay
Definition: Demo.h:35
DemoCommand::Apply
bool Apply(const CommandContext &context) override
Definition: Demo.cpp:48
ShuttleParams::Define
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
DemoCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Demo.cpp:53