From bddb6b42738c8637000896d867e89691d3a57c3e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 17 Oct 2009 22:58:19 +0200 Subject: command: allow changing replay gain mode on-the-fly The new command "replay_gain_mode" allows the user to switch the replay gain mode on-the-fly. No more mpd.conf editing. --- src/replay_gain.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/replay_gain.c') diff --git a/src/replay_gain.c b/src/replay_gain.c index 5bfa765fe..a59cfa245 100644 --- a/src/replay_gain.c +++ b/src/replay_gain.c @@ -42,7 +42,26 @@ enum replay_gain_mode replay_gain_mode = REPLAY_GAIN_OFF; static float replay_gain_preamp = 1.0; static float replay_gain_missing_preamp = 1.0; -static bool +const char * +replay_gain_get_mode_string(void) +{ + switch (replay_gain_mode) { + case REPLAY_GAIN_OFF: + return "off"; + + case REPLAY_GAIN_TRACK: + return "track"; + + case REPLAY_GAIN_ALBUM: + return "album"; + } + + /* unreachable */ + assert(false); + return "off"; +} + +bool replay_gain_set_mode_string(const char *p) { assert(p != NULL); -- cgit v1.2.3