comparison Plugins/Output/jack/configure.c @ 1018:57b57595b404 trunk

[svn] - ConfigDb goodness
author nenolod
date Tue, 09 May 2006 11:08:29 -0700
parents ea321d1dae48
children f12d7e208b43
comparison
equal deleted inserted replaced
1017:dc9aaf5eba90 1018:57b57595b404
22 * Thomas Nillson, 4Front Technologies and Galex Yen 22 * Thomas Nillson, 4Front Technologies and Galex Yen
23 */ 23 */
24 24
25 #include "jack.h" 25 #include "jack.h"
26 26
27 #include "libaudacious/configfile.h" 27 #include "libaudacious/configdb.h"
28 28
29 #include <gtk/gtk.h> 29 #include <gtk/gtk.h>
30 30
31 extern jackconfig jack_cfg; 31 extern jackconfig jack_cfg;
32 32
41 41
42 #define GET_CHARS(edit) gtk_editable_get_chars(GTK_EDITABLE(edit), 0, -1) 42 #define GET_CHARS(edit) gtk_editable_get_chars(GTK_EDITABLE(edit), 0, -1)
43 43
44 static void configure_win_ok_cb(GtkWidget * w, gpointer data) 44 static void configure_win_ok_cb(GtkWidget * w, gpointer data)
45 { 45 {
46 ConfigFile *cfgfile; 46 ConfigDb *cfgfile;
47 gchar *filename;
48 47
49 jack_cfg.isTraceEnabled = (gint) GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active; 48 jack_cfg.isTraceEnabled = (gint) GTK_CHECK_BUTTON(GTK_isTraceEnabled)->toggle_button.active;
50 jack_cfg.port_connection_mode = GET_CHARS(GTK_COMBO(port_connection_mode_combo)->entry); 49 jack_cfg.port_connection_mode = GET_CHARS(GTK_COMBO(port_connection_mode_combo)->entry);
51 50
52 jack_set_port_connection_mode(); /* update the connection mode */ 51 jack_set_port_connection_mode(); /* update the connection mode */
53 52
54 filename = g_strconcat(g_get_home_dir(), "/.audacious/config", NULL); 53 cfgfile = bmp_cfg_db_open();
55
56 cfgfile = xmms_cfg_open_file(filename);
57 if (!cfgfile)
58 cfgfile = xmms_cfg_new();
59 54
60 xmms_cfg_write_boolean(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled); 55 bmp_cfg_db_set_bool(cfgfile, "jack", "isTraceEnabled", jack_cfg.isTraceEnabled);
61 xmms_cfg_write_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode); 56 bmp_cfg_db_set_string(cfgfile, "jack", "port_connection_mode", jack_cfg.port_connection_mode);
62 xmms_cfg_write_file(cfgfile, filename); 57 bmp_cfg_db_close(cfgfile);
63 xmms_cfg_free(cfgfile);
64
65 g_free(filename);
66 58
67 gtk_widget_destroy(configure_win); 59 gtk_widget_destroy(configure_win);
68 } 60 }
69 61
70 static void get_port_connection_modes(GtkCombo *combo) 62 static void get_port_connection_modes(GtkCombo *combo)