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 | |
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')
-rw-r--r-- | libs/midi++2/midi++/midnam_patch.h | 3 | ||||
-rw-r--r-- | libs/midi++2/midnam_patch.cc | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h index 54d36735e5..338642025e 100644 --- a/libs/midi++2/midi++/midnam_patch.h +++ b/libs/midi++2/midi++/midnam_patch.h @@ -197,6 +197,8 @@ public: return boost::shared_ptr<Patch>(); } + const std::string& note_list_name() const { return _note_list_name; } + XMLNode& get_state (void); int set_state (const XMLTree&, const XMLNode&); @@ -211,6 +213,7 @@ private: PatchMap _patch_map; PatchList _patch_list; std::string _patch_list_name; + std::string _note_list_name; }; std::ostream& operator<< (std::ostream&, const ChannelNameSet&); 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 ""; } |