fixup auto-connection of new MIDI tracks and MIDI tracks with newly-added audio ports
[ardour2.git] / gtk2_ardour / editing.cc
blob486808065e28ed9b11b0de10d415ca837346a100
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>
21 #include <cstring>
23 #include "editing.h"
25 #include "i18n.h"
27 using namespace std;
29 // This involves some cpp magic. --taybin
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*/
39 namespace Editing {
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;
51 #undef SNAPTYPE
52 #define SNAPTYPE(s) N_(#s),
53 const char *snaptypestrs[] = {
54 #include "editing_syms.h"
57 #undef SNAPTYPE
58 #define SNAPTYPE(a) /*empty*/
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;
70 #undef SNAPMODE
71 #define SNAPMODE(s) N_(#s),
72 const char *snapmodestrs[] = {
73 #include "editing_syms.h"
76 #undef SNAPMODE
77 #define SNAPMODE(a) /*empty*/
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;
90 #undef REGIONLISTSORTTYPE
91 #define REGIONLISTSORTTYPE(s) N_(#s),
92 const char *regionlistsorttypestrs[] = {
93 #include "editing_syms.h"
96 #undef REGIONLISTSORTTYPE
97 #define REGIONLISTSORTTYPE(a) /*empty*/
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;
109 #undef MOUSEMODE
110 #define MOUSEMODE(s) N_(#s),
111 const char *mousemodestrs[] = {
112 #include "editing_syms.h"
115 #undef MOUSEMODE
116 #define MOUSEMODE(a) /*empty*/
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;
128 #undef ZOOMFOCUS
129 #define ZOOMFOCUS(s) N_(#s),
130 const char *zoomfocusstrs[] = {
131 #include "editing_syms.h"
134 #undef ZOOMFOCUS
135 #define ZOOMFOCUS(a) /*empty*/
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;
147 #undef DISPLAYCONTROL
148 #define DISPLAYCONTROL(s) N_(#s),
149 const char *displaycontrolstrs[] = {
150 #include "editing_syms.h"
153 #undef DISPLAYCONTROL
154 #define DISPLAYCONTROL(a) /*empty*/
156 //IMPORTMODE
157 #undef IMPORTMODE
158 #define IMPORTMODE(s) N_(#s),
159 const char *importmodestrs[] = {
160 #include "editing_syms.h"
163 #undef IMPORTMODE
164 #define IMPORTMODE(a) /*empty*/
166 } // namespace Editing