# HG changeset patch # User chainsaw # Date 1145157149 25200 # Node ID 84693c7f096d6c9202cfd1159552d0038eac968e # Parent f923aa230a2a8b678711fd73f214469ee59b0ccf [svn] Use default settings when no valid config exists. diff -r f923aa230a2a -r 84693c7f096d Plugins/Effect/audiocompress/audacious-glue.c --- a/Plugins/Effect/audiocompress/audacious-glue.c Sat Apr 15 18:49:50 2006 -0700 +++ b/Plugins/Effect/audiocompress/audacious-glue.c Sat Apr 15 20:12:29 2006 -0700 @@ -123,12 +123,6 @@ { ConfigDb *db; - prefs->anticlip = ANTICLIP; - prefs->target = TARGET; - prefs->gainmax = GAINMAX; - prefs->gainsmooth = GAINSMOOTH; - prefs->buckets = BUCKETS; - db = bmp_cfg_db_open(); bmp_cfg_db_get_bool(db, "AudioCompress", @@ -142,9 +136,17 @@ bmp_cfg_db_get_int(db, "AudioCompress", "buckets", &prefs->buckets); - prefs->dialog = create_prefs_dialog(prefs); + bmp_cfg_db_close(db); - bmp_cfg_db_close(db); + if ((prefs->gainmax == 0) && (prefs->gainsmooth == 0) && (prefs->buckets == 0)) { + prefs->anticlip = ANTICLIP; + prefs->target = TARGET; + prefs->gainmax = GAINMAX; + prefs->gainsmooth = GAINSMOOTH; + prefs->buckets = BUCKETS; + } + + prefs->dialog = create_prefs_dialog(prefs); } void freePrefs(CompressorPrefs * prefs) @@ -160,7 +162,7 @@ db = bmp_cfg_db_open(); bmp_cfg_db_set_bool(db, "AudioCompress", "anticlip", - prefs->anticlip); + prefs->anticlip); bmp_cfg_db_set_int(db, "AudioCompress", "target", prefs->target); bmp_cfg_db_set_int(db, "AudioCompress", "gainmax",