2 * Copyright (C) 2006 Paul Davis
3 * Copyright (C) 2007 Michael Taht
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #define __STDC_FORMAT_MACROS
30 #include "ardour/route.h"
31 #include "ardour/audio_track.h"
32 #include "ardour/session.h"
33 #include "ardour/location.h"
34 #include "ardour/dB.h"
36 using namespace ARDOUR;
43 #include "pbd/abstract_ui.cc"
45 #include "tranzport_control_protocol.h"
48 // FIXME: How to handle multiple tranzports in a system?
51 TranzportControlProtocol::get_state ()
53 return ControlProtocol::get_state();
57 TranzportControlProtocol::set_state (const XMLNode& node)
59 cout << "TranzportControlProtocol::set_state: active " << _active << endl;
62 // I think I want to make these strings rather than numbers
64 // fetch current display mode
65 if ( node.property( X_("display_mode") ) != 0 )
67 string display = node.property( X_("display_mode") )->value();
71 int32_t new_display = atoi( display.c_str() );
72 if ( display_mode != new_display ) display_mode = (DisplayMode)new_display;
74 catch ( exception & e )
76 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
81 if ( node.property( X_("wheel_mode") ) != 0 )
83 string wheel = node.property( X_("wheel_mode") )->value();
86 int32_t new_wheel = atoi( wheel.c_str() );
87 if ( wheel_mode != new_wheel ) wheel_mode = (WheelMode) new_wheel;
89 catch ( exception & e )
91 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
96 // fetch current bling mode
97 if ( node.property( X_("bling") ) != 0 )
99 string bling = node.property( X_("bling_mode") )->value();
102 int32_t new_bling = atoi( bling.c_str() );
103 if ( bling_mode != new_bling ) bling_mode = (BlingMode) new_bling;
105 catch ( exception & e )
107 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
117 // These are intended for the day we have more options for tranzport modes
118 // And perhaps we could load up sessions this way, too
121 TranzportControlProtocol::save (char *name)
123 // Presently unimplemented
128 TranzportControlProtocol::load (char *name)
130 // Presently unimplemented
135 TranzportControlProtocol::save_config (char *name)
137 // Presently unimplemented
142 TranzportControlProtocol::load_config (char *name)
144 // Presently unimplemented