fixed hanging-on-quit bug

This commit is contained in:
bill@Ixion
2009-08-26 15:43:41 -05:00
parent 8a6f16a4f6
commit ff270dcfe8
+36 -36
View File
@@ -1,21 +1,21 @@
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
/**
* Copyright (c) 2006-2009 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#include "Audio.h"
@@ -52,14 +52,14 @@ namespace openal
Audio::~Audio()
{
SDL_KillThread(thread);
//SDL_KillThread(thread);
pool->stop();
delete pool;
alcMakeContextCurrent(0);
alcDestroyContext(context);
alcMakeContextCurrent(0);
alcDestroyContext(context);
alcCloseDevice(device);
}
@@ -85,17 +85,17 @@ namespace openal
{
return new Sound(pool, data);
}
love::audio::Music * Audio::newMusic(love::sound::Decoder * decoder)
{
return new Music(pool, decoder);
}
love::audio::Source * Audio::newSource(Audible * audible)
{
return new Source(pool, audible);
}
int Audio::getNumSources() const
{
return pool->getNumSources();
@@ -105,19 +105,19 @@ namespace openal
{
return pool->getMaxSources();
}
void Audio::play(love::audio::Source * source)
{
source->play();
}
void Audio::play(love::audio::Sound * sound)
{
Source * source = new Source(pool, sound);
play(source);
source->release();
}
void Audio::play(love::audio::Music * music)
{
Source * source = new Source(pool, music->clone());
@@ -129,17 +129,17 @@ namespace openal
{
source->stop();
}
void Audio::stop()
{
pool->stop();
}
void Audio::pause(love::audio::Source * source)
{
source->pause();
}
void Audio::pause()
{
pool->pause();
@@ -154,26 +154,26 @@ namespace openal
{
pool->resume();
}
void Audio::rewind(love::audio::Source * source)
{
source->rewind();
}
void Audio::rewind()
{
pool->rewind();
}
void Audio::setVolume(float volume)
{
alListenerf(AL_GAIN, volume);
}
float Audio::getVolume() const
{
ALfloat volume;
alGetListenerf(AL_GAIN, &volume);
ALfloat volume;
alGetListenerf(AL_GAIN, &volume);
return volume;
}