Audio: Fix some type warning

Former-commit-id: 37c2bdbdfc591ff3cc031ee1498ae1050183b4bd [formerly e96bf359c986942fc707834c9c5992eca9c57b22] [formerly a1c53ad3ae4218aea8163f5f33245e352b820a34 [formerly a3c51b11bd591e8accad191bfa5547323436e4cb]]
Former-commit-id: 5d7faba8324c26970f0ca0681d695e6650cff32f [formerly c564a0adc734737472ea066e5d362637f9697138]
Former-commit-id: 7979614ff5460597b01e042e7e520ad7d55c7493
This commit is contained in:
Lynix
2016-09-04 19:56:11 +02:00
parent 8a9ec2883a
commit ffe938d422
9 changed files with 47 additions and 147 deletions

View File

@@ -27,7 +27,6 @@ namespace Nz
*
* \param soundBuffer Buffer to read sound from
*/
Sound::Sound(const SoundBuffer* soundBuffer)
{
SetBuffer(soundBuffer);
@@ -38,7 +37,6 @@ namespace Nz
*
* \param sound Sound to copy
*/
Sound::Sound(const Sound& sound) :
SoundEmitter(sound)
{
@@ -50,7 +48,6 @@ namespace Nz
*
* \see Stop
*/
Sound::~Sound()
{
Stop();
@@ -61,7 +58,6 @@ namespace Nz
*
* \param loop Should sound loop
*/
void Sound::EnableLooping(bool loop)
{
alSourcei(m_source, AL_LOOPING, loop);
@@ -71,7 +67,6 @@ namespace Nz
* \brief Gets the internal buffer
* \return Internal buffer
*/
const SoundBuffer* Sound::GetBuffer() const
{
return m_buffer;
@@ -83,7 +78,6 @@ namespace Nz
*
* \remark Produces a NazaraError if there is no buffer
*/
UInt32 Sound::GetDuration() const
{
NazaraAssert(m_buffer, "Invalid sound buffer");
@@ -95,7 +89,6 @@ namespace Nz
* \brief Gets the current offset in the sound
* \return Offset in milliseconds (works with entire seconds)
*/
UInt32 Sound::GetPlayingOffset() const
{
ALint samples = 0;
@@ -108,7 +101,6 @@ namespace Nz
* \brief Gets the status of the music
* \return Enumeration of type SoundStatus (Playing, Stopped, ...)
*/
SoundStatus Sound::GetStatus() const
{
return GetInternalStatus();
@@ -118,7 +110,6 @@ namespace Nz
* \brief Checks whether the sound is looping
* \return true if it is the case
*/
bool Sound::IsLooping() const
{
ALint loop;
@@ -141,7 +132,6 @@ namespace Nz
* \brief Checks whether the sound is playing
* \return true if it is the case
*/
bool Sound::IsPlaying() const
{
return GetStatus() == SoundStatus_Playing;
@@ -156,7 +146,6 @@ namespace Nz
*
* \remark Produces a NazaraError if loading failed
*/
bool Sound::LoadFromFile(const String& filePath, const SoundBufferParams& params)
{
SoundBufferRef buffer = SoundBuffer::New();
@@ -180,7 +169,6 @@ namespace Nz
*
* \remark Produces a NazaraError if loading failed
*/
bool Sound::LoadFromMemory(const void* data, std::size_t size, const SoundBufferParams& params)
{
SoundBufferRef buffer = SoundBuffer::New();
@@ -203,7 +191,6 @@ namespace Nz
*
* \remark Produces a NazaraError if loading failed
*/
bool Sound::LoadFromStream(Stream& stream, const SoundBufferParams& params)
{
SoundBufferRef buffer = SoundBuffer::New();
@@ -220,7 +207,6 @@ namespace Nz
/*!
* \brief Pauses the sound
*/
void Sound::Pause()
{
alSourcePause(m_source);
@@ -231,16 +217,9 @@ namespace Nz
*
* \remark Produces a NazaraError if the sound is not playable with NAZARA_AUDIO_SAFE defined
*/
void Sound::Play()
{
#if NAZARA_AUDIO_SAFE
if (!IsPlayable())
{
NazaraError("Invalid sound buffer");
return;
}
#endif
NazaraAssert(IsPlayable(), "Music is not playable");
alSourcePlay(m_source);
}
@@ -252,16 +231,9 @@ namespace Nz
*
* \remark Produces a NazaraError if buffer is invalid with NAZARA_AUDIO_SAFE defined
*/
void Sound::SetBuffer(const SoundBuffer* buffer)
{
#if NAZARA_AUDIO_SAFE
if (buffer && !buffer->IsValid())
{
NazaraError("Invalid sound buffer");
return;
}
#endif
NazaraAssert(!buffer || buffer->IsValid(), "Invalid sound buffer");
if (m_buffer == buffer)
return;
@@ -281,7 +253,6 @@ namespace Nz
*
* \param offset Offset in the sound in milliseconds
*/
void Sound::SetPlayingOffset(UInt32 offset)
{
alSourcei(m_source, AL_SAMPLE_OFFSET, static_cast<ALint>(offset/1000.f * m_buffer->GetSampleRate()));
@@ -290,7 +261,6 @@ namespace Nz
/*!
* \brief Stops the sound
*/
void Sound::Stop()
{
alSourceStop(m_source);