13
0

add support for <HasMeters value=XX/> stanza in MCP device info file

git-svn-id: svn://localhost/ardour2/branches/3.0@12440 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-05-24 19:27:29 +00:00
parent 239d56ccb9
commit 7d252412c3
3 changed files with 15 additions and 1 deletions

View File

@ -51,6 +51,7 @@ DeviceInfo::DeviceInfo()
, _uses_logic_control_buttons (false)
, _uses_ipmidi (false)
, _no_handshake (false)
, _has_meters (true)
, _name (X_("Mackie Control Universal Pro"))
{
mackie_control_buttons ();
@ -290,6 +291,14 @@ DeviceInfo::set_state (const XMLNode& node, int /* version */)
_no_handshake = false;
}
if ((child = node.child ("HasMeters")) != 0) {
if ((prop = child->property ("value")) != 0) {
_has_meters = string_is_affirmative (prop->value());
}
} else {
_has_meters = true;
}
if ((child = node.child ("LogicControlButtons")) != 0) {
if ((prop = child->property ("value")) != 0) {
_uses_logic_control_buttons = string_is_affirmative (prop->value());

View File

@ -68,6 +68,7 @@ class DeviceInfo
bool has_touch_sense_faders() const;
bool uses_ipmidi() const;
bool no_handshake() const;
bool has_meters() const;
const std::string& name() const;
static std::map<std::string,DeviceInfo> device_info;
@ -88,6 +89,7 @@ class DeviceInfo
bool _uses_logic_control_buttons;
bool _uses_ipmidi;
bool _no_handshake;
bool _has_meters;
std::string _name;
std::map<Button::ID,GlobalButtonInfo> _global_buttons;

View File

@ -80,7 +80,10 @@ Strip::Strip (Surface& s, const std::string& name, int index, const map<Button::
{
_fader = dynamic_cast<Fader*> (Fader::factory (*_surface, index, "fader", *this));
_vpot = dynamic_cast<Pot*> (Pot::factory (*_surface, Pot::ID + index, "vpot", *this));
_meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
if (s.mcp().device_info().has_meters()) {
_meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
}
for (map<Button::ID,StripButtonInfo>::const_iterator b = strip_buttons.begin(); b != strip_buttons.end(); ++b) {
Button* bb = dynamic_cast<Button*> (Button::factory (*_surface, b->first, b->second.base_id + index, b->second.name, *this));