Audacity  2.2.2
CommandContext.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  CommandContext.h
6 
7  Created by Paul Licameli on 4/22/16.
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_COMMAND_CONTEXT__
12 #define __AUDACITY_COMMAND_CONTEXT__
13 
14 #include <wx/string.h>
15 #include <wx/event.h>
16 #include "../MemoryX.h"
17 #include "Command.h"
18 
19 class AudacityProject;
20 class AudacityApp;
21 class wxEvent;
23 using CommandParameter = wxString;
24 
25 class AUDACITY_DLL_API CommandContext {
26 public:
29  , const wxEvent *e = nullptr
30  , int ii = 0
31  , const CommandParameter &param = CommandParameter{}
32  );
33 
35  AudacityProject &p,
36  std::unique_ptr<CommandOutputTargets> target);
37 
38  virtual void Status( const wxString &message, bool bFlush = false ) const;
39  virtual void Error( const wxString &message ) const;
40  virtual void Progress( double d ) const;
41 
42  // Output formatting...
43  void StartArray() const;
44  void EndArray() const;
45  void StartStruct() const;
46  void EndStruct() const;
47  void StartField(const wxString &name) const;
48  void EndField() const;
49  void AddItem(const wxString &value , const wxString &name="" ) const;
50  void AddBool(const bool value , const wxString &name="" ) const;
51  void AddItem(const double value , const wxString &name="" ) const;
52 
54  std::unique_ptr<CommandOutputTargets> pOutput;
55  const wxEvent *pEvt;
56  int index;
58  AudacityApp *GetApp() const;
59  AudacityProject *GetProject() const;
60 };
61 #endif
std::unique_ptr< CommandOutputTargets > pOutput
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
Contains declaration of Command base class.
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
const wxEvent * pEvt
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
AudacityApp is the 'main' class for Audacity.
Definition: AudacityApp.h:59
AudacityProject & project
const wxChar * name
Definition: Distortion.cpp:94
CommandParameter parameter
wxString CommandParameter