Re: Pidgin 2.13.0 has been released!!

David Woodhouse <[email protected]> Fri, 09 Mar 2018 17:08:41 +0000
Newsgroups gmane.comp.gnome.gaim.devel
Message-ID <[email protected]>
On Fri, 2018-03-09 at 16:58 +0000, David Woodhouse wrote:
> 
> I wonder if instead of just *not* multiplying by five, instead we
> should apply a logarithmic scale? Otherwise when I speak I'm only
> changing a few pixels at the far left-hand-side...

Or just scale and clip. Joakim?

diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c
index 2c1fdea..43c697b 100644
--- a/pidgin/gtkmedia.c
+++ b/pidgin/gtkmedia.c
@@ -457,8 +457,12 @@ level_message_cb(PurpleMedia *media, gchar *session_id, gchar *participant,
 	else
 		progress = pidgin_media_get_widget(gtkmedia, session_id, participant);
 
+	level *= 5;
+	if (level > 1.0)
+		level = 1.0;
+
 	if (progress)
-		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), level * 5);
+		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), level);
 }
 
 
diff --git a/pidgin/plugins/vvconfig.c b/pidgin/plugins/vvconfig.c
index 10cea48..67963ab 100644
--- a/pidgin/plugins/vvconfig.c
+++ b/pidgin/plugins/vvconfig.c
@@ -665,7 +665,11 @@ gst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx)
 			GstElement *valve;
 
 			percent = gst_msg_db_to_percent(msg, "rms");
-			gtk_progress_bar_set_fraction(ctx->level, percent * 5);
+			percent *= 5;
+			if (percent > 1.0)
+				percent = 1.0;
+
+			gtk_progress_bar_set_fraction(ctx->level, percent);
 
 			percent = gst_msg_db_to_percent(msg, "decay");
 			threshold = gtk_range_get_value(ctx->threshold) / 100.0;

_______________________________________________
Devel mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/devel
smime.p7s (application/x-pkcs7-signature, 5.1 KB) - not displayed