From fc66f67d23ce051ddff2f86c036728c7d7b59c6f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Aug 2008 02:11:44 +0000 Subject: Add binary information to manifest. lv2_list and lv2_inspect now showing basic mda plugin information. git-svn-id: http://svn.drobilla.net/lad/mda-lv2@1325 a436a847-0d15-0410-975c-d299462d15a1 --- lvz/gendata.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lvz/gendata.cpp b/lvz/gendata.cpp index 3481d3d..57d1336 100644 --- a/lvz/gendata.cpp +++ b/lvz/gendata.cpp @@ -25,32 +25,29 @@ using namespace std; -typedef AudioEffectX* (*new_effect_func)(); -typedef AudioEffectX* (*plugin_uri_func)(); +#define NS_LV2CORE "http://lv2plug.in/ns/lv2core#" // VST is so incredibly awful. Just.. wow. #define MAX_NAME_LENGTH 1024 char name[MAX_NAME_LENGTH]; -#define NS_LV2CORE "http://lv2plug.in/ns/lv2core#" struct Record { - Record(const string& u, const string& f) : uri(u), file(f) {} + Record(const string& u, const string& n) : uri(u), base_name(n) {} string uri; - string file; + string base_name; }; typedef std::list Manifest; Manifest manifest; + void write_plugin(AudioEffectX* effect, const string& lib_file_name) { - string data_file_name = lib_file_name; - data_file_name = data_file_name.substr(0, data_file_name.find_last_of(".")); - data_file_name += ".ttl"; + string base_name = lib_file_name.substr(0, lib_file_name.find_last_of(".")); + string data_file_name = base_name + ".ttl"; - //ostream& os = cout; fstream os(data_file_name.c_str(), ios::out); effect->getProductString(name); @@ -96,7 +93,7 @@ write_plugin(AudioEffectX* effect, const string& lib_file_name) os.close(); - manifest.push_back(Record(effect->getURI(), data_file_name)); + manifest.push_back(Record(effect->getURI(), base_name)); } @@ -107,7 +104,8 @@ write_manifest(ostream& os) os << "@prefix rdfs: ." << endl << endl; for (Manifest::iterator i = manifest.begin(); i != manifest.end(); ++i) { os << "<" << i->uri << "> a :Plugin ;" << endl; - os << "\trdfs:seeAlso <" << i->file << "> ." << endl << endl; + os << "\trdfs:seeAlso <" << i->base_name << ".ttl> ;" << endl; + os << "\t:binary <" << i->base_name << ".so> ." << endl << endl; } } @@ -123,6 +121,9 @@ main(int argc, char** argv) cout << "A manifest of the plugins found is written to stdout" << endl; return 1; } + + typedef AudioEffectX* (*new_effect_func)(); + typedef AudioEffectX* (*plugin_uri_func)(); new_effect_func constructor = NULL; AudioEffectX* effect = NULL; -- cgit v1.2.1