aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-02-04 15:56:01 +0100
committerMax Kellermann <max@duempel.org>2015-02-04 15:56:01 +0100
commite582e893ccd646b3edb3648129fb369b6f2a2370 (patch)
treef1e1793f2c4331699de26fc223b90dafe020dc57
parent833ec3d3cdb206dc41420e067874e355569bd225 (diff)
downloadmpd-e582e893ccd646b3edb3648129fb369b6f2a2370.tar.gz
mpd-e582e893ccd646b3edb3648129fb369b6f2a2370.tar.xz
mpd-e582e893ccd646b3edb3648129fb369b6f2a2370.zip
tag/Rva2: make enum rva2_channel strictly-typed
-rw-r--r--src/tag/TagRva2.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tag/TagRva2.cxx b/src/tag/TagRva2.cxx
index 241deeb23..09ccb52e1 100644
--- a/src/tag/TagRva2.cxx
+++ b/src/tag/TagRva2.cxx
@@ -26,20 +26,20 @@
#include <stdint.h>
#include <string.h>
-enum rva2_channel {
- CHANNEL_OTHER = 0x00,
- CHANNEL_MASTER_VOLUME = 0x01,
- CHANNEL_FRONT_RIGHT = 0x02,
- CHANNEL_FRONT_LEFT = 0x03,
- CHANNEL_BACK_RIGHT = 0x04,
- CHANNEL_BACK_LEFT = 0x05,
- CHANNEL_FRONT_CENTRE = 0x06,
- CHANNEL_BACK_CENTRE = 0x07,
- CHANNEL_SUBWOOFER = 0x08
+enum class Rva2Channel : uint8_t {
+ OTHER = 0x00,
+ MASTER_VOLUME = 0x01,
+ FRONT_RIGHT = 0x02,
+ FRONT_LEFT = 0x03,
+ BACK_RIGHT = 0x04,
+ BACK_LEFT = 0x05,
+ FRONT_CENTRE = 0x06,
+ BACK_CENTRE = 0x07,
+ SUBWOOFER = 0x08
};
struct rva2_data {
- uint8_t type;
+ Rva2Channel type;
uint8_t volume_adjustment[2];
uint8_t peak_bits;
};
@@ -76,7 +76,7 @@ static inline bool
rva2_apply_data(ReplayGainInfo &rgi,
const struct rva2_data *data, const id3_latin1_t *id)
{
- if (data->type != CHANNEL_MASTER_VOLUME)
+ if (data->type != Rva2Channel::MASTER_VOLUME)
return false;
float volume_adjustment = rva2_float_volume_adjustment(data);