[SCM] calf/master: + LV2 GUI: do not produce live graphs for inactive plugins

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


The following commit has been merged in the master branch:
commit 8e78899604d945fcaf4f3c5339c99ecb64da9879
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Tue Nov 11 23:16:38 2008 +0000

    + LV2 GUI: do not produce live graphs for inactive plugins

diff --git a/src/calf/modules.h b/src/calf/modules.h
index 9018cb4..8b16d9c 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -81,6 +81,11 @@ public:
     uint32_t srate;
     bool clear_reset;
     float last_r_phase;
+    bool is_active;
+public:
+    flanger_audio_module() {
+        is_active = false;
+    }
     void set_sample_rate(uint32_t sr);
     void params_changed() {
         float dry = 1.0;
@@ -137,6 +142,11 @@ public:
     bool clear_reset;
     float last_r_phase;
     dsp::simple_phaser<12> left, right;
+    bool is_active;
+public:
+    phaser_audio_module() {
+        is_active = false;
+    }
     void params_changed() {
         float dry = 1.0;
         float wet = *params[par_amount];
@@ -230,6 +240,7 @@ public:
     int order;
     inertia<exponential_ramp> inertia_cutoff, inertia_resonance;
     once_per_n timer;
+    bool is_active;
     
     filter_audio_module()
     : inertia_cutoff(exponential_ramp(128), 20)
@@ -237,6 +248,7 @@ public:
     , timer(128)
     {
         order = 0;
+        is_active = false;
     }
     
     void calculate_filter()
@@ -628,10 +640,12 @@ public:
     uint32_t srate;
     dsp::multichorus<float, sine_multi_lfo<float, 8>, 4096> left, right;
     float last_r_phase;
+    bool is_active;
     
 public:    
     multichorus_audio_module()
     {
+        is_active = false;
     }
     
     void params_changed()
@@ -668,6 +682,7 @@ public:
         return outputs_mask; // XXXKF allow some delay after input going blank
     }
     void activate();
+    void deactivate();
     void set_sample_rate(uint32_t sr);
     bool get_graph(int index, int subindex, float *data, int points, cairo_t *context);
     float freq_gain(int subindex, float freq, float srate);
diff --git a/src/modules_dsp.cpp b/src/modules_dsp.cpp
index 1628be1..d8e0112 100644
--- a/src/modules_dsp.cpp
+++ b/src/modules_dsp.cpp
@@ -36,6 +36,7 @@ void flanger_audio_module::activate() {
     last_r_phase = *params[par_stereo] * (1.f / 360.f);
     left.reset_phase(0.f);
     right.reset_phase(last_r_phase);
+    is_active = true;
 }
 
 void flanger_audio_module::set_sample_rate(uint32_t sr) {
@@ -45,10 +46,13 @@ void flanger_audio_module::set_sample_rate(uint32_t sr) {
 }
 
 void flanger_audio_module::deactivate() {
+    is_active = false;
 }
 
 bool flanger_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_t *context)
 {
+    if (!is_active)
+        return false;
     if (index == par_delay && subindex < 2) 
         return calf_plugins::get_graph(*this, subindex, data, points);
     return false;
@@ -70,6 +74,7 @@ void phaser_audio_module::set_sample_rate(uint32_t sr)
 
 void phaser_audio_module::activate()
 {
+    is_active = true;
     left.reset();
     right.reset();
     last_r_phase = *params[par_stereo] * (1.f / 360.f);
@@ -79,6 +84,7 @@ void phaser_audio_module::activate()
 
 void phaser_audio_module::deactivate()
 {
+    is_active = false;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
@@ -110,10 +116,12 @@ void filter_audio_module::activate()
     }
     timer = once_per_n(srate / 1000);
     timer.start();
+    is_active = true;
 }
 
 void filter_audio_module::deactivate()
 {
+    is_active = false;
 }
 
 void filter_audio_module::set_sample_rate(uint32_t sr)
@@ -123,6 +131,8 @@ void filter_audio_module::set_sample_rate(uint32_t sr)
 
 bool filter_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_t *context)
 {
+    if (!is_active)
+        return false;
     if (index == par_cutoff && !subindex) 
         return calf_plugins::get_graph(*this, subindex, data, points);
     return false;
@@ -191,10 +201,17 @@ void rotary_speaker_audio_module::control_change(int ctl, int val)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
-void multichorus_audio_module::activate() {
+void multichorus_audio_module::activate()
+{
+    is_active = true;
     params_changed();
 }
 
+void multichorus_audio_module::deactivate()
+{
+    is_active = false;
+}
+
 void multichorus_audio_module::set_sample_rate(uint32_t sr) {
     srate = sr;
     left.setup(sr);
@@ -203,6 +220,8 @@ void multichorus_audio_module::set_sample_rate(uint32_t sr) {
 
 bool multichorus_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_t *context)
 {
+    if (!is_active)
+        return false;
     if (index == par_delay && subindex < 2) 
         return calf_plugins::get_graph(*this, subindex, data, points);
     return false;

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list