diff options
Diffstat (limited to '')
-rw-r--r-- | src/ReplayGainConfig.cxx (renamed from src/replay_gain_config.c) | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/replay_gain_config.c b/src/ReplayGainConfig.cxx index 2181387b7..d86c70053 100644 --- a/src/replay_gain_config.c +++ b/src/ReplayGainConfig.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -19,9 +19,9 @@ #include "config.h" #include "replay_gain_config.h" -#include "playlist.h" +#include "Idle.hxx" #include "conf.h" -#include "idle.h" +#include "Playlist.hxx" #include "mpd_error.h" #include <glib.h> @@ -29,20 +29,14 @@ #include <assert.h> #include <stdlib.h> #include <string.h> -#include <math.h> - -static const char *const replay_gain_mode_names[] = { - [REPLAY_GAIN_ALBUM] = "album", - [REPLAY_GAIN_TRACK] = "track", -}; enum replay_gain_mode replay_gain_mode = REPLAY_GAIN_OFF; -const bool DEFAULT_REPLAYGAIN_LIMIT = true; +static constexpr bool DEFAULT_REPLAYGAIN_LIMIT = true; float replay_gain_preamp = 1.0; float replay_gain_missing_preamp = 1.0; -bool replay_gain_limit; +bool replay_gain_limit = DEFAULT_REPLAYGAIN_LIMIT; const char * replay_gain_get_mode_string(void) @@ -137,14 +131,15 @@ void replay_gain_global_init(void) replay_gain_limit = config_get_bool(CONF_REPLAYGAIN_LIMIT, DEFAULT_REPLAYGAIN_LIMIT); } -enum replay_gain_mode replay_gain_get_real_mode(void) +enum replay_gain_mode +replay_gain_get_real_mode(bool random_mode) { enum replay_gain_mode rgm; rgm = replay_gain_mode; if (rgm == REPLAY_GAIN_AUTO) - rgm = g_playlist.queue.random ? REPLAY_GAIN_TRACK : REPLAY_GAIN_ALBUM; + rgm = random_mode ? REPLAY_GAIN_TRACK : REPLAY_GAIN_ALBUM; return rgm; } |