ensure that Ardour recognizes its own MMC device ID as "all-call" when set to 0x7f...
[ardour.git] / libs / midi++2 / midnam_patch.cc
index 252804e4669857bf0b0e90c2d1d7bc7a02851b3f..77e13f29e170da4cd22447801851ff416b56e5c4 100644 (file)
@@ -95,7 +95,7 @@ Patch::get_state (void)
        node->add_property("Name",   _name);
 
        /*
-       typedef std::list< boost::shared_ptr< Evoral::MIDIEvent<double> > > PatchMidiCommands;
+       typedef std::list< boost::shared_ptr< Evoral::MIDIEvent<Evoral::MusicalTime> > > PatchMidiCommands;
        XMLNode* commands = node->add_child("PatchMIDICommands");
        for (PatchMidiCommands::const_iterator event = _patch_midi_commands.begin();
            event != _patch_midi_commands.end();
@@ -724,14 +724,13 @@ MasterDeviceNames::note_name(const std::string& mode_name,
                return "";
        }
 
+       boost::shared_ptr<const NoteNameList> note_names;
        boost::shared_ptr<const Patch> patch(
                find_patch(mode_name, channel, PatchPrimaryKey(program, bank)));
-       if (!patch) {
-               return "";
+       if (patch) {
+               note_names = note_name_list(patch->note_list_name());
        }
 
-       boost::shared_ptr<const NoteNameList> note_names(
-               note_name_list(patch->note_list_name()));
        if (!note_names) {
                /* No note names specific to this patch, check the ChannelNameSet */
                boost::shared_ptr<ChannelNameSet> chan_names = channel_name_set_by_channel(
@@ -878,12 +877,13 @@ MasterDeviceNames::get_state(void)
 
 MIDINameDocument::MIDINameDocument (const string& filename)
 {
-       if (!_document.read (filename)) {
+       XMLTree document;
+       if (!document.read (filename)) {
                throw failed_constructor ();
        }
 
-       _document.set_filename (filename);
-       set_state (_document, *_document.root());
+       document.set_filename (filename);
+       set_state (document, *document.root());
 }
 
 int