changeset 4376:b3888565029e

Automated merge with ssh://hg.atheme.org//hg/audacious
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 28 Mar 2008 02:19:57 +0200
parents b095d631bec4 (current diff) 335f4ac3993a (diff)
children 4060a83ebf1f
files
diffstat 3 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/bmpconfig.c	Fri Mar 28 02:19:37 2008 +0200
+++ b/src/audacious/bmpconfig.c	Fri Mar 28 02:19:57 2008 +0200
@@ -172,6 +172,7 @@
     FALSE,          /* enable adaptive scaler */
     0.0,            /* preamp */
     -9.0,           /* default gain */
+    0x6464,         /* saved volume for both channels, 0x64=100 */
 #ifdef USE_SRC
     FALSE,          /* enable resampling */
     48000,          /* samplerate */
@@ -321,6 +322,7 @@
     {"colorize_g", &cfg.colorize_g, TRUE},
     {"colorize_b", &cfg.colorize_b, TRUE},
     {"output_bit_depth", &cfg.output_bit_depth, TRUE},
+    {"saved_volume", &cfg.saved_volume, TRUE},
 #ifdef USE_SRC
     {"src_rate", &cfg.src_rate, TRUE},
     {"src_type", &cfg.src_type, TRUE},
@@ -518,6 +520,8 @@
         cfg_db_get_float(db, NULL, eqtext, &cfg.equalizer_bands[i]);
     }
 
+    cfg_db_get_int(db,NULL, "saved_volume", &cfg.saved_volume);
+
     /* custom scale factor */
     cfg_db_get_float(db, NULL, "scale_factor", &cfg.scale_factor);
 
@@ -605,7 +609,7 @@
 {
     GList *node;
     gchar *str;
-    gint i, cur_pb_time;
+    gint i, cur_pb_time, vol_l, vol_r;
     ConfigDb *db;
     GList *saved;
     Playlist *playlist = playlist_get_active();
@@ -735,7 +739,10 @@
 
     cfg_db_set_int(db, NULL, "url_history_length",
                        g_list_length(cfg.url_history));
-
+    
+    input_get_volume(&vol_l,&vol_r);
+    cfg_db_set_int(db, NULL, "saved_volume", (vol_l<<8) | vol_r );
+    
     for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++) {
         str = g_strdup_printf("url_history%d", i);
         cfg_db_set_string(db, NULL, str, node->data);
--- a/src/audacious/bmpconfig.h	Fri Mar 28 02:19:37 2008 +0200
+++ b/src/audacious/bmpconfig.h	Fri Mar 28 02:19:57 2008 +0200
@@ -126,6 +126,7 @@
     gboolean enable_adaptive_scaler;
     gfloat replay_gain_preamp;
     gfloat default_gain;
+    gint saved_volume;
 #ifdef USE_SRC
     gboolean enable_src;
     gint src_rate;
--- a/src/audacious/main.c	Fri Mar 28 02:19:37 2008 +0200
+++ b/src/audacious/main.c	Fri Mar 28 02:19:57 2008 +0200
@@ -767,7 +767,7 @@
          * but not if we're running headless --nenolod
          */
         mainwin_setup_menus();
-
+        output_set_volume(((cfg.saved_volume & 0xff00) >> 8),(cfg.saved_volume & 0x00ff));
         ui_main_set_initial_volume();
 
         /* FIXME: delayed, because it deals directly with the plugin
@@ -805,7 +805,8 @@
                 int i;
                 gint l = 0, r = 0;
                 while (gtk_events_pending()) gtk_main_iteration();
-                output_get_volume(&l, &r);
+                l = (cfg.saved_volume & 0xff00)>>8;
+                r = cfg.saved_volume & 0x00ff;
                 output_set_volume(0,0);
                 playback_initiate();