changeset 1018:57b57595b404 trunk

[svn] - ConfigDb goodness
author nenolod
date Tue, 09 May 2006 11:08:29 -0700
parents dc9aaf5eba90
children 5567ab3f2918
files Plugins/Output/jack/configure.c Plugins/Output/jack/jack.c
diffstat 2 files changed, 12 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Output/jack/configure.c	Tue May 09 10:05:03 2006 -0700
+++ b/Plugins/Output/jack/configure.c	Tue May 09 11:08:29 2006 -0700
@@ -24,7 +24,7 @@
 
 #include "jack.h"
 
-#include "libaudacious/configfile.h"
+#include "libaudacious/configdb.h"
 
 #include <gtk/gtk.h>
 
@@ -43,26 +43,18 @@
 
 static void configure_win_ok_cb(GtkWidget * w, gpointer data)
 {
-	ConfigFile *cfgfile;
-	gchar *filename;
+	ConfigDb *cfgfile;
 
 	jack_cfg.isTraceEnabled = (gint) GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active;
   jack_cfg.port_connection_mode = GET_CHARS(GTK_COMBO(port_connection_mode_combo)->entry);
 
   jack_set_port_connection_mode(); /* update the connection mode */
 
-	filename = g_strconcat(g_get_home_dir(), "/.audacious/config", NULL);
-	
-	cfgfile = xmms_cfg_open_file(filename);
-	if (!cfgfile)
-		cfgfile = xmms_cfg_new();
+	cfgfile = bmp_cfg_db_open();
 
-	xmms_cfg_write_boolean(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled);
-  xmms_cfg_write_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode);
-	xmms_cfg_write_file(cfgfile, filename);
-	xmms_cfg_free(cfgfile);
-
-	g_free(filename);
+	bmp_cfg_db_set_bool(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled);
+	bmp_cfg_db_set_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode);
+	bmp_cfg_db_close(cfgfile);
 
 	gtk_widget_destroy(configure_win);
 }
--- a/Plugins/Output/jack/jack.c	Tue May 09 10:05:03 2006 -0700
+++ b/Plugins/Output/jack/jack.c	Tue May 09 11:08:29 2006 -0700
@@ -6,7 +6,7 @@
  *	This code maps xmms calls into the jack translation library
  */
 
-#include "libaudacious/configfile.h"
+#include "libaudacious/configdb.h"
 #include "libaudacious/util.h"
 #include <dlfcn.h>
 #include <gtk/gtk.h>
@@ -199,24 +199,21 @@
 void jack_init(void)
 {
   /* read the isTraceEnabled setting from the config file */
-  ConfigFile *cfgfile;
-  gchar *filename;
+  ConfigDb *cfgfile;
 
-  filename = g_strconcat(g_get_home_dir(), "/.audacious/config", NULL);
-  cfgfile = xmms_cfg_open_file(filename);
+  cfgfile = bmp_cfg_db_open();
   if (!cfgfile)
   {
       jack_cfg.isTraceEnabled = FALSE;
       jack_cfg.port_connection_mode = "CONNECT_ALL"; /* default to connect all */
   } else
   {
-      xmms_cfg_read_boolean(cfgfile, "jack", "isTraceEnabled", &jack_cfg.isTraceEnabled);
-      if(!xmms_cfg_read_string(cfgfile, "jack", "port_connection_mode", &jack_cfg.port_connection_mode))
+      bmp_cfg_db_get_bool(cfgfile, "jack", "isTraceEnabled", &jack_cfg.isTraceEnabled);
+      if(!bmp_cfg_db_get_string(cfgfile, "jack", "port_connection_mode", &jack_cfg.port_connection_mode))
           jack_cfg.port_connection_mode = "CONNECT_ALL";
   }
 
-  xmms_cfg_free(cfgfile);
-  g_free(filename);
+  bmp_cfg_db_close(cfgfile);
 
   TRACE("initializing\n");
   JACK_Init(); /* initialize the driver */