Ardour  9.0-pre0-384-ga76afae0e9
mackie/device_info.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2007 John Anderson
3  * Copyright (C) 2012-2015 Paul Davis <paul@linuxaudiosystems.com>
4  *
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.
9  *
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.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_mackie_control_protocol_device_info_h__
21 #define __ardour_mackie_control_protocol_device_info_h__
22 
23 #include <iostream>
24 #include <stdint.h>
25 #include <string>
26 #include <map>
27 
28 #include "button.h"
29 #include "types.h"
30 
31 class XMLNode;
32 
33 namespace ArdourSurface { namespace MACKIE_NAMESPACE {
34 
36  std::string label; // visible to user
37  std::string group; // in case we want to present in a GUI
38  int32_t id; // value sent by device
39 
40  GlobalButtonInfo () : id (-1) {}
41  GlobalButtonInfo (const std::string& l, const std::string& g, uint32_t i)
42  : label (l), group (g), id (i) {}
43 };
44 
46  int32_t base_id;
47  std::string name;
48 
49  StripButtonInfo () : base_id (-1) {}
50  StripButtonInfo (uint32_t i, const std::string& n)
51  : base_id (i), name (n) {}
52 };
53 
55 {
56  public:
57  enum DeviceType {
58  MCU = 0x14,
59  MCXT = 0x15,
60  LC = 0x10,
61  LCXT = 0x11,
62  HUI = 0x5
63  };
64 
67 
68  int set_state (const XMLNode&, int version);
69 
70  DeviceType device_type() const { return _device_type; }
71  uint32_t strip_cnt () const;
72  uint32_t extenders() const;
73  uint32_t master_position() const;
75  bool has_master_fader () const;
76  bool has_timecode_display() const;
77  bool has_global_controls() const;
78  bool has_jog_wheel () const;
79  bool has_touch_sense_faders() const;
80  bool uses_ipmidi() const;
81  bool no_handshake() const;
82  bool is_qcon() const;
83  bool is_platformMp() const;
84  bool is_proG2() const;
85  bool is_xtouch() const;
86  bool has_qcon_second_lcd() const;
87  bool has_qcon_master_meters() const;
88  bool has_meters() const;
89  bool has_separate_meters() const;
91  const std::string& name() const;
92 
93  static std::map<std::string,DeviceInfo> device_info;
94  static void reload_device_info();
95 
98 
99  typedef std::map<Button::ID,GlobalButtonInfo> GlobalButtonsInfo;
100  typedef std::map<Button::ID,StripButtonInfo> StripButtonsInfo;
101 
102  const GlobalButtonsInfo& global_buttons() const { return _global_buttons; }
103  const StripButtonsInfo& strip_buttons() const { return _strip_buttons; }
104 
105  private:
106  uint32_t _strip_cnt;
107  uint32_t _extenders;
118  bool _is_qcon;
120  bool _is_proG2;
128  std::string _name;
129  std::string _global_button_name;
130 
133 
136  void shared_buttons ();
137 };
138 
139 
140 } // Mackie namespace
141 } // ArdourSurface namespace
142 
143 std::ostream& operator<< (std::ostream& os, const ArdourSurface::MACKIE_NAMESPACE::DeviceInfo& di);
144 
145 #endif /* __ardour_mackie_control_protocol_device_info_h__ */
static std::map< std::string, DeviceInfo > device_info
GlobalButtonInfo & get_global_button(Button::ID)
const GlobalButtonsInfo & global_buttons() const
const StripButtonsInfo & strip_buttons() const
int set_state(const XMLNode &, int version)
const std::string & name() const
std::map< Button::ID, StripButtonInfo > StripButtonsInfo
std::string & get_global_button_name(Button::ID)
std::map< Button::ID, GlobalButtonInfo > GlobalButtonsInfo
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
std::ostream & operator<<(std::ostream &os, const ArdourSurface::NS_MCU ::DeviceInfo &di)
GlobalButtonInfo(const std::string &l, const std::string &g, uint32_t i)
StripButtonInfo(uint32_t i, const std::string &n)
#define MACKIE_NAMESPACE