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