2012-04-12 07:46:35 -04:00
|
|
|
/*
|
2015-10-03 11:31:46 -04:00
|
|
|
Copyright (C) 2006,2007 John Anderson
|
|
|
|
Copyright (C) 2012 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2012-04-12 07:46:35 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_mackie_control_protocol_device_info_h__
|
|
|
|
#define __ardour_mackie_control_protocol_device_info_h__
|
|
|
|
|
2012-04-12 12:41:07 -04:00
|
|
|
#include <iostream>
|
2012-04-12 07:46:35 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string>
|
2012-04-12 08:58:42 -04:00
|
|
|
#include <map>
|
2012-04-12 07:46:35 -04:00
|
|
|
|
2012-04-14 15:02:54 -04:00
|
|
|
#include "button.h"
|
|
|
|
|
2012-04-12 07:46:35 -04:00
|
|
|
class XMLNode;
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
namespace ArdourSurface {
|
|
|
|
|
2012-04-12 07:46:35 -04:00
|
|
|
namespace Mackie {
|
|
|
|
|
2012-04-14 15:02:54 -04:00
|
|
|
struct GlobalButtonInfo {
|
2015-10-03 11:31:46 -04:00
|
|
|
std::string label; // visible to user
|
|
|
|
std::string group; // in case we want to present in a GUI
|
|
|
|
int32_t id; // value sent by device
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
GlobalButtonInfo () : id (-1) {}
|
|
|
|
GlobalButtonInfo (const std::string& l, const std::string& g, uint32_t i)
|
|
|
|
: label (l), group (g), id (i) {}
|
2012-04-14 15:02:54 -04:00
|
|
|
};
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2012-04-14 15:02:54 -04:00
|
|
|
struct StripButtonInfo {
|
2015-10-03 11:31:46 -04:00
|
|
|
int32_t base_id;
|
|
|
|
std::string name;
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
StripButtonInfo () : base_id (-1) {}
|
|
|
|
StripButtonInfo (uint32_t i, const std::string& n)
|
|
|
|
: base_id (i), name (n) {}
|
2012-04-14 15:02:54 -04:00
|
|
|
};
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
class DeviceInfo
|
2012-04-12 07:46:35 -04:00
|
|
|
{
|
2015-10-03 11:31:46 -04:00
|
|
|
public:
|
2015-10-03 11:31:17 -04:00
|
|
|
enum DeviceType {
|
|
|
|
MCU = 0x14,
|
|
|
|
MCXT = 0x15,
|
|
|
|
LC = 0x10,
|
|
|
|
LCXT = 0x11,
|
|
|
|
HUI = 0x5
|
|
|
|
};
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-04-12 07:46:35 -04:00
|
|
|
DeviceInfo();
|
|
|
|
~DeviceInfo();
|
|
|
|
|
2012-04-12 08:16:55 -04:00
|
|
|
int set_state (const XMLNode&, int version);
|
|
|
|
|
2015-10-03 11:31:17 -04:00
|
|
|
DeviceType device_type() const { return _device_type; }
|
2012-04-12 07:46:35 -04:00
|
|
|
uint32_t strip_cnt () const;
|
2012-04-12 12:41:07 -04:00
|
|
|
uint32_t extenders() const;
|
2015-06-04 18:07:43 -04:00
|
|
|
uint32_t master_position() const;
|
2015-10-04 14:51:05 -04:00
|
|
|
bool has_two_character_display() const;
|
2012-04-12 07:46:35 -04:00
|
|
|
bool has_master_fader () const;
|
|
|
|
bool has_timecode_display() const;
|
2012-04-12 13:52:57 -04:00
|
|
|
bool has_global_controls() const;
|
|
|
|
bool has_jog_wheel () const;
|
2012-04-12 14:36:14 -04:00
|
|
|
bool has_touch_sense_faders() const;
|
2012-04-23 22:28:51 -04:00
|
|
|
bool uses_ipmidi() const;
|
2012-05-11 12:04:09 -04:00
|
|
|
bool no_handshake() const;
|
2012-05-24 15:27:29 -04:00
|
|
|
bool has_meters() const;
|
2012-04-12 07:46:35 -04:00
|
|
|
const std::string& name() const;
|
|
|
|
|
2012-04-12 08:58:42 -04:00
|
|
|
static std::map<std::string,DeviceInfo> device_info;
|
|
|
|
static void reload_device_info();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-06 08:20:57 -04:00
|
|
|
std::string& get_global_button_name(Button::ID);
|
2012-06-09 15:06:52 -04:00
|
|
|
GlobalButtonInfo& get_global_button(Button::ID);
|
2012-04-12 08:58:42 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
typedef std::map<Button::ID,GlobalButtonInfo> GlobalButtonsInfo;
|
|
|
|
typedef std::map<Button::ID,StripButtonInfo> StripButtonsInfo;
|
2012-06-09 15:06:52 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
const GlobalButtonsInfo& global_buttons() const { return _global_buttons; }
|
|
|
|
const StripButtonsInfo& strip_buttons() const { return _strip_buttons; }
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
private:
|
|
|
|
uint32_t _strip_cnt;
|
|
|
|
uint32_t _extenders;
|
|
|
|
uint32_t _master_position;
|
|
|
|
bool _has_two_character_display;
|
|
|
|
bool _has_master_fader;
|
|
|
|
bool _has_timecode_display;
|
|
|
|
bool _has_global_controls;
|
|
|
|
bool _has_jog_wheel;
|
|
|
|
bool _has_touch_sense_faders;
|
|
|
|
bool _uses_logic_control_buttons;
|
|
|
|
bool _uses_ipmidi;
|
|
|
|
bool _no_handshake;
|
|
|
|
bool _has_meters;
|
2015-10-03 11:31:17 -04:00
|
|
|
DeviceType _device_type;
|
2015-10-03 11:31:46 -04:00
|
|
|
std::string _name;
|
|
|
|
std::string _global_button_name;
|
2012-04-14 15:02:54 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
GlobalButtonsInfo _global_buttons;
|
|
|
|
StripButtonsInfo _strip_buttons;
|
2012-04-15 09:28:45 -04:00
|
|
|
|
2015-10-03 11:31:46 -04:00
|
|
|
void logic_control_buttons ();
|
|
|
|
void mackie_control_buttons ();
|
|
|
|
void shared_buttons ();
|
2012-04-12 07:46:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
} // Mackie namespace
|
|
|
|
} // ArdourSurface namespace
|
2012-04-12 07:46:35 -04:00
|
|
|
|
2015-04-15 20:37:20 -04:00
|
|
|
std::ostream& operator<< (std::ostream& os, const ArdourSurface::Mackie::DeviceInfo& di);
|
2012-04-12 12:41:07 -04:00
|
|
|
|
2012-04-12 07:46:35 -04:00
|
|
|
#endif /* __ardour_mackie_control_protocol_device_info_h__ */
|