# HG changeset patch # User nenolod # Date 1147198109 25200 # Node ID 57b57595b4042a988caa21df48e969c254404d45 # Parent dc9aaf5eba90624a9eee265e28d8cbe0339effe1 [svn] - ConfigDb goodness diff -r dc9aaf5eba90 -r 57b57595b404 Plugins/Output/jack/configure.c --- 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 @@ -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); } diff -r dc9aaf5eba90 -r 57b57595b404 Plugins/Output/jack/jack.c --- 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 #include @@ -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 */