[SCM] calf/master: + Filter: better tolerance for race condition between parameter setting and graph drawing
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:13 UTC 2013
The following commit has been merged in the master branch:
commit fba13511829822b6243a871f46689cfa18299a54
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Tue Jan 27 21:20:02 2009 +0000
+ Filter: better tolerance for race condition between parameter setting and graph drawing
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 2f63bdf..3366196 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -595,6 +595,7 @@ public:
inertia<exponential_ramp> inertia_cutoff, inertia_resonance, inertia_gain;
once_per_n timer;
bool is_active;
+ volatile int last_generation, last_calculated_generation;
filter_module_with_inertia()
: inertia_cutoff(exponential_ramp(128), 20)
@@ -631,10 +632,12 @@ public:
void on_timer()
{
+ int gen = last_generation;
inertia_cutoff.step();
inertia_resonance.step();
inertia_gain.step();
calculate_filter();
+ last_calculated_generation = gen;
}
void activate()
@@ -689,7 +692,6 @@ class filter_audio_module:
public filter_module_with_inertia<biquad_filter_module, filter_metadata>,
public frequency_response_line_graph
{
- int last_generation;
float old_cutoff, old_resonance, old_mode;
public:
filter_audio_module()
diff --git a/src/modules_dsp.cpp b/src/modules_dsp.cpp
index c005918..5ee5bfa 100644
--- a/src/modules_dsp.cpp
+++ b/src/modules_dsp.cpp
@@ -259,7 +259,7 @@ int filter_audio_module::get_changed_offsets(int generation, int &subindex_graph
subindex_graph = 0;
subindex_dot = subindex_gridline = generation ? INT_MAX : 0;
}
- if (generation == last_generation)
+ if (generation == last_calculated_generation)
subindex_graph = INT_MAX;
return last_generation;
}
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list