Relative snap
[ardour.git] / gtk2_ardour / editing.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __gtk_ardour_editing_h__
21 #define __gtk_ardour_editing_h__
22
23 #include <string>
24 #include <map>
25 #include "ardour/types.h"
26
27 // This involves some cpp magic. --taybin
28
29 #define SNAPTYPE(a) /*empty*/
30 #define SNAPMODE(a) /*empty*/
31 #define SNAPDELTA(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 // SNAPTYPE
48 #undef SNAPTYPE
49 #define SNAPTYPE(a) a,
50 enum SnapType {
51         #include "editing_syms.h"
52 };
53
54 extern const char *snaptypestrs[];
55 inline const char* enum2str(SnapType m) {return snaptypestrs[m];}
56 SnapType str2snaptype(const std::string &);
57
58 #undef SNAPTYPE
59 #define SNAPTYPE(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 // SNAPDELTA
76 #undef SNAPDELTA
77 #define SNAPDELTA(a) a,
78 enum SnapDelta {
79         #include "editing_syms.h"
80 };
81 extern const char *snapdeltastrs[];
82 inline const char* enum2str(SnapDelta m) {return snapdeltastrs[m];}
83 SnapDelta str2snapdelta(const std::string &);
84
85 #undef SNAPDELTA
86 #define SNAPDELTA(a) /*empty*/
87
88 // REGIONLISTSORTTYPE
89 #undef REGIONLISTSORTTYPE
90 #define REGIONLISTSORTTYPE(a) a,
91 enum RegionListSortType {
92         #include "editing_syms.h"
93 };
94
95 extern const char *regionlistsorttypestrs[];
96 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
97 RegionListSortType str2regionlistsorttype(const std::string &);
98
99 #undef REGIONLISTSORTTYPE
100 #define REGIONLISTSORTTYPE(a) /*empty*/
101
102 // MOUSEMODE
103 #undef MOUSEMODE
104 #define MOUSEMODE(a) a,
105 enum MouseMode {
106         #include "editing_syms.h"
107 };
108
109 extern const char *mousemodestrs[];
110 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
111 MouseMode str2mousemode(const std::string &);
112
113 #undef MOUSEMODE
114 #define MOUSEMODE(a) /*empty*/
115
116 // MIDIEDITMODE
117 #undef MIDIEDITMODE
118 #define MIDIEDITMODE(a) a,
119 enum MidiEditMode {
120         #include "editing_syms.h"
121 };
122
123 extern const char *midieditmodestrs[];
124 inline const char* enum2str(MidiEditMode m) {return midieditmodestrs[m];}
125 MidiEditMode str2midieditmode(const std::string &);
126
127 #undef MIDIEDITMODE
128 #define MIDIEDITMODE(a) /*empty*/
129
130 // ZOOMFOCUS
131 #undef ZOOMFOCUS
132 #define ZOOMFOCUS(a) a,
133 enum ZoomFocus {
134         #include "editing_syms.h"
135 };
136
137 extern const char *zoomfocusstrs[];
138 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
139 ZoomFocus str2zoomfocus(const std::string &);
140
141 #undef ZOOMFOCUS
142 #define ZOOMFOCUS(a) /*empty*/
143
144 // DISPLAYCONTROL
145 #undef DISPLAYCONTROL
146 #define DISPLAYCONTROL(a) a,
147 enum DisplayControl {
148         #include "editing_syms.h"
149 };
150
151 extern const char *displaycontrolstrs[];
152 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
153 DisplayControl str2displaycontrol (const std::string &);
154
155 #undef DISPLAYCONTROL
156 #define DISPLAYCONTROL(a) /*empty*/
157
158
159 // IMPORTMODE
160 #undef IMPORTMODE
161 #define IMPORTMODE(a) a,
162 enum ImportMode {
163         #include "editing_syms.h"
164 };
165
166 #undef IMPORTMODE
167 #define IMPORTMODE(a) /*empty*/
168
169 // IMPORTPOSITION
170 #undef IMPORTPOSITION
171 #define IMPORTPOSITION(a) a,
172 enum ImportPosition {
173         #include "editing_syms.h"
174 };
175
176 #undef IMPORTPOSITION
177 #define IMPORTPOSITION(a) /*empty*/
178
179 // IMPORTDISPOSITION
180 #undef IMPORTDISPOSITION
181 #define IMPORTDISPOSITION(a) a,
182 enum ImportDisposition {
183         #include "editing_syms.h"
184 };
185
186 #undef IMPORTDISPOSITION
187 #define IMPORTDISPOSITION(a) /*empty*/
188
189 // EDITPOINT
190 #undef EDITPOINT
191 #define EDITPOINT(a) a,
192 enum EditPoint {
193         #include "editing_syms.h"
194 };
195
196 #undef EDITPOINT
197 #define EDITPOINT(a) /*empty*/
198
199 // INSERTTIMEOPT
200 #undef INSERTTIMEOPT
201 #define INSERTTIMEOPT(a) a,
202 enum InsertTimeOption {
203         #include "editing_syms.h"
204 };
205
206 #undef INSERTTIMEOPT
207 #define INSERTTIMEOPT(a) /*empty*/
208
209
210 /////////////////////
211 // These don't need their state saved. yet...
212 enum CutCopyOp {
213         Delete,
214         Cut,
215         Copy,
216         Clear
217 };
218
219 enum XFadeType {
220         Pre,
221         Post,
222         At
223 };
224
225 enum EditIgnoreOption {
226         EDIT_IGNORE_NONE,
227         EDIT_IGNORE_PHEAD,
228         EDIT_IGNORE_MOUSE,
229         EDIT_IGNORE_MARKER
230 };
231
232 } // namespace Editing
233
234 #endif // __gtk_ardour_editing_h__