Fix MIDI disk-writer flush
[ardour.git] / gtk2_ardour / editing.h
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 #ifndef __gtk_ardour_editing_h__
22 #define __gtk_ardour_editing_h__
23
24 #include <string>
25 #include <map>
26 #include "ardour/types.h"
27
28 // This involves some cpp magic. --taybin
29
30 #define GRIDTYPE(a) /*empty*/
31 #define SNAPMODE(a) /*empty*/
32 #define REGIONLISTSORTTYPE(a) /*empty*/
33 #define MOUSEMODE(a) /*empty*/
34 #define MIDIEDITMODE(a) /*empty*/
35 #define ZOOMFOCUS(a) /*empty*/
36 #define DISPLAYCONTROL(a) /*empty*/
37 #define IMPORTMODE(a) /*empty*/
38 #define IMPORTPOSITION(a)
39 #define IMPORTDISPOSITION(a)
40 #define EDITPOINT(a) /*empty*/
41 #define WAVEFORMSCALE(a) /*empty*/
42 #define WAVEFORMSHAPE(a) /*empty*/
43 #define INSERTTIMEOPT(a) /*empty*/
44
45 namespace Editing {
46
47 // GRIDTYPE
48 #undef GRIDTYPE
49 #define GRIDTYPE(a) a,
50 enum GridType {
51         #include "editing_syms.h"
52 };
53
54 extern const char *gridtypestrs[];
55 inline const char* enum2str(GridType m) {return gridtypestrs[m];}
56 GridType str2gridtype(const std::string &);
57
58 #undef GRIDTYPE
59 #define GRIDTYPE(a) /*empty*/
60
61 // SNAPMODE
62 #undef SNAPMODE
63 #define SNAPMODE(a) a,
64 enum SnapMode {
65         #include "editing_syms.h"
66 };
67
68 extern const char *snapmodestrs[];
69 inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
70 SnapMode str2snapmode(const std::string &);
71
72 #undef SNAPMODE
73 #define SNAPMODE(a) /*empty*/
74
75 // REGIONLISTSORTTYPE
76 #undef REGIONLISTSORTTYPE
77 #define REGIONLISTSORTTYPE(a) a,
78 enum RegionListSortType {
79         #include "editing_syms.h"
80 };
81
82 extern const char *regionlistsorttypestrs[];
83 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
84 RegionListSortType str2regionlistsorttype(const std::string &);
85
86 #undef REGIONLISTSORTTYPE
87 #define REGIONLISTSORTTYPE(a) /*empty*/
88
89 // MOUSEMODE
90 #undef MOUSEMODE
91 #define MOUSEMODE(a) a,
92 enum MouseMode {
93         #include "editing_syms.h"
94 };
95
96 extern const char *mousemodestrs[];
97 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
98 MouseMode str2mousemode(const std::string &);
99
100 #undef MOUSEMODE
101 #define MOUSEMODE(a) /*empty*/
102
103 // MIDIEDITMODE
104 #undef MIDIEDITMODE
105 #define MIDIEDITMODE(a) a,
106 enum MidiEditMode {
107         #include "editing_syms.h"
108 };
109
110 extern const char *midieditmodestrs[];
111 inline const char* enum2str(MidiEditMode m) {return midieditmodestrs[m];}
112 MidiEditMode str2midieditmode(const std::string &);
113
114 #undef MIDIEDITMODE
115 #define MIDIEDITMODE(a) /*empty*/
116
117 // ZOOMFOCUS
118 #undef ZOOMFOCUS
119 #define ZOOMFOCUS(a) a,
120 enum ZoomFocus {
121         #include "editing_syms.h"
122 };
123
124 extern const char *zoomfocusstrs[];
125 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
126 ZoomFocus str2zoomfocus(const std::string &);
127
128 #undef ZOOMFOCUS
129 #define ZOOMFOCUS(a) /*empty*/
130
131 // DISPLAYCONTROL
132 #undef DISPLAYCONTROL
133 #define DISPLAYCONTROL(a) a,
134 enum DisplayControl {
135         #include "editing_syms.h"
136 };
137
138 extern const char *displaycontrolstrs[];
139 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
140 DisplayControl str2displaycontrol (const std::string &);
141
142 #undef DISPLAYCONTROL
143 #define DISPLAYCONTROL(a) /*empty*/
144
145
146 // IMPORTMODE
147 #undef IMPORTMODE
148 #define IMPORTMODE(a) a,
149 enum ImportMode {
150         #include "editing_syms.h"
151 };
152
153 #undef IMPORTMODE
154 #define IMPORTMODE(a) /*empty*/
155
156 // IMPORTPOSITION
157 #undef IMPORTPOSITION
158 #define IMPORTPOSITION(a) a,
159 enum ImportPosition {
160         #include "editing_syms.h"
161 };
162
163 #undef IMPORTPOSITION
164 #define IMPORTPOSITION(a) /*empty*/
165
166 // IMPORTDISPOSITION
167 #undef IMPORTDISPOSITION
168 #define IMPORTDISPOSITION(a) a,
169 enum ImportDisposition {
170         #include "editing_syms.h"
171 };
172
173 #undef IMPORTDISPOSITION
174 #define IMPORTDISPOSITION(a) /*empty*/
175
176 // EDITPOINT
177 #undef EDITPOINT
178 #define EDITPOINT(a) a,
179 enum EditPoint {
180         #include "editing_syms.h"
181 };
182
183 #undef EDITPOINT
184 #define EDITPOINT(a) /*empty*/
185
186 // INSERTTIMEOPT
187 #undef INSERTTIMEOPT
188 #define INSERTTIMEOPT(a) a,
189 enum InsertTimeOption {
190         #include "editing_syms.h"
191 };
192
193 #undef INSERTTIMEOPT
194 #define INSERTTIMEOPT(a) /*empty*/
195
196
197 /////////////////////
198 // These don't need their state saved. yet...
199 enum CutCopyOp {
200         Delete,
201         Cut,
202         Copy,
203         Clear
204 };
205
206 enum XFadeType {
207         Pre,
208         Post,
209         At
210 };
211
212 enum EditIgnoreOption {
213         EDIT_IGNORE_NONE,
214         EDIT_IGNORE_PHEAD,
215         EDIT_IGNORE_MOUSE,
216         EDIT_IGNORE_MARKER
217 };
218
219 enum ZoomAxis {
220         Vertical,
221         Horizontal,
222         Both
223 };
224
225 enum RegionActionTarget {
226         SelectedRegions = 0x1,
227         EnteredRegions = 0x2,
228         EditPointRegions = 0x4,
229         ListSelection = 0x8
230 };
231
232 } // namespace Editing
233
234 #endif // __gtk_ardour_editing_h__