Mercurial > hg > piper-cpp
changeset 225:025b3e2f7c17
Minor adjustment
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 09 Jun 2017 16:40:56 +0100 |
parents | 16655424db89 |
children | c5cdc9e6a4bf |
files | vamp-support/RdfTypes.h |
diffstat | 1 files changed, 36 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/vamp-support/RdfTypes.h Fri Jun 09 16:25:43 2017 +0100 +++ b/vamp-support/RdfTypes.h Fri Jun 09 16:40:56 2017 +0100 @@ -64,18 +64,7 @@ StaticOutputInfo info; SordModel *model = sord_new(m_world, SORD_SPO|SORD_OPS|SORD_POS, false); if (loadRdf(model, candidateRdfFilesFor(pluginKey))) { - // we want to find a graph like - // :plugin a vamp:Plugin - // :plugin vamp:identifier "pluginId" - // :library vamp:available_plugin :plugin - // :library vamp:identifier "libraryId" - // :plugin vamp:output :output1 - // :plugin vamp:output :output2 - // :plugin vamp:output :output3 - // :output1 vamp:computes_event_type :event - // :output2 vamp:computes_feature :feature - // :output3 vamp:computes_signal_type :signal - // and where pluginKey == libraryId + ":" + pluginId + loadStaticOutputInfoFromModel(model, pluginKey, info); } sord_free(model); return info; @@ -137,6 +126,41 @@ return candidates; } + + void + loadStaticOutputInfoFromModel(SordModel *model, std::string pluginKey, + StaticOutputInfo &info) { + // we want to find a graph like + // :plugin a vamp:Plugin + // :plugin vamp:identifier "pluginId" + // :library vamp:available_plugin :plugin + // :library vamp:identifier "libraryId" + // :plugin vamp:output :output1 + // :plugin vamp:output :output2 + // :plugin vamp:output :output3 + // :output1 vamp:computes_event_type :event + // :output2 vamp:computes_feature :feature + // :output3 vamp:computes_signal_type :signal + // and where pluginKey == libraryId + ":" + pluginId + + std::string libraryId, pluginId; + decomposePluginKey(pluginKey, libraryId, pluginId); + + //!!! + } + + bool decomposePluginKey(std::string pluginKey, + std::string &libraryId, + std::string &pluginId) { + auto i = pluginKey.find(':'); + if (i == std::string::npos || i == 0 || i + 1 == pluginKey.length()) { + return false; + } + libraryId = pluginKey.substr(0, i); + pluginId = pluginKey.substr(i + 1); + return true; + } + }; }