[SCM] calf/master: + Framework: add initial output control port support (only works in JACK host for now), emit LV2 connectionOptional property

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


The following commit has been merged in the master branch:
commit 31b1d306ba5e18684d8474c6ba0bd506fe33f4fd
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Wed Oct 29 23:16:11 2008 +0000

    + Framework: add initial output control port support (only works in JACK host for now), emit LV2 connectionOptional property

diff --git a/src/calf/giface.h b/src/calf/giface.h
index bf98c8d..8e94be7 100644
--- a/src/calf/giface.h
+++ b/src/calf/giface.h
@@ -82,19 +82,21 @@ enum parameter_flags
   PF_PROP_NOBOUNDS =  0x010000, ///< no epp:hasStrictBounds
   PF_PROP_EXPENSIVE = 0x020000, ///< epp:expensive, may trigger expensive calculation
   PF_PROP_OUTPUT_GAIN=0x050000, ///< epp:outputGain + skip epp:hasStrictBounds
+  PF_PROP_OUTPUT    = 0x080000, ///< output port
+  PF_PROP_OPTIONAL  = 0x100000, ///< connection optional
   
-  PF_UNITMASK = 0xFF000000,
-  PF_UNIT_DB = 0x01000000,       ///< decibels
-  PF_UNIT_COEF = 0x02000000,     ///< multiply-by factor
-  PF_UNIT_HZ = 0x03000000,       ///< Hertz
-  PF_UNIT_SEC = 0x04000000,      ///< second
-  PF_UNIT_MSEC = 0x05000000,     ///< millisecond
-  PF_UNIT_CENTS = 0x06000000,    ///< cents (1/100 of a semitone, 1/1200 of an octave)
+  PF_UNITMASK     = 0xFF000000,
+  PF_UNIT_DB      = 0x01000000,  ///< decibels
+  PF_UNIT_COEF    = 0x02000000,  ///< multiply-by factor
+  PF_UNIT_HZ      = 0x03000000,  ///< Hertz
+  PF_UNIT_SEC     = 0x04000000,  ///< second
+  PF_UNIT_MSEC    = 0x05000000,  ///< millisecond
+  PF_UNIT_CENTS   = 0x06000000,  ///< cents (1/100 of a semitone, 1/1200 of an octave)
   PF_UNIT_SEMITONES = 0x07000000,///< semitones
-  PF_UNIT_BPM = 0x08000000,      ///< beats per minute
-  PF_UNIT_DEG = 0x09000000,      ///< degrees
-  PF_UNIT_NOTE = 0x0A000000,     ///< MIDI note number
-  PF_UNIT_RPM = 0x0B000000,      ///< revolutions per minute
+  PF_UNIT_BPM     = 0x08000000,  ///< beats per minute
+  PF_UNIT_DEG     = 0x09000000,  ///< degrees
+  PF_UNIT_NOTE    = 0x0A000000,  ///< MIDI note number
+  PF_UNIT_RPM     = 0x0B000000,  ///< revolutions per minute
 };
 
 class null_audio_module;
diff --git a/src/gui.cpp b/src/gui.cpp
index 4d60717..e7c42f2 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -869,8 +869,16 @@ void plugin_gui::on_idle()
     for (unsigned int i = 0; i < params.size(); i++)
     {
         if (params[i] != NULL)
+        {
+            parameter_properties &props = *plugin->get_param_props(params[i]->param_no);
+            bool is_output = (props.flags & PF_PROP_OUTPUT) != 0;
+            if (is_output) {
+                params[i]->set();
+            }
             params[i]->on_idle();
+        }
     }    
+    // XXXKF iterate over par2ctl, too...
 }
 
 void plugin_gui::refresh()
diff --git a/src/makerdf.cpp b/src/makerdf.cpp
index df385d4..c8de678 100644
--- a/src/makerdf.cpp
+++ b/src/makerdf.cpp
@@ -127,7 +127,10 @@ static void add_ctl_port(string &ports, parameter_properties &pp, int pidx, gifa
     
     if (ports != "") ports += " , ";
     ss << "[\n";
-    ss << ind << "a lv2:InputPort ;\n";
+    if (pp.flags & PF_PROP_OUTPUT)
+        ss << ind << "a lv2:OutputPort ;\n";
+    else
+        ss << ind << "a lv2:InputPort ;\n";
     ss << ind << "a lv2:ControlPort ;\n";
     ss << ind << "lv2:index " << pidx << " ;\n";
     ss << ind << "lv2:symbol \"" << pp.short_name << "\" ;\n";
@@ -138,6 +141,8 @@ static void add_ctl_port(string &ports, parameter_properties &pp, int pidx, gifa
         ss << ind << "lv2:portProperty epp:hasStrictBounds ;\n";
     if (pp.flags & PF_PROP_EXPENSIVE)
         ss << ind << "lv2:portProperty epp:expensive ;\n";
+    if (pp.flags & PF_PROP_OPTIONAL)
+        ss << ind << "lv2:portProperty lv2:connectionOptional ;\n";
     if ((*gpi->is_noisy)(param))
         ss << ind << "lv2:portProperty epp:causesArtifacts ;\n";
     if (!(*gpi->is_cv)(param))

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list