diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-08-07 15:54:58 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-08-07 15:54:58 +0400 |
commit | 2d884fc035d403d43c7a18e3e61cd56ccdfbec2b (patch) | |
tree | 2548dcfbb52370618d1f255f57e65bcf1cbb49a4 /intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | |
parent | 4370099fb0bc1bdd21f78b14a91a1d8eb76e1bc1 (diff) |
3D Audio GSoC:
* Pepper depends on ffmpeg 0.7.1 or higher now, windows and mac build systems set to ffmpeg-0.8
* Fixed orientation retrieval in OpenAL device code.
* Added stopAll() method to AUD_IDevice (also for Python) and call it on BGE exit
* Changed BGE to use audaspace via native C++ instead over the C API.
* Made AUD_SequencerFactory and AUD_SequencerEntry thread safe.
* Changed sound caching into a flag which fixes problems on file loading, especially with undo.
* Removed unused parameter from sound_mute_scene_sound
* Fixed bug: changing FPS didn't update the sequencer sound positions.
* Fixed bug: Properties of sequencer strips weren't set correctly.
* Minor warning fixes.
Diffstat (limited to 'intern/audaspace/OpenAL/AUD_OpenALDevice.cpp')
-rw-r--r-- | intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index 40fc8a55f03..d5b365fa62f 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -469,8 +469,7 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::setSourceVelocity(const AUD_Vector3& ve AUD_Quaternion AUD_OpenALDevice::AUD_OpenALHandle::getSourceOrientation() { - // AUD_XXX not implemented yet - return AUD_Quaternion(0, 0, 0, 0); + return m_orientation; } bool AUD_OpenALDevice::AUD_OpenALHandle::setSourceOrientation(const AUD_Quaternion& orientation) @@ -491,6 +490,8 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::setSourceOrientation(const AUD_Quaterni m_device->unlock(); + m_orientation = orientation; + return true; } @@ -1284,6 +1285,21 @@ AUD_Reference<AUD_IHandle> AUD_OpenALDevice::play(AUD_Reference<AUD_IFactory> fa return play(factory->createReader(), keep); } +void AUD_OpenALDevice::stopAll() +{ + lock(); + alcSuspendContext(m_context); + + while(!m_playingSounds.empty()) + m_playingSounds.front()->stop(); + + while(!m_pausedSounds.empty()) + m_pausedSounds.front()->stop(); + + alcProcessContext(m_context); + unlock(); +} + void AUD_OpenALDevice::lock() { pthread_mutex_lock(&m_mutex); @@ -1454,8 +1470,7 @@ void AUD_OpenALDevice::setListenerVelocity(const AUD_Vector3& velocity) AUD_Quaternion AUD_OpenALDevice::getListenerOrientation() const { - // AUD_XXX not implemented yet - return AUD_Quaternion(0, 0, 0, 0); + return m_orientation; } void AUD_OpenALDevice::setListenerOrientation(const AUD_Quaternion& orientation) @@ -1474,6 +1489,7 @@ void AUD_OpenALDevice::setListenerOrientation(const AUD_Quaternion& orientation) direction[5] = 2 * (orientation.w() * orientation.x() + orientation.y() * orientation.z()); alListenerfv(AL_ORIENTATION, direction); + m_orientation = orientation; } float AUD_OpenALDevice::getSpeedOfSound() const |