2 Copyright (C) 2006,2007 John Anderson
3 Copyright (C) 2012 Paul Davis
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.
20 #ifndef __ardour_mackie_control_protocol_device_info_h__
21 #define __ardour_mackie_control_protocol_device_info_h__
32 namespace ArdourSurface {
36 struct GlobalButtonInfo {
37 std::string label; // visible to user
38 std::string group; // in case we want to present in a GUI
39 int32_t id; // value sent by device
41 GlobalButtonInfo () : id (-1) {}
42 GlobalButtonInfo (const std::string& l, const std::string& g, uint32_t i)
43 : label (l), group (g), id (i) {}
46 struct StripButtonInfo {
50 StripButtonInfo () : base_id (-1) {}
51 StripButtonInfo (uint32_t i, const std::string& n)
52 : base_id (i), name (n) {}
61 int set_state (const XMLNode&, int version);
63 uint32_t strip_cnt () const;
64 uint32_t extenders() const;
65 bool has_two_character_display() const;
66 bool has_master_fader () const;
67 bool has_timecode_display() const;
68 bool has_global_controls() const;
69 bool has_jog_wheel () const;
70 bool has_touch_sense_faders() const;
71 bool uses_ipmidi() const;
72 bool no_handshake() const;
73 bool has_meters() const;
74 const std::string& name() const;
76 static std::map<std::string,DeviceInfo> device_info;
77 static void reload_device_info();
79 std::string& get_global_button_name(Button::ID);
80 GlobalButtonInfo& get_global_button(Button::ID);
82 typedef std::map<Button::ID,GlobalButtonInfo> GlobalButtonsInfo;
83 typedef std::map<Button::ID,StripButtonInfo> StripButtonsInfo;
85 const GlobalButtonsInfo& global_buttons() const { return _global_buttons; }
86 const StripButtonsInfo& strip_buttons() const { return _strip_buttons; }
91 bool _has_two_character_display;
92 bool _has_master_fader;
93 bool _has_timecode_display;
94 bool _has_global_controls;
96 bool _has_touch_sense_faders;
97 bool _uses_logic_control_buttons;
102 std::string _global_button_name;
104 GlobalButtonsInfo _global_buttons;
105 StripButtonsInfo _strip_buttons;
107 void logic_control_buttons ();
108 void mackie_control_buttons ();
109 void shared_buttons ();
113 } // Mackie namespace
114 } // ArdourSurface namespace
116 std::ostream& operator<< (std::ostream& os, const ArdourSurface::Mackie::DeviceInfo& di);
118 #endif /* __ardour_mackie_control_protocol_device_info_h__ */