aboutsummaryrefslogtreecommitdiff
path: root/audio/mda-lv2/extract_docs.pl
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2014-02-27 12:08:18 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-02-27 12:08:18 +0700
commitb42ce8480860d92b7a28b45f223b2fe1795499e3 (patch)
tree562cb31c6e13c958e825ca35878479f30a025ea0 /audio/mda-lv2/extract_docs.pl
parent208666903e0545329487cb55289ad6c312683677 (diff)
audio/mda-lv2: Added (instrument and effect plugins).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/mda-lv2/extract_docs.pl')
-rw-r--r--audio/mda-lv2/extract_docs.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/audio/mda-lv2/extract_docs.pl b/audio/mda-lv2/extract_docs.pl
new file mode 100644
index 0000000000000..cb464c9e294a6
--- /dev/null
+++ b/audio/mda-lv2/extract_docs.pl
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+
+# Extract the documentation that's buried in the .ttl files.
+
+# This is hideous code, but it does work, and doesn't require
+# spending a week learning the overly-complex LV2 and RDF specs.
+# Plus the LV2 scripting API is Python, so add a few more weeks
+# for me to learn Python...
+
+open OUT, "|fmt -s";
+select(OUT);
+
+$baseurl = "http://drobilla.net/plugins/mda/";
+
+undef $/;
+
+for(<*.ttl>) {
+ next if /-presets/;
+ my ($type, $name, $shortdesc, $url, $desc);
+ open I, "<$_";
+ $_ = <I>;
+ close I;
+
+ s/lv2:port.*//ms;
+
+ $type = $1 if /lv2:(\w+)Plugin\b/;
+ $name = $1 if /doap:name\s*"([^"]+)"/;
+ $shortdesc = $1 if /doap:shortdesc\s*"([^"]+)"/;
+ $url = $baseurl . $1 if /^mda:(\w+)\s*$/ms;
+ $desc = $2 if /rdfs:comment\s+("+)(.*?)\1/ms;
+
+ $name ||= "(no name, WTF?)";
+ print "\nName: $name\n";
+ print "URL: $url\n";
+ print "Type: $type\n" if $type;
+ print "Short Description: $shortdesc\n" if $shortdesc;
+ print "\nDescription:\n$desc\n" if $desc;
+ print '-' x 50, "\n";
+}