mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-04 16:39:39 +00:00
use dparam_spec to set slider max, min and defaults
Original commit message from CVS: use dparam_spec to set slider max, min and defaults
This commit is contained in:
parent
5be7eb77cf
commit
7704405ab2
1 changed files with 22 additions and 14 deletions
|
@ -40,26 +40,13 @@ int main(int argc,char *argv[]) {
|
||||||
GstDParamManager *dpman;
|
GstDParamManager *dpman;
|
||||||
GstDParam *volume;
|
GstDParam *volume;
|
||||||
GstDParam *freq;
|
GstDParam *freq;
|
||||||
|
GstDParamSpec *spec;
|
||||||
|
|
||||||
GValue **vol_vals;
|
GValue **vol_vals;
|
||||||
|
|
||||||
gtk_init(&argc,&argv);
|
gtk_init(&argc,&argv);
|
||||||
gst_init(&argc,&argv);
|
gst_init(&argc,&argv);
|
||||||
|
|
||||||
/***** set up the GUI *****/
|
|
||||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
|
||||||
g_signal_connect(window,"delete_event",GTK_SIGNAL_FUNC(quit_live),NULL);
|
|
||||||
hbox = gtk_hbox_new(TRUE,0);
|
|
||||||
gtk_container_add(GTK_CONTAINER(window),hbox);
|
|
||||||
|
|
||||||
volume_adj = (GtkAdjustment*)gtk_adjustment_new(1.0, 0.0, 1.0, 0.1, 0.01, 0.01);
|
|
||||||
volume_slider = gtk_vscale_new(volume_adj);
|
|
||||||
gtk_box_pack_start(GTK_BOX(hbox),volume_slider,TRUE,TRUE,0);
|
|
||||||
|
|
||||||
freq_adj = (GtkAdjustment*)gtk_adjustment_new(440.0, 0.0, 2000.0, 1.0, 5.0, 5.0);
|
|
||||||
freq_slider = gtk_vscale_new(freq_adj);
|
|
||||||
gtk_box_pack_start(GTK_BOX(hbox),freq_slider,TRUE,TRUE,0);
|
|
||||||
|
|
||||||
/***** construct the pipeline *****/
|
/***** construct the pipeline *****/
|
||||||
|
|
||||||
g_print("creating elements\n");
|
g_print("creating elements\n");
|
||||||
|
@ -93,6 +80,27 @@ int main(int argc,char *argv[]) {
|
||||||
|
|
||||||
gst_dpman_set_mode(dpman, "synchronous");
|
gst_dpman_set_mode(dpman, "synchronous");
|
||||||
|
|
||||||
|
/***** set up the GUI *****/
|
||||||
|
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
g_signal_connect(window,"delete_event",GTK_SIGNAL_FUNC(quit_live),NULL);
|
||||||
|
hbox = gtk_hbox_new(TRUE,0);
|
||||||
|
gtk_container_add(GTK_CONTAINER(window),hbox);
|
||||||
|
|
||||||
|
spec = gst_dpman_get_dparam_spec (dpman, "volume");
|
||||||
|
volume_adj = (GtkAdjustment*)gtk_adjustment_new(g_value_get_float(spec->default_val),
|
||||||
|
g_value_get_float(spec->min_val),
|
||||||
|
g_value_get_float(spec->max_val), 0.1, 0.01, 0.01);
|
||||||
|
volume_slider = gtk_vscale_new(volume_adj);
|
||||||
|
gtk_box_pack_start(GTK_BOX(hbox),volume_slider,TRUE,TRUE,0);
|
||||||
|
|
||||||
|
spec = gst_dpman_get_dparam_spec (dpman, "freq");
|
||||||
|
freq_adj = (GtkAdjustment*)gtk_adjustment_new(g_value_get_float(spec->default_val),
|
||||||
|
g_value_get_float(spec->min_val),
|
||||||
|
g_value_get_float(spec->max_val), 0.1, 0.01, 0.01);
|
||||||
|
freq_slider = gtk_vscale_new(freq_adj);
|
||||||
|
gtk_box_pack_start(GTK_BOX(hbox),freq_slider,TRUE,TRUE,0);
|
||||||
|
|
||||||
|
|
||||||
/***** set up the handlers and such *****/
|
/***** set up the handlers and such *****/
|
||||||
//gtk_signal_connect(volume_adj,"value-changed",GTK_SIGNAL_FUNC(volume_changed),sinesrc);
|
//gtk_signal_connect(volume_adj,"value-changed",GTK_SIGNAL_FUNC(volume_changed),sinesrc);
|
||||||
g_signal_connect(volume_adj,"value-changed",
|
g_signal_connect(volume_adj,"value-changed",
|
||||||
|
|
Loading…
Reference in a new issue