From d4fba8438ba080517a1c1f471b8e4499d72fe0e0 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 14 Sep 2001 19:20:25 +0000 Subject: [PATCH] use the new smooth dparam for the volume slider Original commit message from CVS: use the new smooth dparam for the volume slider --- test/sinesliders.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/sinesliders.c b/test/sinesliders.c index ba60eda6d3..e22372aef3 100644 --- a/test/sinesliders.c +++ b/test/sinesliders.c @@ -38,7 +38,10 @@ int main(int argc,char *argv[]) { GstElement *thread, *sinesrc, *osssink; GstDParamManager *dpman; - GstDParam *volume, *freq; + GstDParam *volume; + GstDParam *freq; + + GValue **vol_vals; gtk_init(&argc,&argv); gst_init(&argc,&argv); @@ -69,9 +72,22 @@ int main(int argc,char *argv[]) { g_object_set(G_OBJECT(sinesrc),"buffersize",64,NULL); dpman = GST_ELEMENT_DPARAM_MANAGER(sinesrc); - volume = gst_dparam_new(G_TYPE_FLOAT); + freq = gst_dparam_new(G_TYPE_FLOAT); + //volume = gst_dparam_new(G_TYPE_FLOAT); + volume = gst_dparam_smooth_new(G_TYPE_FLOAT); + vol_vals = GST_DPARAM_GET_POINT(volume, 0LL); + + // this defines the maximum slope that this + // param can change. This says that in 10ms + // the value can change by a maximum of 0.2 + g_value_set_float(vol_vals[1], 0.2); + g_value_set_float(vol_vals[2], 10000000.0); + + // set the default update period to 0.5ms, or 2000Hz + GST_DPARAM_DEFAULT_UPDATE_PERIOD(volume) = 2000000LL; + g_assert(gst_dpman_attach_dparam (dpman, "volume", volume)); g_assert(gst_dpman_attach_dparam (dpman, "freq", freq));