From b42ce8480860d92b7a28b45f223b2fe1795499e3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 27 Feb 2014 12:08:18 +0700 Subject: audio/mda-lv2: Added (instrument and effect plugins). Signed-off-by: Willy Sudiarto Raharjo --- audio/mda-lv2/extract_docs.pl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 audio/mda-lv2/extract_docs.pl (limited to 'audio/mda-lv2/extract_docs.pl') diff --git a/audio/mda-lv2/extract_docs.pl b/audio/mda-lv2/extract_docs.pl new file mode 100644 index 0000000000..cb464c9e29 --- /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, "<$_"; + $_ = ; + 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"; +} -- cgit v1.2.3