changeset 26497:da3f44d6cd52

Change volume preference and make sure it exists.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Fri, 03 Apr 2009 06:11:34 +0000
parents a820c03b9d4e
children 1147a3b1fb0b
files pidgin/gtkmedia.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Fri Apr 03 05:24:47 2009 +0000
+++ b/pidgin/gtkmedia.c	Fri Apr 03 06:11:34 2009 +0000
@@ -573,7 +573,7 @@
 pidgin_media_input_volume_changed(GtkRange *range, PurpleMedia *media)
 {
 	double val = (double)gtk_range_get_value(GTK_RANGE(range));
-	purple_prefs_set_int("/purple/media/audio/volume/input", val);
+	purple_prefs_set_int("/pidgin/media/audio/volume/input", val);
 	val /= 10.0;
 	purple_media_set_input_volume(media, NULL, val);
 }
@@ -582,7 +582,7 @@
 pidgin_media_output_volume_changed(GtkRange *range, PurpleMedia *media)
 {
 	double val = (double)gtk_range_get_value(GTK_RANGE(range));
-	purple_prefs_set_int("/purple/media/audio/volume/output", val);
+	purple_prefs_set_int("/pidgin/media/audio/volume/output", val);
 	val /= 10.0;
 	purple_media_set_output_volume(media, NULL, NULL, val);
 }
@@ -704,7 +704,7 @@
 		gtk_range_set_increments(GTK_RANGE(volume), 5.0, 25.0);
 		gtk_range_set_value(GTK_RANGE(volume),
 				purple_prefs_get_int(
-				"/purple/media/audio/volume/output"));
+				"/pidgin/media/audio/volume/output"));
 		gtk_scale_set_draw_value(GTK_SCALE(volume), FALSE);
 		g_signal_connect (G_OBJECT(volume), "value-changed",
 				G_CALLBACK(pidgin_media_output_volume_changed),
@@ -739,7 +739,7 @@
 		gtk_range_set_increments(GTK_RANGE(volume), 5.0, 25.0);
 		gtk_range_set_value(GTK_RANGE(volume),
 				purple_prefs_get_int(
-				"/purple/media/audio/volume/input"));
+				"/pidgin/media/audio/volume/input"));
 		gtk_scale_set_draw_value(GTK_SCALE(volume), FALSE);
 		g_signal_connect (G_OBJECT(volume), "value-changed",
 				G_CALLBACK (pidgin_media_input_volume_changed),
@@ -1016,7 +1016,7 @@
 	GstElement *bin, *src, *volume, *level;
 	GstPad *pad, *ghost;
 	double input_volume = purple_prefs_get_int(
-			"/purple/media/audio/volume/input")/10.0;
+			"/pidgin/media/audio/volume/input")/10.0;
 
 	src = gst_element_factory_make("gconfaudiosrc", NULL);
 	if (src == NULL)
@@ -1055,7 +1055,7 @@
 	GstElement *bin, *sink, *volume, *level, *queue;
 	GstPad *pad, *ghost;
 	double output_volume = purple_prefs_get_int(
-			"/purple/media/audio/volume/output")/10.0;
+			"/pidgin/media/audio/volume/output")/10.0;
 
 	sink = gst_element_factory_make("gconfaudiosink", NULL);
 	if (sink == NULL)
@@ -1139,6 +1139,12 @@
 	purple_media_manager_set_active_element(manager, default_video_sink);
 	purple_media_manager_set_active_element(manager, default_audio_src);
 	purple_media_manager_set_active_element(manager, default_audio_sink);
+
+	purple_prefs_add_none("/pidgin/media");
+	purple_prefs_add_none("/pidgin/media/audio");
+	purple_prefs_add_none("/pidgin/media/audio/volume");
+	purple_prefs_add_int("/pidgin/media/audio/volume/input", 10);
+	purple_prefs_add_int("/pidgin/media/audio/volume/output", 10);
 #endif
 }