summaryrefslogtreecommitdiff
path: root/libs/midi++2/midnam_patch.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-12-19 13:14:19 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-12-19 13:14:45 -0700
commit4874ff8843714efd6ebdfaa92d967c51abc4f200 (patch)
tree57fbd867133aa09a53af8a1f43040ba7ca6cc32b /libs/midi++2/midnam_patch.cc
parentbfa5eb982d174ccdfe855023c4c3119f6df3a585 (diff)
slightly enhanced error handling when loading MIDNAM data
Diffstat (limited to 'libs/midi++2/midnam_patch.cc')
-rw-r--r--libs/midi++2/midnam_patch.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc
index 6c96e51ccd..a6253b8619 100644
--- a/libs/midi++2/midnam_patch.cc
+++ b/libs/midi++2/midnam_patch.cc
@@ -118,7 +118,7 @@ int
Patch::set_state (const XMLTree& tree, const XMLNode& node)
{
if (node.name() != "Patch") {
- cerr << "Incorrect node type '" << node.name() << "' handed to Patch" << endl;
+ cerr << "Incorrect node type '" << node.name() << "' handed to Patch" << " contents " << node.content() << endl;
return -1;
}
@@ -843,13 +843,17 @@ MasterDeviceNames::set_state(const XMLTree& tree, const XMLNode&)
i != patch_name_lists->end();
++i) {
+ string n; (*i)->get_property ("Name", n);
+
PatchNameList patch_name_list;
const XMLNodeList patches = (*i)->children();
for (XMLNodeList::const_iterator p = patches.begin(); p != patches.end(); ++p) {
boost::shared_ptr<Patch> patch (new Patch ());
- patch->set_state(tree, *(*p));
- patch_name_list.push_back(patch);
+ // cerr << "Let's try: "; (*(*p)).dump (cerr); cerr << endl;
+ if (0 == patch->set_state(tree, *(*p))) {
+ patch_name_list.push_back(patch);
+ }
}
if (!patch_name_list.empty()) {
@@ -1097,4 +1101,3 @@ const char* general_midi_program_names[128] = {
} //namespace Name
} //namespace MIDI
-