comparison Plugins/Output/crossfade/configure.c @ 310:0b993b8d7806 trunk

[svn] Convert to configdb usage.
author chainsaw
date Sat, 17 Dec 2005 12:52:02 -0800
parents 08e4eb900f21
children 51b8f124936e
comparison
equal deleted inserted replaced
309:b04ce1c98b6f 310:0b993b8d7806
191 g_strfreev(lines); 191 g_strfreev(lines);
192 } 192 }
193 #endif 193 #endif
194 194
195 static void 195 static void
196 read_fade_config(ConfigFile *cfgfile, gchar *section, gchar *key, fade_config_t *fc) 196 read_fade_config(ConfigDb *db, gchar *section, gchar *key, fade_config_t *fc)
197 { 197 {
198 gchar *s = NULL; 198 gchar *s = NULL;
199 gint n; 199 gint n;
200 200
201 if(!cfgfile || !section || !key || !fc) return; 201 if(!db || !section || !key || !fc) return;
202 202
203 xmms_cfg_read_string(cfgfile, section, key, &s); 203 bmp_cfg_db_get_string(db, section, key, &s);
204 if(!s) return; 204 if(!s) return;
205 205
206 n = sscanf(s, 206 n = sscanf(s,
207 "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", 207 "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
208 &fc->type, 208 &fc->type,
226 226
227 g_free(s); 227 g_free(s);
228 } 228 }
229 229
230 static void 230 static void
231 write_fade_config(ConfigFile *cfgfile, gchar *section, gchar *key, fade_config_t *fc) 231 write_fade_config(ConfigDb *db, gchar *section, gchar *key, fade_config_t *fc)
232 { 232 {
233 gchar *s; 233 gchar *s;
234 234
235 if(!cfgfile || !section || !key || !fc) return; 235 if(!db || !section || !key || !fc) return;
236 236
237 s = g_strdup_printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", 237 s = g_strdup_printf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
238 fc->type, 238 fc->type,
239 fc->pause_len_ms, 239 fc->pause_len_ms,
240 fc->simple_len_ms, 240 fc->simple_len_ms,
254 fc->flush_in_len_ms, 254 fc->flush_in_len_ms,
255 fc->flush_in_volume); 255 fc->flush_in_volume);
256 256
257 if(!s) return; 257 if(!s) return;
258 258
259 xmms_cfg_write_string(cfgfile, section, key, s); 259 bmp_cfg_db_set_string(db, section, key, s);
260 g_free(s); 260 g_free(s);
261 } 261 }
262 262
263 void 263 void
264 xfade_load_config() 264 xfade_load_config()
265 { 265 {
266 #ifdef PRESET_SUPPORT 266 #ifdef PRESET_SUPPORT
267 gchar *filename; 267 gchar *filename;
268 #endif 268 #endif
269 gchar *section = "Crossfade"; 269 gchar *section = "Crossfade";
270 ConfigFile *cfgfile; 270 ConfigDb *db;
271 271
272 if((cfgfile = xmms_cfg_open_default_file())) { 272 db = bmp_cfg_db_open();
273 /* config items used in v0.1 */ 273
274 xmms_cfg_read_string (cfgfile, section, "output_plugin", &config->op_name); 274 /* config items used in v0.1 */
275 xmms_cfg_read_string (cfgfile, section, "op_config_string", &config->op_config_string); 275 bmp_cfg_db_get_string(db, section, "output_plugin", &config->op_name);
276 xmms_cfg_read_int (cfgfile, section, "buffer_size", &config->mix_size_ms); 276 bmp_cfg_db_get_string(db, section, "op_config_string", &config->op_config_string);
277 xmms_cfg_read_int (cfgfile, section, "sync_size", &config->sync_size_ms); 277 bmp_cfg_db_get_int(db, section, "buffer_size", &config->mix_size_ms);
278 xmms_cfg_read_int (cfgfile, section, "preload_size", &config->preload_size_ms); 278 bmp_cfg_db_get_int(db, section, "sync_size", &config->sync_size_ms);
279 xmms_cfg_read_int (cfgfile, section, "songchange_timeout", &config->songchange_timeout); 279 bmp_cfg_db_get_int(db, section, "preload_size", &config->preload_size_ms);
280 xmms_cfg_read_boolean(cfgfile, section, "enable_mixer", &config->enable_mixer); 280 bmp_cfg_db_get_int(db, section, "songchange_timeout", &config->songchange_timeout);
281 xmms_cfg_read_boolean(cfgfile, section, "mixer_reverse", &config->mixer_reverse); 281 bmp_cfg_db_get_bool(db, section, "enable_mixer", &config->enable_mixer);
282 xmms_cfg_read_boolean(cfgfile, section, "enable_debug", &config->enable_debug); 282 bmp_cfg_db_get_bool(db, section, "mixer_reverse", &config->mixer_reverse);
283 xmms_cfg_read_boolean(cfgfile, section, "enable_monitor", &config->enable_monitor); 283 bmp_cfg_db_get_bool(db, section, "enable_debug", &config->enable_debug);
284 284 bmp_cfg_db_get_bool(db, section, "enable_monitor", &config->enable_monitor);
285 /* config items introduced by v0.2 */ 285
286 xmms_cfg_read_boolean(cfgfile, section, "gap_lead_enable", &config->gap_lead_enable); 286 /* config items introduced by v0.2 */
287 xmms_cfg_read_int (cfgfile, section, "gap_lead_len_ms", &config->gap_lead_len_ms); 287 bmp_cfg_db_get_bool(db, section, "gap_lead_enable", &config->gap_lead_enable);
288 xmms_cfg_read_int (cfgfile, section, "gap_lead_level", &config->gap_lead_level); 288 bmp_cfg_db_get_int(db, section, "gap_lead_len_ms", &config->gap_lead_len_ms);
289 xmms_cfg_read_boolean(cfgfile, section, "gap_trail_enable", &config->gap_trail_enable); 289 bmp_cfg_db_get_int(db, section, "gap_lead_level", &config->gap_lead_level);
290 xmms_cfg_read_int (cfgfile, section, "gap_trail_len_ms", &config->gap_trail_len_ms); 290 bmp_cfg_db_get_bool(db, section, "gap_trail_enable", &config->gap_trail_enable);
291 xmms_cfg_read_int (cfgfile, section, "gap_trail_level", &config->gap_trail_level); 291 bmp_cfg_db_get_int(db, section, "gap_trail_len_ms", &config->gap_trail_len_ms);
292 xmms_cfg_read_int (cfgfile, section, "gap_trail_locked", &config->gap_trail_locked); 292 bmp_cfg_db_get_int(db, section, "gap_trail_level", &config->gap_trail_level);
293 293 bmp_cfg_db_get_int(db, section, "gap_trail_locked", &config->gap_trail_locked);
294 /* config items introduced by v0.2.1 */ 294
295 xmms_cfg_read_boolean(cfgfile, section, "buffer_size_auto", &config->mix_size_auto); 295 /* config items introduced by v0.2.1 */
296 296 bmp_cfg_db_get_bool(db, section, "buffer_size_auto", &config->mix_size_auto);
297 /* config items introduced by v0.2.3 */ 297
298 xmms_cfg_read_boolean(cfgfile, section, "album_detection", &config->album_detection); 298 /* config items introduced by v0.2.3 */
299 bmp_cfg_db_get_bool(db, section, "album_detection", &config->album_detection);
299 300
300 /* config items introduced by v0.2.4 */ 301 /* config items introduced by v0.2.4 */
301 xmms_cfg_read_boolean(cfgfile, section, "http_workaround", &config->enable_http_workaround); 302 bmp_cfg_db_get_bool(db, section, "http_workaround", &config->enable_http_workaround);
302 xmms_cfg_read_boolean(cfgfile, section, "enable_op_max_used", &config->enable_op_max_used); 303 bmp_cfg_db_get_bool(db, section, "enable_op_max_used", &config->enable_op_max_used);
303 xmms_cfg_read_int (cfgfile, section, "op_max_used_ms", &config->op_max_used_ms); 304 bmp_cfg_db_get_int(db, section, "op_max_used_ms", &config->op_max_used_ms);
304 305
305 /* config items introduced by v0.2.6 */ 306 /* config items introduced by v0.2.6 */
306 xmms_cfg_read_string (cfgfile, section, "effect_plugin", &config->ep_name); 307 bmp_cfg_db_get_string(db, section, "effect_plugin", &config->ep_name);
307 xmms_cfg_read_boolean(cfgfile, section, "effect_enable", &config->ep_enable); 308 bmp_cfg_db_get_bool(db, section, "effect_enable", &config->ep_enable);
308 xmms_cfg_read_int (cfgfile, section, "output_rate", &config->output_rate); 309 bmp_cfg_db_get_int(db, section, "output_rate", &config->output_rate);
309 310
310 /* config items introduced by v0.3.0 */ 311 /* config items introduced by v0.3.0 */
311 xmms_cfg_read_boolean(cfgfile, section, "volnorm_enable", &config->volnorm_enable); 312 bmp_cfg_db_get_bool(db, section, "volnorm_enable", &config->volnorm_enable);
312 xmms_cfg_read_boolean(cfgfile, section, "volnorm_use_qa", &config->volnorm_use_qa); 313 bmp_cfg_db_get_bool(db, section, "volnorm_use_qa", &config->volnorm_use_qa);
313 xmms_cfg_read_int (cfgfile, section, "volnorm_target", &config->volnorm_target); 314 bmp_cfg_db_get_int(db, section, "volnorm_target", &config->volnorm_target);
314 xmms_cfg_read_boolean(cfgfile, section, "output_keep_opened", &config->output_keep_opened); 315 bmp_cfg_db_get_bool(db, section, "output_keep_opened", &config->output_keep_opened);
315 xmms_cfg_read_boolean(cfgfile, section, "mixer_software", &config->mixer_software); 316 bmp_cfg_db_get_bool(db, section, "mixer_software", &config->mixer_software);
316 xmms_cfg_read_int (cfgfile, section, "mixer_vol_left", &config->mixer_vol_left); 317 bmp_cfg_db_get_int(db, section, "mixer_vol_left", &config->mixer_vol_left);
317 xmms_cfg_read_int (cfgfile, section, "mixer_vol_right", &config->mixer_vol_right); 318 bmp_cfg_db_get_int(db, section, "mixer_vol_right", &config->mixer_vol_right);
318 319
319 /* config items introduced by v0.3.2 */ 320 /* config items introduced by v0.3.2 */
320 xmms_cfg_read_boolean(cfgfile, section, "no_xfade_if_same_file",&config->no_xfade_if_same_file); 321 bmp_cfg_db_get_bool(db, section, "no_xfade_if_same_file", &config->no_xfade_if_same_file);
321 322
322 /* config items introduced by v0.3.3 */ 323 /* config items introduced by v0.3.3 */
323 xmms_cfg_read_boolean(cfgfile, section, "gap_crossing", &config->gap_crossing); 324 bmp_cfg_db_get_bool(db, section, "gap_crossing", &config->gap_crossing);
324 325
325 /* config items introduced by v0.3.6 */ 326 /* config items introduced by v0.3.6 */
326 xmms_cfg_read_int (cfgfile, section, "output_quality", &config->output_quality); 327 bmp_cfg_db_get_int(db, section, "output_quality", &config->output_quality);
327 328
328 /* fade configs */ 329 /* fade configs */
329 read_fade_config(cfgfile, section, "fc_xfade", &config->fc[FADE_CONFIG_XFADE]); 330 read_fade_config(db, section, "fc_xfade", &config->fc[FADE_CONFIG_XFADE]);
330 read_fade_config(cfgfile, section, "fc_manual", &config->fc[FADE_CONFIG_MANUAL]); 331 read_fade_config(db, section, "fc_manual", &config->fc[FADE_CONFIG_MANUAL]);
331 read_fade_config(cfgfile, section, "fc_album", &config->fc[FADE_CONFIG_ALBUM]); 332 read_fade_config(db, section, "fc_album", &config->fc[FADE_CONFIG_ALBUM]);
332 read_fade_config(cfgfile, section, "fc_start", &config->fc[FADE_CONFIG_START]); 333 read_fade_config(db, section, "fc_start", &config->fc[FADE_CONFIG_START]);
333 read_fade_config(cfgfile, section, "fc_stop", &config->fc[FADE_CONFIG_STOP]); 334 read_fade_config(db, section, "fc_stop", &config->fc[FADE_CONFIG_STOP]);
334 read_fade_config(cfgfile, section, "fc_eop", &config->fc[FADE_CONFIG_EOP]); 335 read_fade_config(db, section, "fc_eop", &config->fc[FADE_CONFIG_EOP]);
335 read_fade_config(cfgfile, section, "fc_seek", &config->fc[FADE_CONFIG_SEEK]); 336 read_fade_config(db, section, "fc_seek", &config->fc[FADE_CONFIG_SEEK]);
336 read_fade_config(cfgfile, section, "fc_pause", &config->fc[FADE_CONFIG_PAUSE]); 337 read_fade_config(db, section, "fc_pause", &config->fc[FADE_CONFIG_PAUSE]);
337 338
338 xmms_cfg_free(cfgfile); 339 bmp_cfg_db_close(db);
339 DEBUG(("[crossfade] load_config: configuration loaded\n"));
340 }
341 else
342 DEBUG(("[crossfade] load_config: error loading config, using defaults\n"));
343 340
344 #ifdef PRESET_SUPPORT 341 #ifdef PRESET_SUPPORT
345 filename = g_strconcat(g_get_home_dir(), "/.audacious/xmms-crossfade-presets", NULL); 342 filename = g_strconcat(g_get_home_dir(), "/.audacious/xmms-crossfade-presets", NULL);
346 scan_presets(filename); 343 scan_presets(filename);
347 g_free(filename); 344 g_free(filename);
350 347
351 void 348 void
352 xfade_save_config() 349 xfade_save_config()
353 { 350 {
354 gchar *section = "Crossfade"; 351 gchar *section = "Crossfade";
355 ConfigFile *cfgfile; 352 ConfigDb *db;
356 353
357 if((cfgfile = xmms_cfg_open_default_file())) { 354 db = bmp_cfg_db_open();
358 /* obsolete config items */ 355
359 xmms_cfg_remove_key(cfgfile, section, "underrun_pct"); 356 /* obsolete config items */
360 xmms_cfg_remove_key(cfgfile, section, "enable_crossfade"); 357 bmp_cfg_db_unset_key(db, section, "underrun_pct");
361 xmms_cfg_remove_key(cfgfile, section, "enable_gapkiller"); 358 bmp_cfg_db_unset_key(db, section, "enable_crossfade");
362 xmms_cfg_remove_key(cfgfile, section, "mixer_use_master"); 359 bmp_cfg_db_unset_key(db, section, "enable_gapkiller");
363 xmms_cfg_remove_key(cfgfile, section, "late_effect"); 360 bmp_cfg_db_unset_key(db, section, "mixer_use_master");
364 xmms_cfg_remove_key(cfgfile, section, "gap_lead_length"); 361 bmp_cfg_db_unset_key(db, section, "late_effect");
362 bmp_cfg_db_unset_key(db, section, "gap_lead_length");
365 363
366 /* config items used in v0.1 */ 364 /* config items used in v0.1 */
367 xmms_cfg_write_string (cfgfile, section, "output_plugin", config->op_name ? config->op_name : DEFAULT_OP_NAME); 365 bmp_cfg_db_set_string(db, section, "output_plugin", config->op_name ? config->op_name : DEFAULT_OP_NAME);
368 xmms_cfg_write_string (cfgfile, section, "op_config_string", config->op_config_string ? config->op_config_string : DEFAULT_OP_CONFIG_STRING); 366 bmp_cfg_db_set_string(db, section, "op_config_string", config->op_config_string ? config->op_config_string : DEFAULT_OP_CONFIG_STRING);
369 xmms_cfg_write_int (cfgfile, section, "buffer_size", config->mix_size_ms); 367 bmp_cfg_db_set_int(db, section, "buffer_size", config->mix_size_ms);
370 xmms_cfg_write_int (cfgfile, section, "sync_size", config->sync_size_ms); 368 bmp_cfg_db_set_int(db, section, "sync_size", config->sync_size_ms);
371 xmms_cfg_write_int (cfgfile, section, "preload_size", config->preload_size_ms); 369 bmp_cfg_db_set_int(db, section, "preload_size", config->preload_size_ms);
372 xmms_cfg_write_int (cfgfile, section, "songchange_timeout", config->songchange_timeout); 370 bmp_cfg_db_set_int(db, section, "songchange_timeout", config->songchange_timeout);
373 xmms_cfg_write_boolean(cfgfile, section, "enable_mixer", config->enable_mixer); 371 bmp_cfg_db_set_bool(db, section, "enable_mixer", config->enable_mixer);
374 xmms_cfg_write_boolean(cfgfile, section, "mixer_reverse", config->mixer_reverse); 372 bmp_cfg_db_set_bool(db, section, "mixer_reverse", config->mixer_reverse);
375 xmms_cfg_write_boolean(cfgfile, section, "enable_debug", config->enable_debug); 373 bmp_cfg_db_set_bool(db, section, "enable_debug", config->enable_debug);
376 xmms_cfg_write_boolean(cfgfile, section, "enable_monitor", config->enable_monitor); 374 bmp_cfg_db_set_bool(db, section, "enable_monitor", config->enable_monitor);
377 375
378 /* config items introduced by v0.2 */ 376 /* config items introduced by v0.2 */
379 xmms_cfg_write_boolean(cfgfile, section, "gap_lead_enable", config->gap_lead_enable); 377 bmp_cfg_db_set_bool(db, section, "gap_lead_enable", config->gap_lead_enable);
380 xmms_cfg_write_int (cfgfile, section, "gap_lead_len_ms", config->gap_lead_len_ms); 378 bmp_cfg_db_set_int(db, section, "gap_lead_len_ms", config->gap_lead_len_ms);
381 xmms_cfg_write_int (cfgfile, section, "gap_lead_level", config->gap_lead_level); 379 bmp_cfg_db_set_int(db, section, "gap_lead_level", config->gap_lead_level);
382 xmms_cfg_write_boolean(cfgfile, section, "gap_trail_enable", config->gap_trail_enable); 380 bmp_cfg_db_set_bool(db, section, "gap_trail_enable", config->gap_trail_enable);
383 xmms_cfg_write_int (cfgfile, section, "gap_trail_len_ms", config->gap_trail_len_ms); 381 bmp_cfg_db_set_int(db, section, "gap_trail_len_ms", config->gap_trail_len_ms);
384 xmms_cfg_write_int (cfgfile, section, "gap_trail_level", config->gap_trail_level); 382 bmp_cfg_db_set_int(db, section, "gap_trail_level", config->gap_trail_level);
385 xmms_cfg_write_int (cfgfile, section, "gap_trail_locked", config->gap_trail_locked); 383 bmp_cfg_db_set_int(db, section, "gap_trail_locked", config->gap_trail_locked);
386 384
387 /* config items introduced by v0.2.1 */ 385 /* config items introduced by v0.2.1 */
388 xmms_cfg_write_boolean(cfgfile, section, "buffer_size_auto", config->mix_size_auto); 386 bmp_cfg_db_set_bool(db, section, "buffer_size_auto", config->mix_size_auto);
389 387
390 /* config items introduced by v0.2.3 */ 388 /* config items introduced by v0.2.3 */
391 xmms_cfg_write_boolean(cfgfile, section, "album_detection", config->album_detection); 389 bmp_cfg_db_set_bool(db, section, "album_detection", config->album_detection);
392 390
393 /* config items introduced by v0.2.4 */ 391 /* config items introduced by v0.2.4 */
394 xmms_cfg_write_boolean(cfgfile, section, "http_workaround", config->enable_http_workaround); 392 bmp_cfg_db_set_bool(db, section, "http_workaround", config->enable_http_workaround);
395 xmms_cfg_write_boolean(cfgfile, section, "enable_op_max_used", config->enable_op_max_used); 393 bmp_cfg_db_set_bool(db, section, "enable_op_max_used", config->enable_op_max_used);
396 xmms_cfg_write_int (cfgfile, section, "op_max_used_ms", config->op_max_used_ms); 394 bmp_cfg_db_set_int(db, section, "op_max_used_ms", config->op_max_used_ms);
397 395
398 /* config items introduced by v0.2.6 */ 396 /* config items introduced by v0.2.6 */
399 xmms_cfg_write_string (cfgfile, section, "effect_plugin", config->ep_name ? config->ep_name : DEFAULT_EP_NAME); 397 bmp_cfg_db_set_string(db, section, "effect_plugin", config->ep_name ? config->ep_name : DEFAULT_EP_NAME);
400 xmms_cfg_write_boolean(cfgfile, section, "effect_enable", config->ep_enable); 398 bmp_cfg_db_set_bool(db, section, "effect_enable", config->ep_enable);
401 xmms_cfg_write_int (cfgfile, section, "output_rate", config->output_rate); 399 bmp_cfg_db_set_int(db, section, "output_rate", config->output_rate);
402 400
403 /* config items introduced by v0.3.0 */ 401 /* config items introduced by v0.3.0 */
404 #ifdef VOLUME_NORMALIZER 402 #ifdef VOLUME_NORMALIZER
405 xmms_cfg_write_boolean(cfgfile, section, "volnorm_enable", config->volnorm_enable); 403 bmp_cfg_db_set_bool(db, section, "volnorm_enable", config->volnorm_enable);
406 xmms_cfg_write_boolean(cfgfile, section, "volnorm_use_qa", config->volnorm_use_qa); 404 bmp_cfg_db_set_bool(db, section, "volnorm_use_qa", config->volnorm_use_qa);
407 xmms_cfg_write_int (cfgfile, section, "volnorm_target", config->volnorm_target); 405 bmp_cfg_db_set_int(db, section, "volnorm_target", config->volnorm_target);
408 #endif 406 #endif
409 xmms_cfg_write_boolean(cfgfile, section, "output_keep_opened", config->output_keep_opened); 407 bmp_cfg_db_set_bool(db, section, "output_keep_opened", config->output_keep_opened);
410 xmms_cfg_write_boolean(cfgfile, section, "mixer_software", config->mixer_software); 408 bmp_cfg_db_set_bool(db, section, "mixer_software", config->mixer_software);
411 xmms_cfg_write_int (cfgfile, section, "mixer_vol_left", config->mixer_vol_left); 409 bmp_cfg_db_set_int(db, section, "mixer_vol_left", config->mixer_vol_left);
412 xmms_cfg_write_int (cfgfile, section, "mixer_vol_right", config->mixer_vol_right); 410 bmp_cfg_db_set_int(db, section, "mixer_vol_right", config->mixer_vol_right);
413 411
414 /* config items introduced by v0.3.2 */ 412 /* config items introduced by v0.3.2 */
415 xmms_cfg_write_boolean(cfgfile, section, "no_xfade_if_same_file",config->no_xfade_if_same_file); 413 bmp_cfg_db_set_bool(db, section, "no_xfade_if_same_file",config->no_xfade_if_same_file);
416 414
417 /* config items introduced by v0.3.2 */ 415 /* config items introduced by v0.3.2 */
418 xmms_cfg_write_boolean(cfgfile, section, "gap_crossing", config->gap_crossing); 416 bmp_cfg_db_set_bool(db, section, "gap_crossing", config->gap_crossing);
419 417
420 /* config items introduced by v0.3.6 */ 418 /* config items introduced by v0.3.6 */
421 xmms_cfg_write_int (cfgfile, section, "output_quality", config->output_quality); 419 bmp_cfg_db_set_int(db, section, "output_quality", config->output_quality);
422 420
423 /* fade configs */ 421 /* fade configs */
424 write_fade_config(cfgfile, section, "fc_xfade", &config->fc[FADE_CONFIG_XFADE]); 422 write_fade_config(db, section, "fc_xfade", &config->fc[FADE_CONFIG_XFADE]);
425 write_fade_config(cfgfile, section, "fc_manual", &config->fc[FADE_CONFIG_MANUAL]); 423 write_fade_config(db, section, "fc_manual", &config->fc[FADE_CONFIG_MANUAL]);
426 write_fade_config(cfgfile, section, "fc_album", &config->fc[FADE_CONFIG_ALBUM]); 424 write_fade_config(db, section, "fc_album", &config->fc[FADE_CONFIG_ALBUM]);
427 write_fade_config(cfgfile, section, "fc_start", &config->fc[FADE_CONFIG_START]); 425 write_fade_config(db, section, "fc_start", &config->fc[FADE_CONFIG_START]);
428 write_fade_config(cfgfile, section, "fc_stop", &config->fc[FADE_CONFIG_STOP]); 426 write_fade_config(db, section, "fc_stop", &config->fc[FADE_CONFIG_STOP]);
429 write_fade_config(cfgfile, section, "fc_eop", &config->fc[FADE_CONFIG_EOP]); 427 write_fade_config(db, section, "fc_eop", &config->fc[FADE_CONFIG_EOP]);
430 write_fade_config(cfgfile, section, "fc_seek", &config->fc[FADE_CONFIG_SEEK]); 428 write_fade_config(db, section, "fc_seek", &config->fc[FADE_CONFIG_SEEK]);
431 write_fade_config(cfgfile, section, "fc_pause", &config->fc[FADE_CONFIG_PAUSE]); 429 write_fade_config(db, section, "fc_pause", &config->fc[FADE_CONFIG_PAUSE]);
432 430
433 xmms_cfg_write_default_file(cfgfile); 431 bmp_cfg_db_close(db);
434 xmms_cfg_free (cfgfile);
435 DEBUG(("[crossfade] save_config: configuration saved\n"));
436 }
437 else
438 DEBUG(("[crossfade] save_config: error saving configuration!\n"));
439 } 432 }
440 433
441 #define SAFE_FREE(x) if(x) { g_free(x); x = NULL; } 434 #define SAFE_FREE(x) if(x) { g_free(x); x = NULL; }
442 void 435 void
443 xfade_free_config() 436 xfade_free_config()