add support for <HasMeters value=XX/> stanza in MCP device info file
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 24 May 2012 19:27:29 +0000 (19:27 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 24 May 2012 19:27:29 +0000 (19:27 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12440 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/device_info.cc
libs/surfaces/mackie/device_info.h
libs/surfaces/mackie/strip.cc

index 8d2186cf0c5bfad72d2d3a70610f31000587407d..3f825e75c7c5f3e1762cc5e97eab86a79d12ac97 100644 (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());
index 294bc091ed333452451b5423f7b896beba435b54..1b97ee75bf6b05031699f34c11dded1414651e19 100644 (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;
index d886f5a6582b73c6fe62fecf01eae1b5b6254ad5..a80306c799fc789b5d6f27f41505d392f81243ec 100644 (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));