Merged with trunk R1141
[ardour.git] / gtk2_ardour / editing.cc
1 #include <string>
2
3 #include "editing.h"
4
5 #include "i18n.h"
6
7 using namespace std;
8
9 // This involves some cpp magic. --taybin
10
11 #define SNAPTYPE(a) /*empty*/
12 #define SNAPMODE(a) /*empty*/
13 #define REGIONLISTSORTTYPE(a) /*empty*/
14 #define MOUSEMODE(a) /*empty*/
15 #define ZOOMFOCUS(a) /*empty*/
16 #define DISPLAYCONTROL(a) /*empty*/
17
18 namespace Editing {
19
20 // SNAPTYPE
21 #undef SNAPTYPE
22 #define SNAPTYPE(s) if (!strcmp(type, #s)) {return s;}
23 SnapType
24 str2snaptype (const string & str) {
25         const char* type = str.c_str();
26         #include "editing_syms.h"
27         return SnapToBar;
28 }
29
30 #undef SNAPTYPE
31 #define SNAPTYPE(s) N_(#s),
32 const char *snaptypestrs[] = {
33         #include "editing_syms.h"
34         0
35 };
36 #undef SNAPTYPE
37 #define SNAPTYPE(a) /*empty*/
38
39 // SNAPMODE
40 #undef SNAPMODE
41 #define SNAPMODE(s) if (!strcmp(type, #s)) {return s;}
42 SnapMode
43 str2snapmode (const string & str) {
44         const char* type = str.c_str();
45         #include "editing_syms.h"
46         return SnapNormal;
47 }
48
49 #undef SNAPMODE
50 #define SNAPMODE(s) N_(#s),
51 const char *snapmodestrs[] = {
52         #include "editing_syms.h"
53         0
54 };
55 #undef SNAPMODE
56 #define SNAPMODE(a) /*empty*/
57
58
59 // REGIONLISTSORTTYPE
60 #undef REGIONLISTSORTTYPE
61 #define REGIONLISTSORTTYPE(s) if (!strcmp(type, #s)) {return s;}
62 RegionListSortType
63 str2regionlistsorttype (const string & str) {
64         const char* type = str.c_str();
65         #include "editing_syms.h"
66         return ByName;
67 }
68
69 #undef REGIONLISTSORTTYPE
70 #define REGIONLISTSORTTYPE(s) N_(#s),
71 const char *regionlistsorttypestrs[] = {
72         #include "editing_syms.h"
73         0
74 };
75 #undef REGIONLISTSORTTYPE
76 #define REGIONLISTSORTTYPE(a) /*empty*/
77
78 // MOUSEMODE
79 #undef MOUSEMODE
80 #define MOUSEMODE(s) if (!strcmp(type, #s)) {return s;}
81 MouseMode
82 str2mousemode (const string & str) {
83         const char* type = str.c_str();
84         #include "editing_syms.h"
85         return MouseObject;
86 }
87
88 #undef MOUSEMODE
89 #define MOUSEMODE(s) N_(#s),
90 const char *mousemodestrs[] = {
91         #include "editing_syms.h"
92         0
93 };
94 #undef MOUSEMODE
95 #define MOUSEMODE(a) /*empty*/
96
97 // ZOOMFOCUS
98 #undef ZOOMFOCUS
99 #define ZOOMFOCUS(s) if (!strcmp(type, #s)) {return s;}
100 ZoomFocus
101 str2zoomfocus (const string & str) {
102         const char* type = str.c_str();
103         #include "editing_syms.h"
104         return ZoomFocusPlayhead;
105 }
106
107 #undef ZOOMFOCUS
108 #define ZOOMFOCUS(s) N_(#s),
109 const char *zoomfocusstrs[] = {
110         #include "editing_syms.h"
111         0
112 };
113 #undef ZOOMFOCUS
114 #define ZOOMFOCUS(a) /*empty*/
115
116 // DISPLAYCONTROL
117 #undef DISPLAYCONTROL
118 #define DISPLAYCONTROL(s) if (!strcmp(type, #s)) {return s;}
119 DisplayControl
120 str2displaycontrol (const string & str) {
121         const char* type = str.c_str();
122         #include "editing_syms.h"
123         return FollowPlayhead;
124 }
125
126 #undef DISPLAYCONTROL
127 #define DISPLAYCONTROL(s) N_(#s),
128 const char *displaycontrolstrs[] = {
129         #include "editing_syms.h"
130         0
131 };
132 #undef DISPLAYCONTROL
133 #define DISPLAYCONTROL(a) /*empty*/
134
135 //IMPORTMODE
136 #undef IMPORTMODE
137 #define IMPORTMODE(s) N_(#s),
138 const char *importmodestrs[] = {
139         #include "editing_syms.h"
140         0
141 };
142 #undef IMPORTMODE
143 #define IMPORTMODE(a) /*empty*/
144
145 } // namespace Editing
146