Add API to query if a given MIDNAM is plugin-provided

This commit is contained in:
Robin Gareus
2019-11-12 06:28:02 +01:00
parent 5b86ece17a
commit de02201056
2 changed files with 8 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ public:
bool add_custom_midnam (const std::string& id, const std::string& midnam);
bool update_custom_midnam (const std::string& id, const std::string& midnam);
bool remove_custom_midnam (const std::string& id);
bool is_custom_model (const std::string& model) const;
void add_search_path (const PBD::Searchpath& search_path);

View File

@@ -99,6 +99,13 @@ MidiPatchManager::update_custom_midnam (const std::string& id, const std::string
return add_custom_midnam (id, midnam);
}
bool
MidiPatchManager::is_custom_model (const std::string& model) const
{
boost::shared_ptr<MIDINameDocument> midnam = document_by_model (model);
return (midnam && midnam->file_path().substr(0, 7) == "custom:");
}
void
MidiPatchManager::add_midnam_files_from_directory(const std::string& directory_path)
{