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 "Callable.h"
16#include "CommandTargets.h"
17#include "GlobalVariable.h"
18#include "Identifier.h"
19
20class AudacityProject;
21class wxEvent;
24
25class SelectedRegion;
26class Track;
27
29 TemporarySelection() = default;
32
34 Track *pTrack = nullptr;
35};
36
37class MENUS_API CommandContext {
38public:
39 struct MENUS_API TargetFactory : DefaultedGlobalHook< TargetFactory,
40 Callable::UniquePtrFactory<CommandOutputTargets>::Function
41 >{};
42
45 , const wxEvent *e = nullptr
46 , int ii = 0
47 , const CommandParameter &param = CommandParameter{}
48 );
49
52 std::unique_ptr<CommandOutputTargets> target);
53
55
56 virtual void Status( const wxString &message, bool bFlush = false ) const;
57 virtual void Error( const wxString &message ) const;
58 virtual void Progress( double d ) const;
59
60 // Output formatting...
61 void StartArray() const;
62 void EndArray() const;
63 void StartStruct() const;
64 void EndStruct() const;
65 void StartField(const wxString &name) const;
66 void EndField() const;
67 void AddItem(const wxString &value , const wxString &name = {} ) const;
68 void AddBool(const bool value , const wxString &name = {} ) const;
69 void AddItem(const double value , const wxString &name = {} ) const;
70
72 std::unique_ptr<CommandOutputTargets> pOutput;
73 const wxEvent *pEvt;
74 int index;
76
77 // This might depend on a point picked with a context menu
79};
80#endif
Functions and classes that generate callable objects.
TaggedIdentifier< CommandIdTag, false > CommandID
Identifies a menu command or macro. Case-insensitive comparison.
Definition: Identifier.h:232
wxString name
Definition: TagsEditor.cpp:166
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:110
TemporarySelection()=default
SelectedRegion * pSelectedRegion
TemporarySelection(const TemporarySelection &)=default
TemporarySelection & operator=(const TemporarySelection &)=default