X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fmidi%2B%2B2%2Fmidnam_patch.cc;h=cb1e28508b93eecb397b011c8ad6219579551e85;hb=9488201a2c08eaa66ef97c2f55d91166beac1dfb;hp=e1b3007bd3fe06cc1ce177d8384280a82614a09e;hpb=2a251b457069ffb4b744fbd0dd7aca7acb31f381;p=ardour.git diff --git a/libs/midi++2/midnam_patch.cc b/libs/midi++2/midnam_patch.cc index e1b3007bd3..cb1e28508b 100644 --- a/libs/midi++2/midnam_patch.cc +++ b/libs/midi++2/midnam_patch.cc @@ -35,7 +35,7 @@ namespace MIDI namespace Name { - + Patch::Patch (std::string name, uint8_t p_number, uint16_t b_number) : _name (name) , _id (p_number, b_number) @@ -138,7 +138,7 @@ Patch::set_state (const XMLTree& tree, const XMLNode& node) return -1; // Failed to find a program number anywhere } } - + XMLNode* use_note_name_list = node.child("UsesNoteNameList"); if (use_note_name_list) { _note_list_name = use_note_name_list->property ("Name")->value(); @@ -478,7 +478,7 @@ operator<< (std::ostream& os, const ChannelNameSet& cns) os << (int) (*x) << ' '; } os << endl; - + for (ChannelNameSet::PatchBanks::const_iterator pbi = cns._patch_banks.begin(); pbi != cns._patch_banks.end(); ++pbi) { os << "\tPatch Bank " << (*pbi)->name() << " with " << (*pbi)->patch_name_list().size() << " patches\n"; for (PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) { @@ -493,12 +493,12 @@ void ChannelNameSet::set_patch_banks (const ChannelNameSet::PatchBanks& pb) { _patch_banks = pb; - + _patch_map.clear (); _patch_list.clear (); _patch_list_name = ""; _available_for_channels.clear (); - + for (PatchBanks::const_iterator pbi = _patch_banks.begin(); pbi != _patch_banks.end(); ++pbi) { for (PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) { _patch_map[(*pni)->patch_primary_key()] = (*pni); @@ -653,13 +653,13 @@ MasterDeviceNames::value_name_list_by_control(const std::string& mode, uint8_t c } } -boost::shared_ptr +boost::shared_ptr MasterDeviceNames::custom_device_mode_by_name(const std::string& mode_name) { return _custom_device_modes[mode_name]; } -boost::shared_ptr +boost::shared_ptr MasterDeviceNames::channel_name_set_by_channel(const std::string& mode, uint8_t channel) { boost::shared_ptr cdm = custom_device_mode_by_name(mode); @@ -667,8 +667,8 @@ MasterDeviceNames::channel_name_set_by_channel(const std::string& mode, uint8_t return cns; } -boost::shared_ptr -MasterDeviceNames::find_patch(const std::string& mode, uint8_t channel, const PatchPrimaryKey& key) +boost::shared_ptr +MasterDeviceNames::find_patch(const std::string& mode, uint8_t channel, const PatchPrimaryKey& key) { boost::shared_ptr cns = channel_name_set_by_channel(mode, channel); if (!cns) return boost::shared_ptr(); @@ -877,14 +877,15 @@ MasterDeviceNames::get_state(void) return nothing; } -MIDINameDocument::MIDINameDocument (const string& filename) +MIDINameDocument::MIDINameDocument (const string& file_path) + : _file_path(file_path) { XMLTree document; - if (!document.read (filename)) { + if (!document.read (file_path)) { throw failed_constructor (); } - document.set_filename (filename); + document.set_filename (file_path); set_state (document, *document.root()); } @@ -898,7 +899,7 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&) error << "No author information in MIDNAM file" << endmsg; return -1; } - + if (author->front()->children().size() > 0) { _author = author->front()->children().front()->content(); } @@ -922,7 +923,7 @@ MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&) _master_device_names_list.insert( std::pair > (*model, master_device_names)); - + _all_models.insert(*model); } }