summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-05 10:54:12 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-11-05 10:54:12 +0100
commitfb682d04448624d919839da7989e8ce0575730a0 (patch)
treed414f362b364d6ccccab852d7479900a28ec9a95
parent64e00f172ce7d13628cf007ddbd20efa04f71342 (diff)
equalizer: Notify about band property changes caused by changing number of bands
-rw-r--r--gst/equalizer/gstiirequalizer.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gst/equalizer/gstiirequalizer.c b/gst/equalizer/gstiirequalizer.c
index fd8b4a065..ad3516d26 100644
--- a/gst/equalizer/gstiirequalizer.c
+++ b/gst/equalizer/gstiirequalizer.c
@@ -693,10 +693,22 @@ gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count)
freq0 = LOWEST_FREQ;
for (i = 0; i < new_count; i++) {
freq1 = freq0 * step;
- equ->bands[i]->type = BAND_TYPE_PEAK;
+
+ if (i == 0)
+ equ->bands[i]->type = BAND_TYPE_LOW_SHELF;
+ else if (i == new_count - 1)
+ equ->bands[i]->type = BAND_TYPE_HIGH_SHELF;
+ else
+ equ->bands[i]->type = BAND_TYPE_PEAK;
+
equ->bands[i]->freq = freq0 + ((freq1 - freq0) / 2.0);
equ->bands[i]->width = freq1 - freq0;
GST_DEBUG ("band[%2d] = '%lf'", i, equ->bands[i]->freq);
+
+ g_object_notify (G_OBJECT (equ->bands[i]), "bandwidth");
+ g_object_notify (G_OBJECT (equ->bands[i]), "freq");
+ g_object_notify (G_OBJECT (equ->bands[i]), "type");
+
/*
if(equ->bands[i]->freq<10000.0)
sprintf (name,"%dHz",(gint)equ->bands[i]->freq);
@@ -707,8 +719,6 @@ gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count)
*/
freq0 = freq1;
}
- equ->bands[0]->type = BAND_TYPE_LOW_SHELF;
- equ->bands[new_count - 1]->type = BAND_TYPE_HIGH_SHELF;
equ->need_new_coefficients = TRUE;
BANDS_UNLOCK (equ);