Audacity
3.2.0
src
commands
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
17
class
AudacityProject
;
18
class
wxEvent;
19
class
CommandOutputTargets
;
20
using
CommandParameter
=
CommandID
;
21
22
class
SelectedRegion
;
23
class
Track
;
24
25
struct
TemporarySelection
{
26
TemporarySelection
() =
default
;
27
TemporarySelection
(
const
TemporarySelection
&) =
default
;
28
TemporarySelection
&
operator=
(
const
TemporarySelection
&) =
default
;
29
30
SelectedRegion
*
pSelectedRegion
=
nullptr
;
31
Track
*
pTrack
=
nullptr
;
32
};
33
34
class
AUDACITY_DLL_API
CommandContext
{
35
public
:
36
CommandContext
(
37
AudacityProject
&p
38
,
const
wxEvent *e =
nullptr
39
,
int
ii = 0
40
,
const
CommandParameter
¶m =
CommandParameter
{}
41
);
42
43
CommandContext
(
44
AudacityProject
&p,
45
std::unique_ptr<CommandOutputTargets> target);
46
47
~CommandContext
();
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
64
AudacityProject
&
project
;
65
std::unique_ptr<CommandOutputTargets>
pOutput
;
66
const
wxEvent *
pEvt
;
67
int
index
;
68
CommandParameter
parameter
;
69
70
// This might depend on a point picked with a context menu
71
TemporarySelection
temporarySelection
;
72
};
73
#endif
name
const TranslatableString name
Definition:
Distortion.cpp:76
Identifier.h
CommandID
TaggedIdentifier< CommandIdTag, false > CommandID
Identifies a menu command or macro. Case-insensitive comparison.
Definition:
Identifier.h:232
AudacityProject
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
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition:
CommandContext.h:34
CommandContext::index
int index
Definition:
CommandContext.h:67
CommandContext::parameter
CommandParameter parameter
Definition:
CommandContext.h:68
CommandContext::pEvt
const wxEvent * pEvt
Definition:
CommandContext.h:66
CommandContext::temporarySelection
TemporarySelection temporarySelection
Definition:
CommandContext.h:71
CommandContext::~CommandContext
~CommandContext()
CommandContext::project
AudacityProject & project
Definition:
CommandContext.h:64
CommandContext::pOutput
std::unique_ptr< CommandOutputTargets > pOutput
Definition:
CommandContext.h:65
CommandOutputTargets
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
Definition:
CommandTargets.h:306
SelectedRegion
Defines a selected portion of a project.
Definition:
SelectedRegion.h:38
TaggedIdentifier< CommandIdTag, false >
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition:
Track.h:162
TemporarySelection
Definition:
CommandContext.h:25
TemporarySelection::TemporarySelection
TemporarySelection()=default
TemporarySelection::pTrack
Track * pTrack
Definition:
CommandContext.h:31
TemporarySelection::pSelectedRegion
SelectedRegion * pSelectedRegion
Definition:
CommandContext.h:30
TemporarySelection::TemporarySelection
TemporarySelection(const TemporarySelection &)=default
TemporarySelection::operator=
TemporarySelection & operator=(const TemporarySelection &)=default
Generated by
1.9.3