+bool
+MidiPatchManager::add_custom_midnam (const std::string& id, const std::string& midnam)
+{
+ boost::shared_ptr<MIDINameDocument> document;
+ document = boost::shared_ptr<MIDINameDocument>(new MIDINameDocument());
+ XMLTree mxml;
+ if (mxml.read_buffer (midnam, true)) {
+ if (0 == document->set_state (mxml, *mxml.root())) {
+ document->set_file_path ("custom:" + id);
+ add_midi_name_document (document);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool
+MidiPatchManager::remove_custom_midnam (const std::string& id)
+{
+ return remove_midi_name_document ("custom:" + id);
+}
+
+bool
+MidiPatchManager::update_custom_midnam (const std::string& id, const std::string& midnam)
+{
+ remove_midi_name_document ("custom:" + id, false);
+ return add_custom_midnam (id, midnam);
+}
+