# HG changeset patch # User Chris Cannam # Date 1497022856 -3600 # Node ID 025b3e2f7c1731ae80ca770da1969a4c56fe4ca6 # Parent 16655424db89ec42cb674ce0d8833818017cac69 Minor adjustment diff -r 16655424db89 -r 025b3e2f7c17 vamp-support/RdfTypes.h --- 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; + } + }; }