comparison pidgin/plugins/vvconfig.c @ 32398:544e6ed9d850

The function gst_msg_db_to_percent already retyrns a number between 0.0 and 1.0, and a GtkProgressBar is between 0.0 and 1.0, so I don't know why the level is multiplied by 5. Maybe microphones aren't that loud? I expect the "volume" control to increase it, so I'm not so sure. I guess we'll see what people think. Fixes #14426.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 22 Dec 2011 04:27:59 +0000
parents 152661e41e7f
children 763d65f3f758
comparison
equal deleted inserted replaced
32397:9e9eb3cd5677 32398:544e6ed9d850
610 gdouble percent; 610 gdouble percent;
611 gdouble threshold; 611 gdouble threshold;
612 GstElement *valve; 612 GstElement *valve;
613 613
614 percent = gst_msg_db_to_percent(msg, "rms"); 614 percent = gst_msg_db_to_percent(msg, "rms");
615 gtk_progress_bar_set_fraction(ctx->level, percent * 5); 615 gtk_progress_bar_set_fraction(ctx->level, percent);
616 616
617 percent = gst_msg_db_to_percent(msg, "decay"); 617 percent = gst_msg_db_to_percent(msg, "decay");
618 threshold = gtk_range_get_value(ctx->threshold) / 100.0; 618 threshold = gtk_range_get_value(ctx->threshold) / 100.0;
619 valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve"); 619 valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve");
620 g_object_set(valve, "drop", (percent < threshold), NULL); 620 g_object_set(valve, "drop", (percent < threshold), NULL);