Ardour  9.0-pre0-1792-g9dafed2d76
editing.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005 Karsten Wiese <fzuuzf@googlemail.com>
3  * Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2007-2009 David Robillard <d@drobilla.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #pragma once
22 
23 #include <string>
24 #include <map>
25 #include "ardour/types.h"
26 
27 // This involves some cpp magic. --taybin
28 
29 #define GRIDTYPE(a) /*empty*/
30 #define SNAPMODE(a) /*empty*/
31 #define REGIONLISTSORTTYPE(a) /*empty*/
32 #define MOUSEMODE(a) /*empty*/
33 #define MIDIEDITMODE(a) /*empty*/
34 #define ZOOMFOCUS(a) /*empty*/
35 #define DISPLAYCONTROL(a) /*empty*/
36 #define IMPORTMODE(a) /*empty*/
37 #define IMPORTPOSITION(a)
38 #define IMPORTDISPOSITION(a)
39 #define EDITPOINT(a) /*empty*/
40 #define WAVEFORMSCALE(a) /*empty*/
41 #define WAVEFORMSHAPE(a) /*empty*/
42 #define INSERTTIMEOPT(a) /*empty*/
43 #define TEMPOEDITBEHAVIOR(a) /*empty*/
44 #define NOTENAMEDISPLAY(a) /*empty*/
45 #define MARKERCLICKBEHAVIOR(a) /*empty*/
46 #define REGIONEDITDISPOSITION(a) /*empty*/
47 
48 namespace Editing {
49 
50 // GRIDTYPE
51 #undef GRIDTYPE
52 #define GRIDTYPE(a) a,
53 enum GridType {
54  #include "editing_syms.inc.h"
55 };
56 
57 static const int DRAW_VEL_AUTO = -1;
58 static const int DRAW_CHAN_AUTO = -1;
59 static const GridType DRAW_LEN_AUTO = GridTypeNone; //special case: use the Grid's value instead of the note-length selection
60 
61 extern const char *gridtypestrs[];
62 inline const char* enum2str(GridType m) {return gridtypestrs[m];}
63 GridType str2gridtype(const std::string &);
64 
65 #undef GRIDTYPE
66 #define GRIDTYPE(a) /*empty*/
67 
68 // SNAPMODE
69 #undef SNAPMODE
70 #define SNAPMODE(a) a,
71 enum SnapMode {
72  #include "editing_syms.inc.h"
73 };
74 
75 extern const char *snapmodestrs[];
76 inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
77 SnapMode str2snapmode(const std::string &);
78 
79 #undef SNAPMODE
80 #define SNAPMODE(a) /*empty*/
81 
82 // REGIONLISTSORTTYPE
83 #undef REGIONLISTSORTTYPE
84 #define REGIONLISTSORTTYPE(a) a,
86  #include "editing_syms.inc.h"
87 };
88 
89 extern const char *regionlistsorttypestrs[];
90 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
92 
93 #undef REGIONLISTSORTTYPE
94 #define REGIONLISTSORTTYPE(a) /*empty*/
95 
96 // MOUSEMODE
97 #undef MOUSEMODE
98 #define MOUSEMODE(a) a,
99 enum MouseMode {
100  #include "editing_syms.inc.h"
101 };
102 
103 extern const char *mousemodestrs[];
104 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
105 MouseMode str2mousemode(const std::string &);
106 
107 #undef MOUSEMODE
108 #define MOUSEMODE(a) /*empty*/
109 
110 // MIDIEDITMODE
111 #undef MIDIEDITMODE
112 #define MIDIEDITMODE(a) a,
114  #include "editing_syms.inc.h"
115 };
116 
117 extern const char *midieditmodestrs[];
118 inline const char* enum2str(MidiEditMode m) {return midieditmodestrs[m];}
119 MidiEditMode str2midieditmode(const std::string &);
120 
121 #undef MIDIEDITMODE
122 #define MIDIEDITMODE(a) /*empty*/
123 
124 // ZOOMFOCUS
125 #undef ZOOMFOCUS
126 #define ZOOMFOCUS(a) a,
127 enum ZoomFocus {
128  #include "editing_syms.inc.h"
129 };
130 
131 extern const char *zoomfocusstrs[];
132 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
133 ZoomFocus str2zoomfocus(const std::string &);
134 
135 #undef ZOOMFOCUS
136 #define ZOOMFOCUS(a) /*empty*/
137 
138 // DISPLAYCONTROL
139 #undef DISPLAYCONTROL
140 #define DISPLAYCONTROL(a) a,
142  #include "editing_syms.inc.h"
143 };
144 
145 extern const char *displaycontrolstrs[];
146 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
147 DisplayControl str2displaycontrol (const std::string &);
148 
149 #undef DISPLAYCONTROL
150 #define DISPLAYCONTROL(a) /*empty*/
151 
152 
153 // IMPORTMODE
154 #undef IMPORTMODE
155 #define IMPORTMODE(a) a,
157  #include "editing_syms.inc.h"
158 };
159 
160 #undef IMPORTMODE
161 #define IMPORTMODE(a) /*empty*/
162 
163 // IMPORTPOSITION
164 #undef IMPORTPOSITION
165 #define IMPORTPOSITION(a) a,
167  #include "editing_syms.inc.h"
168 };
169 
170 #undef IMPORTPOSITION
171 #define IMPORTPOSITION(a) /*empty*/
172 
173 // IMPORTDISPOSITION
174 #undef IMPORTDISPOSITION
175 #define IMPORTDISPOSITION(a) a,
177  #include "editing_syms.inc.h"
178 };
179 
180 #undef IMPORTDISPOSITION
181 #define IMPORTDISPOSITION(a) /*empty*/
182 
183 // EDITPOINT
184 #undef EDITPOINT
185 #define EDITPOINT(a) a,
186 enum EditPoint {
187  #include "editing_syms.inc.h"
188 };
189 
190 #undef EDITPOINT
191 #define EDITPOINT(a) /*empty*/
192 
193 // INSERTTIMEOPT
194 #undef INSERTTIMEOPT
195 #define INSERTTIMEOPT(a) a,
197  #include "editing_syms.inc.h"
198 };
199 
200 #undef INSERTTIMEOPT
201 #define INSERTTIMEOPT(a) /*empty*/
202 
203 #undef NOTENAMEDISPLAY
204 #define NOTENAMEDISPLAY(a) a,
206  #include "editing_syms.inc.h"
207 };
208 
209 extern const char *notenamedisplaystrs[];
210 inline const char* enum2str(NoteNameDisplay m) {return notenamedisplaystrs[m];}
211 
212 #undef NOTENAMEDISPLAY
213 #define NOTENAMEDISPLAY(a) /*empty*/
214 
215 #undef MARKERCLICKBEHAVIOR
216 #define MARKERCLICKBEHAVIOR(a) a,
218  #include "editing_syms.inc.h"
219 };
220 #undef MARKERCLICKBEHAVIOR
221 #define MARKERCLICKBEHAVIOR(a) /*empty*/
222 
223 extern const char *markerclickbehaviorstrs[];
224 inline const char* enum2str(MarkerClickBehavior m) {return markerclickbehaviorstrs[m];}
226 
227 #undef REGIONEDITDISPOSITION
228 #define REGIONEDITDISPOSITION(a) a,
230  #include "editing_syms.inc.h"
231 };
232 
233 extern const char *regioneditdispositionstrs[];
234 inline const char* enum2str(RegionEditDisposition red) {return regioneditdispositionstrs[red];}
235 
236 #undef REGIONEDITDISPOSITION
237 #define REGIONEDITDISPOSITION(a) /*empty*/
238 
240 // These don't need their state saved. yet...
241 enum CutCopyOp {
245  Clear
246 };
247 
248 enum XFadeType {
251  At
252 };
253 
259 };
260 
261 enum ZoomAxis {
264  Both
265 };
266 
271  ListSelection = 0x8
272 };
273 
274 } // namespace Editing
275 
ZoomAxis
Definition: editing.h:261
@ Horizontal
Definition: editing.h:263
@ Vertical
Definition: editing.h:262
@ Both
Definition: editing.h:264
CutCopyOp
Definition: editing.h:241
@ Copy
Definition: editing.h:244
@ Clear
Definition: editing.h:245
@ Cut
Definition: editing.h:243
@ Delete
Definition: editing.h:242
ImportDisposition
Definition: editing.h:176
const char * displaycontrolstrs[]
EditPoint
Definition: editing.h:186
const char * notenamedisplaystrs[]
SnapMode
Definition: editing.h:71
const char * snapmodestrs[]
InsertTimeOption
Definition: editing.h:196
ImportMode
Definition: editing.h:156
const char * markerclickbehaviorstrs[]
DisplayControl str2displaycontrol(const std::string &)
ZoomFocus str2zoomfocus(const std::string &)
DisplayControl
Definition: editing.h:141
GridType
Definition: editing.h:53
RegionEditDisposition
Definition: editing.h:229
SnapMode str2snapmode(const std::string &)
EditIgnoreOption
Definition: editing.h:254
@ EDIT_IGNORE_MARKER
Definition: editing.h:258
@ EDIT_IGNORE_MOUSE
Definition: editing.h:257
@ EDIT_IGNORE_PHEAD
Definition: editing.h:256
@ EDIT_IGNORE_NONE
Definition: editing.h:255
MidiEditMode
Definition: editing.h:113
const char * zoomfocusstrs[]
MidiEditMode str2midieditmode(const std::string &)
NoteNameDisplay
Definition: editing.h:205
XFadeType
Definition: editing.h:248
@ At
Definition: editing.h:251
@ Post
Definition: editing.h:250
@ Pre
Definition: editing.h:249
RegionListSortType str2regionlistsorttype(const std::string &)
GridType str2gridtype(const std::string &)
const char * regioneditdispositionstrs[]
RegionListSortType
Definition: editing.h:85
const char * gridtypestrs[]
MarkerClickBehavior
Definition: editing.h:217
ZoomFocus
Definition: editing.h:127
MarkerClickBehavior str2markerclickbehavior(const std::string &)
const char * enum2str(GridType m)
Definition: editing.h:62
const char * regionlistsorttypestrs[]
const char * midieditmodestrs[]
static const int DRAW_VEL_AUTO
Definition: editing.h:57
const char * mousemodestrs[]
static const GridType DRAW_LEN_AUTO
Definition: editing.h:59
ImportPosition
Definition: editing.h:166
MouseMode str2mousemode(const std::string &)
static const int DRAW_CHAN_AUTO
Definition: editing.h:58
RegionActionTarget
Definition: editing.h:267
@ EnteredRegions
Definition: editing.h:269
@ SelectedRegions
Definition: editing.h:268
@ ListSelection
Definition: editing.h:271
@ EditPointRegions
Definition: editing.h:270
MouseMode
Definition: editing.h:99