Upgrade Audio (part 2)

This commit is contained in:
Jérôme Leclercq
2021-05-24 22:09:47 +02:00
parent ac57b3fbf4
commit 8cdd0b51cb
15 changed files with 158 additions and 104 deletions

View File

@@ -43,33 +43,6 @@ namespace Nz
OpenAL::Uninitialize();
}
/*!
* \brief Gets the format of the audio
* \return AudioFormat Enumeration type for the format
*
* \param channelCount Number of channels
*
* \remark Produces a NazaraError if the number of channels is erroneous (3 or 5) and AudioFormat_Unknown is returned
*/
AudioFormat Audio::GetAudioFormat(unsigned int channelCount) const
{
switch (channelCount)
{
case 1:
case 2:
case 4:
case 6:
case 7:
case 8:
return static_cast<AudioFormat>(channelCount);
default:
NazaraError("Invalid channel count: " + NumberToString(channelCount));
return AudioFormat_Unknown;
}
}
/*!
* \brief Gets the factor of the doppler effect
* \return Global factor of the doppler effect
@@ -200,10 +173,10 @@ namespace Nz
*/
bool Audio::IsFormatSupported(AudioFormat format) const
{
if (format == AudioFormat_Unknown)
if (format == AudioFormat::Unknown)
return false;
return OpenAL::AudioFormat[format] != 0;
return OpenAL::AudioFormat[UnderlyingCast(format)] != 0;
}
/*!