Ignore MIDNAM NRPN Controls for the time being
authorRobin Gareus <robin@gareus.org>
Fri, 3 May 2019 22:07:26 +0000 (00:07 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 3 May 2019 22:07:26 +0000 (00:07 +0200)
This fixes an issue with Novation_BassStationII.midnam
duplicate assignments CC + NRPN.

libs/midi++2/midnam_patch.cc

index 71c82d78fdbc56a08c5d05473956563c8280558b..e86f3dcfa0103300a36c376849b3f712c7af96cb 100644 (file)
@@ -250,6 +250,9 @@ Control::set_state (const XMLTree& tree, const XMLNode& node)
        } else {
                _type = "7bit";
        }
+       if (_type == "NRPN") {
+               return -1;
+       }
        _number = string_to_int(tree, node.property("Number")->value());
        _name   = node.property("Name")->value();
 
@@ -292,7 +295,9 @@ ControlNameList::set_state (const XMLTree& tree, const XMLNode& node)
             i != node.children().end(); ++i) {
                if ((*i)->name() == "Control") {
                        boost::shared_ptr<Control> control(new Control());
-                       control->set_state (tree, *(*i));
+                       if (control->set_state (tree, *(*i))) {
+                               continue;
+                       }
                        if (_controls.find(control->number()) == _controls.end()) {
                                _controls.insert(make_pair(control->number(), control));
                        } else {