Increase number of channels in the Channel enum just in case
authorCarl Hetherington <cth@carlh.net>
Wed, 6 May 2015 14:19:16 +0000 (15:19 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 6 May 2015 14:19:16 +0000 (15:19 +0100)
casting to it from int is undefined if the int is out of range.

src/sound_asset.cc
src/types.h

index baf8523aaab23ca0bf0817e870321fd0dea665db..179f6cd5a762d505442da0611647edec5f374c84 100644 (file)
@@ -115,9 +115,12 @@ SoundAsset::create (boost::function<boost::filesystem::path (Channel)> get_path)
                LFE,
                LS,
                RS,
-               /* XXX: not quite sure what these should be yet */
-               CHANNEL_7,
-               CHANNEL_8
+               HI,
+               VI,
+               LC,
+               RC,
+               BSL,
+               BSR
        };
 
        assert (int(_channels) <= int(sizeof(channels) / sizeof(Channel)));
index e02c36ebfec5d9682a7573a4a50d0fd0a9550f6a..a309121a6457472534674e53b2fb0ee42b1c62b8 100644 (file)
@@ -42,8 +42,12 @@ enum Channel {
        LFE = 3,       ///< low-frequency effects (sub)
        LS = 4,        ///< left surround
        RS = 5,        ///< right surround
-       CHANNEL_7 = 6, ///< channel 7; not sure what this should be called
-       CHANNEL_8 = 7  ///< channel 8; not sure what this should be called
+       HI = 6,
+       VI = 7,
+       LC = 8,
+       RC = 9,
+       BSL = 10,
+       BSR = 111
 };
 
 enum ContentKind