diff --git a/apps/openmw/mwsound/mpgsnd_decoder.cpp b/apps/openmw/mwsound/mpgsnd_decoder.cpp index 6be6566f0f..e112d30b1d 100644 --- a/apps/openmw/mwsound/mpgsnd_decoder.cpp +++ b/apps/openmw/mwsound/mpgsnd_decoder.cpp @@ -21,9 +21,9 @@ void MpgSnd_Decoder::open(const std::string &fname) if(mSndFile) { if(info.channels == 1) - mChanConfig = MonoChannels; + mChanConfig = ChannelConfig_Mono; else if(info.channels == 2) - mChanConfig = StereoChannels; + mChanConfig = ChannelConfig_Stereo; else { sf_close(mSndFile); @@ -47,7 +47,7 @@ void MpgSnd_Decoder::open(const std::string &fname) fail("Unsupported encoding in "+fname); if(channels != 1 && channels != 2) fail("Unsupported channel count in "+fname); - mChanConfig = ((channels==2)?StereoChannels:MonoChannels); + mChanConfig = ((channels==2)?ChannelConfig_Stereo:ChannelConfig_Mono); mSampleRate = rate; return; } @@ -88,7 +88,7 @@ void MpgSnd_Decoder::getInfo(int *samplerate, ChannelConfig *chans, SampleType * *samplerate = mSampleRate; *chans = mChanConfig; - *type = Int16Sample; + *type = SampleType_Int16; } size_t MpgSnd_Decoder::read(char *buffer, size_t bytes) diff --git a/apps/openmw/mwsound/openal_output.cpp b/apps/openmw/mwsound/openal_output.cpp index af8569ad78..cda6c89dd3 100644 --- a/apps/openmw/mwsound/openal_output.cpp +++ b/apps/openmw/mwsound/openal_output.cpp @@ -22,22 +22,22 @@ static void throwALerror() } -static ALenum getALFormat(Sound_Decoder::ChannelConfig chans, Sound_Decoder::SampleType type) +static ALenum getALFormat(ChannelConfig chans, SampleType type) { - if(chans == Sound_Decoder::MonoChannels) + if(chans == ChannelConfig_Mono) { - if(type == Sound_Decoder::Int16Sample) + if(type == SampleType_Int16) return AL_FORMAT_MONO16; - else if(type == Sound_Decoder::UInt8Sample) + else if(type == SampleType_UInt8) return AL_FORMAT_MONO8; else fail("Unsupported sample type"); } - else if(chans == Sound_Decoder::StereoChannels) + else if(chans == ChannelConfig_Stereo) { - if(type == Sound_Decoder::Int16Sample) + if(type == SampleType_Int16) return AL_FORMAT_STEREO16; - else if(type == Sound_Decoder::UInt8Sample) + else if(type == SampleType_UInt8) return AL_FORMAT_STEREO8; else fail("Unsupported sample type"); @@ -51,8 +51,8 @@ static ALenum getALFormat(Sound_Decoder::ChannelConfig chans, Sound_Decoder::Sam ALuint LoadBuffer(DecoderPtr decoder) { int srate; - Sound_Decoder::ChannelConfig chans; - Sound_Decoder::SampleType type; + ChannelConfig chans; + SampleType type; ALenum format; decoder->getInfo(&srate, &chans, &type); @@ -136,8 +136,8 @@ OpenAL_SoundStream::OpenAL_SoundStream(DecoderPtr decoder) try { int srate; - Sound_Decoder::ChannelConfig chans; - Sound_Decoder::SampleType type; + ChannelConfig chans; + SampleType type; mDecoder->getInfo(&srate, &chans, &type); mFormat = getALFormat(chans, type); diff --git a/apps/openmw/mwsound/sound_decoder.hpp b/apps/openmw/mwsound/sound_decoder.hpp index 551cd24112..e25321a906 100644 --- a/apps/openmw/mwsound/sound_decoder.hpp +++ b/apps/openmw/mwsound/sound_decoder.hpp @@ -1,19 +1,22 @@ #ifndef GAME_SOUND_SOUND_DECODER_H #define GAME_SOUND_SOUND_DECODER_H +#include + namespace MWSound { + enum SampleType { + SampleType_UInt8, + SampleType_Int16 + }; + enum ChannelConfig { + ChannelConfig_Mono, + ChannelConfig_Stereo + }; + class Sound_Decoder { public: - enum SampleType { - UInt8Sample, - Int16Sample - }; - enum ChannelConfig { - MonoChannels, - StereoChannels - }; virtual void open(const std::string &fname) = 0; virtual void close() = 0;