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