[SCM] calf/master: + DSSI: quick fix for DSSI crash in Organ

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:35 UTC 2013


The following commit has been merged in the master branch:
commit 7ddd1131e1fa4f9729deab726b73a695c0b45984
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sat Nov 22 00:23:44 2008 +0000

    + DSSI: quick fix for DSSI crash in Organ

diff --git a/src/calf/ladspa_wrap.h b/src/calf/ladspa_wrap.h
index ee7d3a6..337e813 100644
--- a/src/calf/ladspa_wrap.h
+++ b/src/calf/ladspa_wrap.h
@@ -69,10 +69,16 @@ struct ladspa_instance: public Module, public plugin_ctl_iface
     }
     virtual float get_param_value(int param_no)
     {
+        // XXXKF hack
+        if (param_no >= real_param_count())
+            return 0;
         return *Module::params[param_no];
     }
     virtual void set_param_value(int param_no, float value)
     {
+        // XXXKF hack
+        if (param_no >= real_param_count())
+            return;
         *Module::params[param_no] = value;
     }
     virtual int get_param_count()
@@ -282,7 +288,8 @@ struct ladspa_wrapper
         unsigned int no = (Bank << 7) + Program - 1;
         // printf("no = %d presets = %p:%d\n", no, presets, presets->size());
         if (no == -1U) {
-            for (int i =0 ; i < Module::param_count; i++)
+            int rpc = ladspa_instance<Module>::real_param_count();
+            for (int i =0 ; i < rpc; i++)
                 *mod->params[i] = Module::param_props[i].def_value;
             return;
         }
@@ -299,7 +306,7 @@ struct ladspa_wrapper
     static void cb_connect(LADSPA_Handle Instance, unsigned long port, LADSPA_Data *DataLocation) {
         unsigned long ins = Module::in_count;
         unsigned long outs = Module::out_count;
-        unsigned long params = Module::param_count;
+        unsigned long params = ladspa_instance<Module>::real_param_count();
         instance *const mod = (instance *)Instance;
         if (port < ins)
             mod->ins[port] = DataLocation;
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index 5d6e763..3714881 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -129,6 +129,9 @@ struct organ_enums
         par_var_mapcurve,
         param_count
     };
+    enum {
+        var_count = 1
+    };
     enum organ_waveform { 
         wave_sine, 
         wave_sinepl1, wave_sinepl2, wave_sinepl3,
diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index 01d30a8..eec733a 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -213,7 +213,7 @@ public:
         srate = sr;
     }
     void params_changed() {
-        for (int i = 0; i < param_count; i++)
+        for (int i = 0; i < param_count - var_count; i++)
             ((float *)&par_values)[i] = *params[i];
         update_params();
     }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list