[SCM] calf/master: get_changed_offsets for multiband limiter
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:41:13 UTC 2013
The following commit has been merged in the master branch:
commit 1a5d1a7fae86eb9e74d7e6d937b24d73da92b0f6
Author: Markus Schmidt <schmidt at boomshop.net>
Date: Thu Sep 20 20:45:59 2012 +0200
get_changed_offsets for multiband limiter
diff --git a/src/calf/modules_limit.h b/src/calf/modules_limit.h
index 3e0fa4c..dc65c9f 100644
--- a/src/calf/modules_limit.h
+++ b/src/calf/modules_limit.h
@@ -80,6 +80,8 @@ private:
bool asc_old;
float attack_old;
bool _sanitize;
+ mutable volatile int last_generation;
+ mutable bool redraw_graph;
public:
uint32_t srate;
bool is_active;
@@ -91,6 +93,7 @@ public:
void set_sample_rate(uint32_t sr);
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context, int *mode) const;
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context) const;
+ int get_changed_offsets(int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline) const;
};
};
diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index feacbc9..570126e 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -392,7 +392,6 @@ calf_line_graph_expose (GtkWidget *widget, GdkEventExpose *event)
}
calf_line_graph_copy_cache_to_window( lg->master_surface, c );
-
// printf("exposed %p %dx%d %d+%d\n", widget->window, event->area.x, event->area.y, event->area.width, event->area.height);
return TRUE;
diff --git a/src/modules_limit.cpp b/src/modules_limit.cpp
index 5cd32a0..2a6d57e 100644
--- a/src/modules_limit.cpp
+++ b/src/modules_limit.cpp
@@ -251,6 +251,8 @@ multibandlimiter_audio_module::multibandlimiter_audio_module()
attack_old = -1.f;
limit_old = -1.f;
asc_old = true;
+ last_generation = 0;
+ redraw_graph = false;
}
void multibandlimiter_audio_module::activate()
@@ -318,6 +320,7 @@ void multibandlimiter_audio_module::params_changed()
freq_old[0] = *params[param_freq0];
sep_old[0] = *params[param_sep0];
q_old[0] = *params[param_q0];
+ redraw_graph = true;
}
if(*params[param_freq1] != freq_old[1] or *params[param_sep1] != sep_old[1] or *params[param_q1] != q_old[1] or *params[param_mode] != mode_old) {
lpL[1][0].set_lp_rbj((float)(*params[param_freq1] * (1 - *params[param_sep1])), *params[param_q1], (float)srate);
@@ -333,6 +336,7 @@ void multibandlimiter_audio_module::params_changed()
freq_old[1] = *params[param_freq1];
sep_old[1] = *params[param_sep1];
q_old[1] = *params[param_q1];
+ redraw_graph = true;
}
if(*params[param_freq2] != freq_old[2] or *params[param_sep2] != sep_old[2] or *params[param_q2] != q_old[2] or *params[param_mode] != mode_old) {
lpL[2][0].set_lp_rbj((float)(*params[param_freq2] * (1 - *params[param_sep2])), *params[param_q2], (float)srate);
@@ -348,6 +352,7 @@ void multibandlimiter_audio_module::params_changed()
freq_old[2] = *params[param_freq2];
sep_old[2] = *params[param_sep2];
q_old[2] = *params[param_q2];
+ redraw_graph = true;
}
// set the params of all strips
float rel;
@@ -687,3 +692,17 @@ bool multibandlimiter_audio_module::get_gridline(int index, int subindex, float
return get_freq_gridline(subindex, pos, vertical, legend, context);
}
}
+
+int multibandlimiter_audio_module::get_changed_offsets(int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline) const
+{
+ subindex_graph = 0;
+ subindex_dot = 0;
+ subindex_gridline = generation ? INT_MAX : 0;
+
+ if (redraw_graph)
+ {
+ redraw_graph = false;
+ last_generation++;
+ }
+ return last_generation;
+}
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list