ReplayGainMode: add ToString(), FromString()

Move code from ReplayGainConfig.cxx.
This commit is contained in:
Max Kellermann
2016-11-24 17:25:32 +01:00
parent 5f396e824f
commit 0720702c91
6 changed files with 91 additions and 69 deletions

View File

@@ -20,6 +20,8 @@
#ifndef MPD_REPLAY_GAIN_MODE_HXX
#define MPD_REPLAY_GAIN_MODE_HXX
#include "Compiler.h"
#include <stdint.h>
enum class ReplayGainMode : uint8_t {
@@ -29,4 +31,19 @@ enum class ReplayGainMode : uint8_t {
AUTO,
};
/**
* Return the string representation of a #ReplayGainMode.
*/
gcc_pure
const char *
ToString(ReplayGainMode mode);
/**
* Parse a string to a #ReplayGainMode. Throws std::runtime_error on
* error.
*/
gcc_pure
ReplayGainMode
FromString(const char *s);
#endif