3a3a3bf
diff -Nur audacious-plugin-fc-0.6-aud30/src/configure.c audacious-plugin-fc-0.6-aud31/src/configure.c
3a3a3bf
--- audacious-plugin-fc-0.6-aud30/src/configure.c	2011-10-13 23:17:11.000000000 +0200
8bebb7b
+++ audacious-plugin-fc-0.6-aud31/src/configure.c	2011-10-14 11:44:31.000000000 +0200
8bebb7b
@@ -1,4 +1,4 @@
3a3a3bf
-#include <audacious/configdb.h>
8bebb7b
+#include <audacious/misc.h>
3a3a3bf
 #include <audacious/plugin.h>
3a3a3bf
 #include <audacious/preferences.h>
3a3a3bf
 #include <glib.h>
8bebb7b
@@ -8,26 +8,25 @@
3a3a3bf
 FCpluginConfig fc_myConfig;
3a3a3bf
 FCpluginConfig config;
3a3a3bf
 
3a3a3bf
-static gchar configSection[] = "FutureComposer";
3a3a3bf
+static gchar const configSection[] = "FutureComposer";
3a3a3bf
 
3a3a3bf
 static const gint FREQ_SAMPLE_48 = 48000;
3a3a3bf
 static const gint FREQ_SAMPLE_44 = 44100;
3a3a3bf
 static const gint FREQ_SAMPLE_22 = 22050;
3a3a3bf
 
8bebb7b
-void fc_ip_load_config() {
3a3a3bf
-    mcs_handle_t *cfg;
8bebb7b
+static const gchar* const plugin_defaults[] = {
8bebb7b
+    "frequency", "44100",
8bebb7b
+    "precision", "8",
8bebb7b
+    "channels", "1",
8bebb7b
+    NULL
8bebb7b
+};
8bebb7b
 
8bebb7b
-    fc_myConfig.frequency = FREQ_SAMPLE_44;
8bebb7b
-    fc_myConfig.precision = 8;
8bebb7b
-    fc_myConfig.channels = 1;
8bebb7b
-    
3a3a3bf
-    if ((cfg = aud_cfg_db_open())) {
3a3a3bf
-        aud_cfg_db_get_int(cfg, configSection, "frequency", &fc_myConfig.frequency);
3a3a3bf
-        aud_cfg_db_get_int(cfg, configSection, "precision", &fc_myConfig.precision);
3a3a3bf
-        aud_cfg_db_get_int(cfg, configSection, "channels", &fc_myConfig.channels);
8bebb7b
+void fc_ip_load_config() {
8bebb7b
+    aud_config_set_defaults(configSection,plugin_defaults);
8bebb7b
 
3a3a3bf
-        aud_cfg_db_close(cfg);
3a3a3bf
-    }
3a3a3bf
+    fc_myConfig.frequency = aud_get_int(configSection, "frequency");
3a3a3bf
+    fc_myConfig.precision = aud_get_int(configSection, "precision");
3a3a3bf
+    fc_myConfig.channels = aud_get_int(configSection, "channels");
3a3a3bf
 
3a3a3bf
     fc_myConfig.freq48 = fc_myConfig.freq44 = fc_myConfig.freq22 = FALSE;
3a3a3bf
     fc_myConfig.bits16 = fc_myConfig.bits8 = FALSE;
8bebb7b
@@ -65,14 +64,9 @@
3a3a3bf
 }
3a3a3bf
 
3a3a3bf
 static void fc_ip_config_save() {
3a3a3bf
-    mcs_handle_t *cfg;
3a3a3bf
-
3a3a3bf
-    if ((cfg = aud_cfg_db_open())) {
3a3a3bf
-        aud_cfg_db_set_int(cfg, configSection, "frequency", fc_myConfig.frequency);
3a3a3bf
-        aud_cfg_db_set_int(cfg, configSection, "precision", fc_myConfig.precision);
3a3a3bf
-        aud_cfg_db_set_int(cfg, configSection, "channels", fc_myConfig.channels);
3a3a3bf
-        aud_cfg_db_close(cfg);
3a3a3bf
-    }
3a3a3bf
+    aud_set_int(configSection, "frequency", fc_myConfig.frequency);
3a3a3bf
+    aud_set_int(configSection, "precision", fc_myConfig.precision);
3a3a3bf
+    aud_set_int(configSection, "channels", fc_myConfig.channels);
3a3a3bf
 }
3a3a3bf
 
3a3a3bf
 static void configure_apply() {
8bebb7b
@@ -126,16 +120,16 @@
3a3a3bf
 };
3a3a3bf
 
3a3a3bf
 static PreferencesWidget prefs_top_row[] = {
3a3a3bf
-    {WIDGET_BOX, "Frequency [Hz]:", NULL, NULL, NULL, FALSE,
3a3a3bf
+    {WIDGET_BOX, "Frequency [Hz]:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL,
3a3a3bf
      {.box = {prefs_frequency, G_N_ELEMENTS(prefs_frequency), FALSE, TRUE}}},
3a3a3bf
-    {WIDGET_BOX, "Precision [bits]:", NULL, NULL, NULL, FALSE,
3a3a3bf
+    {WIDGET_BOX, "Precision [bits]:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL,
3a3a3bf
      {.box = {prefs_precision, G_N_ELEMENTS(prefs_precision), FALSE, TRUE}}},
3a3a3bf
-    {WIDGET_BOX, "Channels:", NULL, NULL, NULL, FALSE,
3a3a3bf
+    {WIDGET_BOX, "Channels:", NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL,
3a3a3bf
      {.box = {prefs_channels, G_N_ELEMENTS(prefs_channels), FALSE, TRUE}}},
3a3a3bf
 };
3a3a3bf
 
3a3a3bf
 static PreferencesWidget prefs[] = {
3a3a3bf
-    {WIDGET_BOX, NULL, NULL, NULL, NULL, FALSE,
3a3a3bf
+    {WIDGET_BOX, NULL, NULL, NULL, NULL, FALSE, VALUE_NULL, NULL, NULL,
3a3a3bf
      {.box = {prefs_top_row, G_N_ELEMENTS(prefs_top_row), TRUE, FALSE}}},
3a3a3bf
 };
3a3a3bf