summaryrefslogtreecommitdiff
path: root/libs/midi++2/midnam_patch.cc
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2012-10-08 04:32:12 +0000
committerHans Baier <hansfbaier@googlemail.com>2012-10-08 04:32:12 +0000
commit0bb2227eb875060e30b57c171c497e70d94b3527 (patch)
tree23f93b399a29711311ceaaf9922f08641019523a /libs/midi++2/midnam_patch.cc
parent1a9d9b058c74c6e73da85ee90334a087844a36b2 (diff)
add unit tests to midi++ and assorted bugfixes for midnam_patch.cc
git-svn-id: svn://localhost/ardour2/branches/3.0@13213 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/midnam_patch.cc')
-rw-r--r--libs/midi++2/midnam_patch.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc
index 2b32fee42e..59fba49ded 100644
--- a/libs/midi++2/midnam_patch.cc
+++ b/libs/midi++2/midnam_patch.cc
@@ -404,7 +404,8 @@ CustomDeviceMode::get_state(void)
boost::shared_ptr<CustomDeviceMode>
MasterDeviceNames::custom_device_mode_by_name(std::string mode_name)
{
- assert(mode_name != "");
+ // can't assert this, since in many of the patch files the mode name is empty
+ //assert(mode_name != "");
return _custom_device_modes[mode_name];
}
@@ -428,7 +429,7 @@ MasterDeviceNames::set_state(const XMLTree& tree, const XMLNode& a_node)
// Manufacturer
boost::shared_ptr<XMLSharedNodeList> manufacturer = tree.find("//Manufacturer");
assert(manufacturer->size() == 1);
- _manufacturer = manufacturer->front()->content();
+ _manufacturer = manufacturer->front()->children().front()->content();
// Models
boost::shared_ptr<XMLSharedNodeList> models = tree.find("//Model");
@@ -549,7 +550,10 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode& a_node)
error << "No author information in MIDNAM file" << endmsg;
return -1;
}
- _author = author->front()->content();
+
+ if (author->front()->children().size() > 0) {
+ _author = author->front()->children().front()->content();
+ }
// MasterDeviceNames