Audacity 3.2.0
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 <memory>
15#include "Identifier.h"
16
17class AudacityProject;
18class wxEvent;
21
22class SelectedRegion;
23class Track;
24
26 TemporarySelection() = default;
29
31 Track *pTrack = nullptr;
32};
33
34class AUDACITY_DLL_API CommandContext {
35public:
38 , const wxEvent *e = nullptr
39 , int ii = 0
40 , const CommandParameter &param = CommandParameter{}
41 );
42
45 std::unique_ptr<CommandOutputTargets> target);
46
48
49 virtual void Status( const wxString &message, bool bFlush = false ) const;
50 virtual void Error( const wxString &message ) const;
51 virtual void Progress( double d ) const;
52
53 // Output formatting...
54 void StartArray() const;
55 void EndArray() const;
56 void StartStruct() const;
57 void EndStruct() const;
58 void StartField(const wxString &name) const;
59 void EndField() const;
60 void AddItem(const wxString &value , const wxString &name = {} ) const;
61 void AddBool(const bool value , const wxString &name = {} ) const;
62 void AddItem(const double value , const wxString &name = {} ) const;
63
65 std::unique_ptr<CommandOutputTargets> pOutput;
66 const wxEvent *pEvt;
67 int index;
69
70 // This might depend on a point picked with a context menu
72};
73#endif
const TranslatableString name
Definition: Distortion.cpp:76
TaggedIdentifier< CommandIdTag, false > CommandID
Identifies a menu command or macro. Case-insensitive comparison.
Definition: Identifier.h:232
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
CommandParameter parameter
const wxEvent * pEvt
TemporarySelection temporarySelection
AudacityProject & project
std::unique_ptr< CommandOutputTargets > pOutput
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
Defines a selected portion of a project.
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:162
TemporarySelection()=default
SelectedRegion * pSelectedRegion
TemporarySelection(const TemporarySelection &)=default
TemporarySelection & operator=(const TemporarySelection &)=default