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 XMLNode* node = new XMLNode (X_("Protocol"));
54 node->add_property (X_("name"), _name);
59 TranzportControlProtocol::set_state (const XMLNode& node)
61 cout << "TranzportControlProtocol::set_state: active " << _active << endl;
64 // I think I want to make these strings rather than numbers
66 // fetch current display mode
67 if ( node.property( X_("display_mode") ) != 0 )
69 string display = node.property( X_("display_mode") )->value();
73 int32_t new_display = atoi( display.c_str() );
74 if ( display_mode != new_display ) display_mode = (DisplayMode)new_display;
76 catch ( exception & e )
78 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
83 if ( node.property( X_("wheel_mode") ) != 0 )
85 string wheel = node.property( X_("wheel_mode") )->value();
88 int32_t new_wheel = atoi( wheel.c_str() );
89 if ( wheel_mode != new_wheel ) wheel_mode = (WheelMode) new_wheel;
91 catch ( exception & e )
93 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
98 // fetch current bling mode
99 if ( node.property( X_("bling") ) != 0 )
101 string bling = node.property( X_("bling_mode") )->value();
104 int32_t new_bling = atoi( bling.c_str() );
105 if ( bling_mode != new_bling ) bling_mode = (BlingMode) new_bling;
107 catch ( exception & e )
109 cout << "exception in TranzportControlProtocol::set_state: " << e.what() << endl;
119 // These are intended for the day we have more options for tranzport modes
120 // And perhaps we could load up sessions this way, too
123 TranzportControlProtocol::save (char *name)
125 // Presently unimplemented
130 TranzportControlProtocol::load (char *name)
132 // Presently unimplemented
137 TranzportControlProtocol::save_config (char *name)
139 // Presently unimplemented
144 TranzportControlProtocol::load_config (char *name)
146 // Presently unimplemented