Ardour  9.0-pre0-582-g084a23a80d
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 
47 namespace Editing {
48 
49 // GRIDTYPE
50 #undef GRIDTYPE
51 #define GRIDTYPE(a) a,
52 enum GridType {
53  #include "editing_syms.inc.h"
54 };
55 
56 static const int DRAW_VEL_AUTO = -1;
57 static const int DRAW_CHAN_AUTO = -1;
58 static const GridType DRAW_LEN_AUTO = GridTypeNone; //special case: use the Grid's value instead of the note-length selection
59 
60 extern const char *gridtypestrs[];
61 inline const char* enum2str(GridType m) {return gridtypestrs[m];}
62 GridType str2gridtype(const std::string &);
63 
64 #undef GRIDTYPE
65 #define GRIDTYPE(a) /*empty*/
66 
67 // SNAPMODE
68 #undef SNAPMODE
69 #define SNAPMODE(a) a,
70 enum SnapMode {
71  #include "editing_syms.inc.h"
72 };
73 
74 extern const char *snapmodestrs[];
75 inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
76 SnapMode str2snapmode(const std::string &);
77 
78 #undef SNAPMODE
79 #define SNAPMODE(a) /*empty*/
80 
81 // REGIONLISTSORTTYPE
82 #undef REGIONLISTSORTTYPE
83 #define REGIONLISTSORTTYPE(a) a,
85  #include "editing_syms.inc.h"
86 };
87 
88 extern const char *regionlistsorttypestrs[];
89 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
91 
92 #undef REGIONLISTSORTTYPE
93 #define REGIONLISTSORTTYPE(a) /*empty*/
94 
95 // MOUSEMODE
96 #undef MOUSEMODE
97 #define MOUSEMODE(a) a,
98 enum MouseMode {
99  #include "editing_syms.inc.h"
100 };
101 
102 extern const char *mousemodestrs[];
103 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
104 MouseMode str2mousemode(const std::string &);
105 
106 #undef MOUSEMODE
107 #define MOUSEMODE(a) /*empty*/
108 
109 // MIDIEDITMODE
110 #undef MIDIEDITMODE
111 #define MIDIEDITMODE(a) a,
113  #include "editing_syms.inc.h"
114 };
115 
116 extern const char *midieditmodestrs[];
117 inline const char* enum2str(MidiEditMode m) {return midieditmodestrs[m];}
118 MidiEditMode str2midieditmode(const std::string &);
119 
120 #undef MIDIEDITMODE
121 #define MIDIEDITMODE(a) /*empty*/
122 
123 // ZOOMFOCUS
124 #undef ZOOMFOCUS
125 #define ZOOMFOCUS(a) a,
126 enum ZoomFocus {
127  #include "editing_syms.inc.h"
128 };
129 
130 extern const char *zoomfocusstrs[];
131 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
132 ZoomFocus str2zoomfocus(const std::string &);
133 
134 #undef ZOOMFOCUS
135 #define ZOOMFOCUS(a) /*empty*/
136 
137 // DISPLAYCONTROL
138 #undef DISPLAYCONTROL
139 #define DISPLAYCONTROL(a) a,
141  #include "editing_syms.inc.h"
142 };
143 
144 extern const char *displaycontrolstrs[];
145 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
146 DisplayControl str2displaycontrol (const std::string &);
147 
148 #undef DISPLAYCONTROL
149 #define DISPLAYCONTROL(a) /*empty*/
150 
151 
152 // IMPORTMODE
153 #undef IMPORTMODE
154 #define IMPORTMODE(a) a,
156  #include "editing_syms.inc.h"
157 };
158 
159 #undef IMPORTMODE
160 #define IMPORTMODE(a) /*empty*/
161 
162 // IMPORTPOSITION
163 #undef IMPORTPOSITION
164 #define IMPORTPOSITION(a) a,
166  #include "editing_syms.inc.h"
167 };
168 
169 #undef IMPORTPOSITION
170 #define IMPORTPOSITION(a) /*empty*/
171 
172 // IMPORTDISPOSITION
173 #undef IMPORTDISPOSITION
174 #define IMPORTDISPOSITION(a) a,
176  #include "editing_syms.inc.h"
177 };
178 
179 #undef IMPORTDISPOSITION
180 #define IMPORTDISPOSITION(a) /*empty*/
181 
182 // EDITPOINT
183 #undef EDITPOINT
184 #define EDITPOINT(a) a,
185 enum EditPoint {
186  #include "editing_syms.inc.h"
187 };
188 
189 #undef EDITPOINT
190 #define EDITPOINT(a) /*empty*/
191 
192 // INSERTTIMEOPT
193 #undef INSERTTIMEOPT
194 #define INSERTTIMEOPT(a) a,
196  #include "editing_syms.inc.h"
197 };
198 
199 #undef INSERTTIMEOPT
200 #define INSERTTIMEOPT(a) /*empty*/
201 
202 #undef NOTENAMEDISPLAY
203 #define NOTENAMEDISPLAY(a) a,
205  #include "editing_syms.inc.h"
206 };
207 
208 extern const char *notenamedisplaystrs[];
209 inline const char* enum2str(NoteNameDisplay m) {return notenamedisplaystrs[m];}
210 
211 #undef NOTENAMEDISPLAY
212 #define NOTENAMEDISPLAY(a) /*empty*/
213 
214 #undef MARKERCLICKBEHAVIOR
215 #define MARKERCLICKBEHAVIOR(a) a,
217  #include "editing_syms.inc.h"
218 };
219 #undef MARKERCLICKBEHAVIOR
220 #define MARKERCLICKBEHAVIOR(a) /*empty*/
221 
222 extern const char *markerclickbehaviorstrs[];
223 inline const char* enum2str(MarkerClickBehavior m) {return markerclickbehaviorstrs[m];}
225 
227 // These don't need their state saved. yet...
228 enum CutCopyOp {
232  Clear
233 };
234 
235 enum XFadeType {
238  At
239 };
240 
246 };
247 
248 enum ZoomAxis {
251  Both
252 };
253 
258  ListSelection = 0x8
259 };
260 
261 } // namespace Editing
262 
ZoomAxis
Definition: editing.h:248
@ Horizontal
Definition: editing.h:250
@ Vertical
Definition: editing.h:249
@ Both
Definition: editing.h:251
CutCopyOp
Definition: editing.h:228
@ Copy
Definition: editing.h:231
@ Clear
Definition: editing.h:232
@ Cut
Definition: editing.h:230
@ Delete
Definition: editing.h:229
ImportDisposition
Definition: editing.h:175
const char * displaycontrolstrs[]
EditPoint
Definition: editing.h:185
const char * notenamedisplaystrs[]
SnapMode
Definition: editing.h:70
const char * snapmodestrs[]
InsertTimeOption
Definition: editing.h:195
ImportMode
Definition: editing.h:155
const char * markerclickbehaviorstrs[]
DisplayControl str2displaycontrol(const std::string &)
ZoomFocus str2zoomfocus(const std::string &)
DisplayControl
Definition: editing.h:140
GridType
Definition: editing.h:52
SnapMode str2snapmode(const std::string &)
EditIgnoreOption
Definition: editing.h:241
@ EDIT_IGNORE_MARKER
Definition: editing.h:245
@ EDIT_IGNORE_MOUSE
Definition: editing.h:244
@ EDIT_IGNORE_PHEAD
Definition: editing.h:243
@ EDIT_IGNORE_NONE
Definition: editing.h:242
MidiEditMode
Definition: editing.h:112
const char * zoomfocusstrs[]
MidiEditMode str2midieditmode(const std::string &)
NoteNameDisplay
Definition: editing.h:204
XFadeType
Definition: editing.h:235
@ At
Definition: editing.h:238
@ Post
Definition: editing.h:237
@ Pre
Definition: editing.h:236
RegionListSortType str2regionlistsorttype(const std::string &)
GridType str2gridtype(const std::string &)
RegionListSortType
Definition: editing.h:84
const char * gridtypestrs[]
MarkerClickBehavior
Definition: editing.h:216
ZoomFocus
Definition: editing.h:126
MarkerClickBehavior str2markerclickbehavior(const std::string &)
const char * enum2str(GridType m)
Definition: editing.h:61
const char * regionlistsorttypestrs[]
const char * midieditmodestrs[]
static const int DRAW_VEL_AUTO
Definition: editing.h:56
const char * mousemodestrs[]
static const GridType DRAW_LEN_AUTO
Definition: editing.h:58
ImportPosition
Definition: editing.h:165
MouseMode str2mousemode(const std::string &)
static const int DRAW_CHAN_AUTO
Definition: editing.h:57
RegionActionTarget
Definition: editing.h:254
@ EnteredRegions
Definition: editing.h:256
@ SelectedRegions
Definition: editing.h:255
@ ListSelection
Definition: editing.h:258
@ EditPointRegions
Definition: editing.h:257
MouseMode
Definition: editing.h:98