changeset 2851:7a000caead28

Only save volumes in alsa_save_config().
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 30 Jul 2008 17:25:24 +0300
parents 587b3657990d
children f2bec2d589d6 162766a69f12 bc0f157aeb86
files src/alsa/configure.c
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/alsa/configure.c	Tue Jul 29 00:20:31 2008 +0300
+++ b/src/alsa/configure.c	Wed Jul 30 17:25:24 2008 +0300
@@ -40,19 +40,24 @@
 	alsa_cfg.mixer_card = current_mixer_card;
 	alsa_cfg.mixer_device = GET_CHARS(GTK_COMBO(mixer_devices_combo)->entry);
 
+	gtk_widget_destroy(configure_win);
+
+	/* Save configuration */
+	mcs_handle_t *cfgfile = aud_cfg_db_open();
+	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "buffer_time", alsa_cfg.buffer_time);
+	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "period_time", alsa_cfg.period_time);
+	aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"pcm_device", alsa_cfg.pcm_device);
+	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "mixer_card", alsa_cfg.mixer_card);
+	aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"mixer_device", alsa_cfg.mixer_device);
+	aud_cfg_db_close(cfgfile);
+	
+	/* Save volumes */
 	alsa_save_config();
-	gtk_widget_destroy(configure_win);
 }
 
 void alsa_save_config(void)
 {
 	mcs_handle_t *cfgfile = aud_cfg_db_open();
-
-	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "buffer_time", alsa_cfg.buffer_time);
-	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "period_time", alsa_cfg.period_time);
-	aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"pcm_device", alsa_cfg.pcm_device);
-	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "mixer_card", alsa_cfg.mixer_card);
-	aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"mixer_device", alsa_cfg.mixer_device);
 	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "volume_left", alsa_cfg.vol.left);
 	aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "volume_right", alsa_cfg.vol.right);
 	aud_cfg_db_close(cfgfile);