[SCM] calf/master: Add rough support for status data in DSSI (for Fluidsynth preset names)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:40:17 UTC 2013


The following commit has been merged in the master branch:
commit 52ee1280a28591a10b49bf7fde89a8d1d584cdf2
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Mon May 17 00:21:20 2010 +0100

    Add rough support for status data in DSSI (for Fluidsynth preset names)

diff --git a/src/dssigui.cpp b/src/dssigui.cpp
index 5a417b2..96af86a 100644
--- a/src/dssigui.cpp
+++ b/src/dssigui.cpp
@@ -104,8 +104,9 @@ struct plugin_proxy: public plugin_ctl_iface, public line_graph_iface
     const plugin_metadata_iface *metadata;
     vector<string> new_status;
     uint32_t new_status_serial;
+    bool is_lv2;
 
-    plugin_proxy(const plugin_metadata_iface *md)
+    plugin_proxy(const plugin_metadata_iface *md, bool _is_lv2)
     {
         new_status_serial = 0;
         metadata = md;
@@ -117,6 +118,7 @@ struct plugin_proxy: public plugin_ctl_iface, public line_graph_iface
         params = new float[param_count];
         for (int i = 0; i < param_count; i++)
             params[i] = metadata->get_param_props(i)->def_value;
+        is_lv2 = _is_lv2;
     }
     virtual float get_param_value(int param_no) {
         if (param_no < 0 || param_no >= param_count)
@@ -187,10 +189,20 @@ struct plugin_proxy: public plugin_ctl_iface, public line_graph_iface
             }
             return new_status_serial;
         }
-        osc_inline_typed_strstream str;
-        str << (uint32_t)last_serial;
-        client->send("/send_status", str);
-        return last_serial;
+        if (!is_lv2)
+        {
+            osc_inline_typed_strstream str;
+            str << "OSC:SEND_STATUS" << calf_utils::i2s(last_serial);
+            client->send("/configure", str);
+            return last_serial;
+        }
+        else
+        {
+            osc_inline_typed_strstream str;
+            str << (uint32_t)last_serial;
+            client->send("/send_status", str);
+            return last_serial;
+        }
     }
     virtual const line_graph_iface *get_line_graph_iface() const { return this; }
     virtual bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context) const;
@@ -306,7 +318,7 @@ struct dssi_osc_server: public osc_glib_server, public osc_message_sink<osc_strs
             exit(1);
         }
         effect_name = pmi->get_id();
-        plugin = new plugin_proxy(pmi);
+        plugin = new plugin_proxy(pmi, is_lv2);
     }
     
     static void on_destroy(GtkWindow *window, dssi_osc_server *self)
diff --git a/src/giface.cpp b/src/giface.cpp
index 8fe5037..b8705b6 100644
--- a/src/giface.cpp
+++ b/src/giface.cpp
@@ -437,9 +437,12 @@ void calf_plugins::dssi_feedback_sender::add_graphs(const calf_plugins::paramete
 
 void calf_plugins::dssi_feedback_sender::update()
 {
-    osctl::osc_inline_typed_strstream os;
-    serialize_graphs(os, graph, indices);
-    client->send("/lineGraph", os);
+    if (graph)
+    {
+        osctl::osc_inline_typed_strstream os;
+        serialize_graphs(os, graph, indices);
+        client->send("/lineGraph", os);
+    }
 }
 
 calf_plugins::dssi_feedback_sender::~dssi_feedback_sender()
diff --git a/src/plugin.cpp b/src/plugin.cpp
index 2889751..9a4b976 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -29,8 +29,10 @@
 #include <calf/modules_mod.h>
 #include <calf/modules_synths.h>
 #include <calf/organ.h>
+#include <calf/osctlnet.h>
 
 using namespace calf_plugins;
+using namespace osctl;
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -118,8 +120,8 @@ char *ladspa_instance::configure(const char *key, const char *value)
     if (!strcmp(key, "OSC:FEEDBACK_URI"))
     {
         const line_graph_iface *lgi = dynamic_cast<const line_graph_iface *>(metadata);
-        if (!lgi)
-            return NULL;
+        //if (!lgi)
+        //    return NULL;
         if (*value)
         {
             if (feedback_sender) {
@@ -145,6 +147,25 @@ char *ladspa_instance::configure(const char *key, const char *value)
             feedback_sender->update();
         return NULL;
     }
+    else 
+    if (!strcmp(key, "OSC:SEND_STATUS"))
+    {
+        if (!feedback_sender)
+            return NULL;
+        struct status_gatherer: public send_updates_iface
+        {
+            osc_inline_typed_strstream str;            
+            void send_status(const char *key, const char *value)
+            {
+                str << key << value;
+            }
+        } sg;
+        int serial = atoi(value);
+        serial = module->send_status_updates(&sg, serial);
+        sg.str << (uint32_t)serial;
+        feedback_sender->client->send("/status_data", sg.str);
+        return NULL;
+    }
     else
 #endif
     if (!strcmp(key, "ExecCommand"))

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list