[SCM] calf/master: + LV2: attempt to implement Units extension support + Big Bull: TTL parenthesized lists are now supported

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:18 UTC 2013


The following commit has been merged in the master branch:
commit 620aa27662964910e3c4e198e6bb00eb131dd95b
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Sun Jun 15 22:08:21 2008 +0000

    + LV2: attempt to implement Units extension support
    + Big Bull: TTL parenthesized lists are now supported
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@201 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/bigbull/fakeserv.py b/bigbull/fakeserv.py
index 349382b..f11f177 100644
--- a/bigbull/fakeserv.py
+++ b/bigbull/fakeserv.py
@@ -41,7 +41,7 @@ def parseTTL(uri, content, model):
         (r"-?[0-9]+\.[0-9]+", lambda x : ("number", float(x))),
         (r"-?[0-9]+", lambda x : ("number", int(x))),
         ("[a-zA-Z0-9_]+", lambda x : ("symbol", x)),
-        (r"[\[\];.,]", lambda x : (x, x)),
+        (r"[()\[\];.,]", lambda x : (x, x)),
         ("\s+", ""),
     ])
     spo_stack = []
@@ -86,10 +86,15 @@ def parseTTL(uri, content, model):
             spo[0] = uri + "$anon$" + str(anoncnt)
             item = 1
             anoncnt += 1
-        elif x[0] == ']':
+        elif x[0] == ']' or x[0] == ')':
             spo = spo_stack[-1]
             spo_stack = spo_stack[:-1]
             item = 3
+        elif x[0] == '(':
+            spo_stack.append(spo)
+            spo[0] = uri + "$anon$" + str(anoncnt)
+            item = 2
+            anoncnt += 1
         else:
             print uri + ": Unexpected: " + repr(x)
 
diff --git a/src/makerdf.cpp b/src/makerdf.cpp
index 3d822c1..32e7898 100644
--- a/src/makerdf.cpp
+++ b/src/makerdf.cpp
@@ -96,6 +96,19 @@ static void add_port(string &ports, const char *symbol, const char *name, const
     ports += ss.str();
 }
 
+static const char *units[] = { 
+    "ue:db", 
+    "ue:coef",
+    "ue:hz",
+    "ue:s",
+    "ue:ms",
+    "ue2:cent", // - ask SWH (or maybe ue2: and write the extension by myself)
+    "ue2:semitone12TET", // - ask SWH
+    "ue:bpm",
+    "ue2:degree", // - ask SWH
+    "ue2:midiNote" // - ask SWH
+};
+
 static void add_ctl_port(string &ports, parameter_properties &pp, int pidx)
 {
     stringstream ss;
@@ -123,6 +136,10 @@ static void add_ctl_port(string &ports, parameter_properties &pp, int pidx)
     ss << ind << "lv2:default " << pp.def_value << " ;\n";
     ss << ind << "lv2:minimum " << pp.min << " ;\n";
     ss << ind << "lv2:maximum " << pp.max << " ;\n";
+    uint8_t unit = (pp.flags & PF_UNITMASK) >> 24;
+    if (unit > 0 && unit < (sizeof(units) / sizeof(char *)))
+        ss << ind << "ue:unit " << units[unit - 1] << " ;\n";
+    
     ss << "    ]";
     ports += ss.str();
 }
@@ -139,7 +156,9 @@ void make_ttl(string path_prefix)
         "@prefix uiext: <http://lv2plug.in/ns/extensions/ui#> .\n"
         "@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> .\n"
         "@prefix lv2midi: <http://lv2plug.in/ns/ext/midi#> .\n"
-        "@prefix pg: <http://ll-plugins.nongnu.org/lv2/ext/portgroups#>.\n"
+        "@prefix pg: <http://ll-plugins.nongnu.org/lv2/ext/portgroups#> .\n"
+        "@prefix ue: <http://lv2plug.in/ns/extensions/units#> .\n"
+        "@prefix ue2: <http://lv2plug.in/ns/dev/moreunits#> .\n"
 
         "\n"
     ;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list