aboutsummaryrefslogtreecommitdiffstats
path: root/src/replayGain.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-28 04:51:46 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-28 04:51:46 +0000
commitd0532eaf703396e838aa7dba77f58e296f503af5 (patch)
treec098d313db0e02d9c957565ce6336465c1d13f50 /src/replayGain.c
parentfa6f95685b8311be52e32aebc4ac86e8470b1fa3 (diff)
downloadmpd-d0532eaf703396e838aa7dba77f58e296f503af5.tar.gz
mpd-d0532eaf703396e838aa7dba77f58e296f503af5.tar.xz
mpd-d0532eaf703396e838aa7dba77f58e296f503af5.zip
new config file format stuff, quick test shows it works
git-svn-id: https://svn.musicpd.org/mpd/branches/shank-rewrite-config@2373 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/replayGain.c')
-rw-r--r--src/replayGain.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/replayGain.c b/src/replayGain.c
index dbd09aa36..4788d7d95 100644
--- a/src/replayGain.c
+++ b/src/replayGain.c
@@ -32,34 +32,38 @@ static int replayGainState = REPLAYGAIN_OFF;
static float replayGainPreamp = 1.0;
void initReplayGainState() {
- if(!getConf()[CONF_REPLAYGAIN]) return;
+ ConfigParam * param = getConfigParam(CONF_REPLAYGAIN);
- if(strcmp(getConf()[CONF_REPLAYGAIN],"track")==0) {
+ if(!param) return;
+
+ if(strcmp(param->value, "track") == 0) {
replayGainState = REPLAYGAIN_TRACK;
}
- else if(strcmp(getConf()[CONF_REPLAYGAIN],"album")==0) {
+ else if(strcmp(param->value, "album") == 0) {
replayGainState = REPLAYGAIN_ALBUM;
}
else {
- ERROR("replaygain value \"%s\" is invalid\n",
- getConf()[CONF_REPLAYGAIN]);
+ ERROR("replaygain value \"%s\" at line %i is invalid\n",
+ param->value, param->line);
exit(EXIT_FAILURE);
}
- if(getConf()[CONF_REPLAYGAIN_PREAMP]) {
+ param = getConfigParam(CONF_REPLAYGAIN_PREAMP);
+
+ if(param) {
char * test;
- float f = strtod(getConf()[CONF_REPLAYGAIN_PREAMP], &test);
+ float f = strtod(param->value, &test);
if(*test != '\0') {
- ERROR("Replaygain preamp \"%s\" is not a number\n",
- getConf()[CONF_REPLAYGAIN_PREAMP]);
+ ERROR("Replaygain preamp \"%s\" is not a number at "
+ "line %i\n", param->value, param->line);
exit(EXIT_FAILURE);
}
if(f < -15 || f > 15) {
ERROR("Replaygain preamp \"%s\" is not between -15 and"
- "15\n",
- getConf()[CONF_REPLAYGAIN_PREAMP]);
+ "15 at line %i\n",
+ param->value, param->line);
exit(EXIT_FAILURE);
}