the missing flush call for plugins
[ardour2.git] / gtk2_ardour / editing.cc
blob0bd0e3a6e26e1127ae0201e9a09640e29ac456aa
1 /*
2 Copyright (C) 2000-2007 Paul Davis
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.
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.
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.
20 #include <cstring>
22 #include "editing.h"
24 #include "i18n.h"
26 using namespace std;
28 // This involves some cpp magic. --taybin
30 #define SNAPTYPE(a) /*empty*/
31 #define SNAPMODE(a) /*empty*/
32 #define REGIONLISTSORTTYPE(a) /*empty*/
33 #define MOUSEMODE(a) /*empty*/
34 #define ZOOMFOCUS(a) /*empty*/
35 #define DISPLAYCONTROL(a) /*empty*/
37 namespace Editing {
39 // SNAPTYPE
40 #undef SNAPTYPE
41 #define SNAPTYPE(s) if (!strcmp(type, #s)) {return s;}
42 SnapType
43 str2snaptype (const string & str) {
44 const char* type = str.c_str();
45 #include "editing_syms.h"
46 return SnapToBar;
49 #undef SNAPTYPE
50 #define SNAPTYPE(s) N_(#s),
51 const char *snaptypestrs[] = {
52 #include "editing_syms.h"
55 #undef SNAPTYPE
56 #define SNAPTYPE(a) /*empty*/
58 // SNAPMODE
59 #undef SNAPMODE
60 #define SNAPMODE(s) if (!strcmp(type, #s)) {return s;}
61 SnapMode
62 str2snapmode (const string & str) {
63 const char* type = str.c_str();
64 #include "editing_syms.h"
65 return SnapNormal;
68 #undef SNAPMODE
69 #define SNAPMODE(s) N_(#s),
70 const char *snapmodestrs[] = {
71 #include "editing_syms.h"
74 #undef SNAPMODE
75 #define SNAPMODE(a) /*empty*/
78 // REGIONLISTSORTTYPE
79 #undef REGIONLISTSORTTYPE
80 #define REGIONLISTSORTTYPE(s) if (!strcmp(type, #s)) {return s;}
81 RegionListSortType
82 str2regionlistsorttype (const string & str) {
83 const char* type = str.c_str();
84 #include "editing_syms.h"
85 return ByName;
88 #undef REGIONLISTSORTTYPE
89 #define REGIONLISTSORTTYPE(s) N_(#s),
90 const char *regionlistsorttypestrs[] = {
91 #include "editing_syms.h"
94 #undef REGIONLISTSORTTYPE
95 #define REGIONLISTSORTTYPE(a) /*empty*/
97 // MOUSEMODE
98 #undef MOUSEMODE
99 #define MOUSEMODE(s) if (!strcmp(type, #s)) {return s;}
100 MouseMode
101 str2mousemode (const string & str) {
102 const char* type = str.c_str();
103 #include "editing_syms.h"
104 return MouseObject;
107 #undef MOUSEMODE
108 #define MOUSEMODE(s) N_(#s),
109 const char *mousemodestrs[] = {
110 #include "editing_syms.h"
113 #undef MOUSEMODE
114 #define MOUSEMODE(a) /*empty*/
116 // ZOOMFOCUS
117 #undef ZOOMFOCUS
118 #define ZOOMFOCUS(s) if (!strcmp(type, #s)) {return s;}
119 ZoomFocus
120 str2zoomfocus (const string & str) {
121 const char* type = str.c_str();
122 #include "editing_syms.h"
123 return ZoomFocusPlayhead;
126 #undef ZOOMFOCUS
127 #define ZOOMFOCUS(s) N_(#s),
128 const char *zoomfocusstrs[] = {
129 #include "editing_syms.h"
132 #undef ZOOMFOCUS
133 #define ZOOMFOCUS(a) /*empty*/
135 // DISPLAYCONTROL
136 #undef DISPLAYCONTROL
137 #define DISPLAYCONTROL(s) if (!strcmp(type, #s)) {return s;}
138 DisplayControl
139 str2displaycontrol (const string & str) {
140 const char* type = str.c_str();
141 #include "editing_syms.h"
142 return FollowPlayhead;
145 #undef DISPLAYCONTROL
146 #define DISPLAYCONTROL(s) N_(#s),
147 const char *displaycontrolstrs[] = {
148 #include "editing_syms.h"
151 #undef DISPLAYCONTROL
152 #define DISPLAYCONTROL(a) /*empty*/
155 } // namespace Editing