merge with 2.0-ongoing @ rev 3147
[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 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
43 namespace Editing {
44
45 // SNAPTYPE
46 #undef SNAPTYPE
47 #define SNAPTYPE(a) a,
48 enum SnapType {
49         #include "editing_syms.h"
50 };
51
52 extern const char *snaptypestrs[];
53 inline const char* enum2str(SnapType m) {return snaptypestrs[m];}
54 SnapType str2snaptype(const std::string &);
55
56 #undef SNAPTYPE
57 #define SNAPTYPE(a) /*empty*/
58
59 // SNAPMODE
60 #undef SNAPMODE
61 #define SNAPMODE(a) a,
62 enum SnapMode {
63         #include "editing_syms.h"
64 };
65
66 extern const char *snapmodestrs[];
67 inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
68 SnapMode str2snapmode(const std::string &);
69
70 #undef SNAPMODE
71 #define SNAPMODE(a) /*empty*/
72
73 // REGIONLISTSORTTYPE
74 #undef REGIONLISTSORTTYPE
75 #define REGIONLISTSORTTYPE(a) a,
76 enum RegionListSortType {
77         #include "editing_syms.h"
78 };
79
80 extern const char *regionlistsorttypestrs[];
81 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
82 RegionListSortType str2regionlistsorttype(const std::string &);
83
84 #undef REGIONLISTSORTTYPE
85 #define REGIONLISTSORTTYPE(a) /*empty*/
86
87 // MOUSEMODE
88 #undef MOUSEMODE
89 #define MOUSEMODE(a) a,
90 enum MouseMode {
91         #include "editing_syms.h"
92 };
93
94 extern const char *mousemodestrs[];
95 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
96 MouseMode str2mousemode(const std::string &);
97
98 #undef MOUSEMODE
99 #define MOUSEMODE(a) /*empty*/
100
101 // MIDIEDITMODE
102 #undef MIDIEDITMODE
103 #define MIDIEDITMODE(a) a,
104 enum MidiEditMode {
105         #include "editing_syms.h"
106 };
107
108 extern const char *midieditmodestrs[];
109 inline const char* enum2str(MidiEditMode m) {return midieditmodestrs[m];}
110 MidiEditMode str2midieditmode(const std::string &);
111
112 #undef MIDIEDITMODE
113 #define MIDIEDITMODE(a) /*empty*/
114
115 // ZOOMFOCUS
116 #undef ZOOMFOCUS
117 #define ZOOMFOCUS(a) a,
118 enum ZoomFocus {
119         #include "editing_syms.h"
120 };
121
122 extern const char *zoomfocusstrs[];
123 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
124 ZoomFocus str2zoomfocus(const std::string &);
125
126 #undef ZOOMFOCUS
127 #define ZOOMFOCUS(a) /*empty*/
128
129 // DISPLAYCONTROL
130 #undef DISPLAYCONTROL
131 #define DISPLAYCONTROL(a) a,
132 enum DisplayControl {
133         #include "editing_syms.h"
134 };
135
136 extern const char *displaycontrolstrs[];
137 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
138 DisplayControl str2displaycontrol (const std::string &);
139
140 #undef DISPLAYCONTROL
141 #define DISPLAYCONTROL(a) /*empty*/
142
143
144 // IMPORTMODE
145 #undef IMPORTMODE
146 #define IMPORTMODE(a) a,
147 enum ImportMode {
148         #include "editing_syms.h"
149 };
150
151 #undef IMPORTMODE
152 #define IMPORTMODE(a) /*empty*/
153
154 // IMPORTPOSITION
155 #undef IMPORTPOSITION
156 #define IMPORTPOSITION(a) a,
157 enum ImportPosition {
158         #include "editing_syms.h"
159 };
160
161 #undef IMPORTPOSITION
162 #define IMPORTPOSITION(a) /*empty*/
163
164 // IMPORTDISPOSITION
165 #undef IMPORTDISPOSITION
166 #define IMPORTDISPOSITION(a) a,
167 enum ImportDisposition {
168         #include "editing_syms.h"
169 };
170
171 #undef IMPORTDISPOSITION
172 #define IMPORTDISPOSITION(a) /*empty*/
173
174 // EDITPOINT
175 #undef EDITPOINT
176 #define EDITPOINT(a) a,
177 enum EditPoint {
178         #include "editing_syms.h"
179 };
180
181 #undef EDITPOINT
182 #define EDITPOINT(a) /*empty*/
183
184 // WAVEFORMSCALE
185 #undef WAVEFORMSCALE
186 #define WAVEFORMSCALE(a) a,
187 enum WaveformScale {
188         #include "editing_syms.h"
189 };
190
191 #undef WAVEFORMSCALE
192 #define WAVEFORMSCALE(a) /*empty*/
193
194
195 // WAVEFORMSHAPE
196 #undef WAVEFORMSHAPE
197 #define WAVEFORMSHAPE(a) a,
198 enum WaveformShape {
199         #include "editing_syms.h"
200 };
201
202 #undef WAVEFORMSHAPE
203 #define WAVEFORMSHAPE(a) /*empty*/
204
205 /////////////////////
206 // These don't need their state saved. yet...
207 enum CutCopyOp {
208         Cut,
209         Copy,
210         Clear
211 };
212
213 enum XFadeType {
214         Pre,
215         Post,
216         At
217 };
218
219 } // namespace Editing
220
221 #endif // __gtk_ardour_editing_h__