enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git] / gtk2_ardour / editing.cc
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 #include <cstring>
21 #include <cstring>
22
23 #include "editing.h"
24
25 #include "pbd/i18n.h"
26
27 using namespace std;
28
29 // This involves some cpp magic. --taybin
30
31 #define SNAPTYPE(a) /*empty*/
32 #define SNAPMODE(a) /*empty*/
33 #define REGIONLISTSORTTYPE(a) /*empty*/
34 #define MOUSEMODE(a) /*empty*/
35 #define MIDIEDITMODE(a) /*empty*/
36 #define ZOOMFOCUS(a) /*empty*/
37 #define DISPLAYCONTROL(a) /*empty*/
38
39 namespace Editing {
40
41 // SNAPTYPE
42 #undef SNAPTYPE
43 #define SNAPTYPE(s) if (!strcmp(type, #s)) {return s;}
44 SnapType
45 str2snaptype (const string & str) {
46         const char* type = str.c_str();
47         #include "editing_syms.h"
48         return SnapToBar;
49 }
50
51 #undef SNAPTYPE
52 #define SNAPTYPE(s) N_(#s),
53 const char *snaptypestrs[] = {
54         #include "editing_syms.h"
55         0
56 };
57 #undef SNAPTYPE
58 #define SNAPTYPE(a) /*empty*/
59
60 // SNAPMODE
61 #undef SNAPMODE
62 #define SNAPMODE(s) if (!strcmp(type, #s)) {return s;}
63 SnapMode
64 str2snapmode (const string & str) {
65         const char* type = str.c_str();
66         #include "editing_syms.h"
67         return SnapNormal;
68 }
69
70 #undef SNAPMODE
71 #define SNAPMODE(s) N_(#s),
72 const char *snapmodestrs[] = {
73         #include "editing_syms.h"
74         0
75 };
76 #undef SNAPMODE
77 #define SNAPMODE(a) /*empty*/
78
79
80 // REGIONLISTSORTTYPE
81 #undef REGIONLISTSORTTYPE
82 #define REGIONLISTSORTTYPE(s) if (!strcmp(type, #s)) {return s;}
83 RegionListSortType
84 str2regionlistsorttype (const string & str) {
85         const char* type = str.c_str();
86         #include "editing_syms.h"
87         return ByName;
88 }
89
90 #undef REGIONLISTSORTTYPE
91 #define REGIONLISTSORTTYPE(s) N_(#s),
92 const char *regionlistsorttypestrs[] = {
93         #include "editing_syms.h"
94         0
95 };
96 #undef REGIONLISTSORTTYPE
97 #define REGIONLISTSORTTYPE(a) /*empty*/
98
99 // MOUSEMODE
100 #undef MOUSEMODE
101 #define MOUSEMODE(s) if (!strcmp(type, #s)) {return s;}
102 MouseMode
103 str2mousemode (const string & str) {
104         const char* type = str.c_str();
105         #include "editing_syms.h"
106         return MouseObject;
107 }
108
109 #undef MOUSEMODE
110 #define MOUSEMODE(s) N_(#s),
111 const char *mousemodestrs[] = {
112         #include "editing_syms.h"
113         0
114 };
115 #undef MOUSEMODE
116 #define MOUSEMODE(a) /*empty*/
117
118 // ZOOMFOCUS
119 #undef ZOOMFOCUS
120 #define ZOOMFOCUS(s) if (!strcmp(type, #s)) {return s;}
121 ZoomFocus
122 str2zoomfocus (const string & str) {
123         const char* type = str.c_str();
124         #include "editing_syms.h"
125         return ZoomFocusPlayhead;
126 }
127
128 #undef ZOOMFOCUS
129 #define ZOOMFOCUS(s) N_(#s),
130 const char *zoomfocusstrs[] = {
131         #include "editing_syms.h"
132         0
133 };
134 #undef ZOOMFOCUS
135 #define ZOOMFOCUS(a) /*empty*/
136
137 // DISPLAYCONTROL
138 #undef DISPLAYCONTROL
139 #define DISPLAYCONTROL(s) if (!strcmp(type, #s)) {return s;}
140 DisplayControl
141 str2displaycontrol (const string & str) {
142         const char* type = str.c_str();
143         #include "editing_syms.h"
144         return FollowPlayhead;
145 }
146
147 #undef DISPLAYCONTROL
148 #define DISPLAYCONTROL(s) N_(#s),
149 const char *displaycontrolstrs[] = {
150         #include "editing_syms.h"
151         0
152 };
153 #undef DISPLAYCONTROL
154 #define DISPLAYCONTROL(a) /*empty*/
155
156 //IMPORTMODE
157 #undef IMPORTMODE
158 #define IMPORTMODE(s) N_(#s),
159 const char *importmodestrs[] = {
160         #include "editing_syms.h"
161         0
162 };
163 #undef IMPORTMODE
164 #define IMPORTMODE(a) /*empty*/
165
166 } // namespace Editing
167