summaryrefslogtreecommitdiff
path: root/src/replayGain.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-28 05:14:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-28 05:14:55 +0000
commit58dbe4bb5d974c34335d6906a9ce930f07cd1db4 (patch)
tree9a6aee08b21100cb74e809f0620d81466f6067df /src/replayGain.c
parent8f40569aeeafe4a36e3d719c1df97de42606ea76 (diff)
merge shank-rewrite-config changes
git-svn-id: https://svn.musicpd.org/mpd/trunk@2375 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);
}