diff options
author | David Robillard <d@drobilla.net> | 2013-01-20 02:41:27 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-20 02:41:27 +0000 |
commit | f7ada4b3233c9c68cc27714ce310068d4adbb07e (patch) | |
tree | ae03fe1543da65a12ba29923a5f685c10393d19e /libs/midi++2/midnam_patch.cc | |
parent | 411dd7566f64959167419713e702e06af09465e2 (diff) |
Add General MIDI drum note names and patch names.
Support loading note names per ChannelNameSet (like GM) in addition to per Patch (like DM5).
git-svn-id: svn://localhost/ardour2/branches/3.0@13913 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/midnam_patch.cc')
-rw-r--r-- | libs/midi++2/midnam_patch.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc index 83f701777b..624e1605b5 100644 --- a/libs/midi++2/midnam_patch.cc +++ b/libs/midi++2/midnam_patch.cc @@ -435,6 +435,10 @@ ChannelNameSet::set_state (const XMLTree& tree, const XMLNode& node) _patch_list.push_back((*patch)->patch_primary_key()); } } + + if (node->name() == "UsesNoteNameList") { + _note_list_name = node->property ("Name")->value(); + } } return 0; @@ -537,6 +541,14 @@ MasterDeviceNames::note_name(const std::string& mode_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_device_mode_and_channel( + mode_name, channel); + if (chan_names) { + note_names = note_name_list(chan_names->note_list_name()); + } + } + if (!note_names) { return ""; } |