Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2011-08-07 15:54:58 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-08-07 15:54:58 +0400
commit2d884fc035d403d43c7a18e3e61cd56ccdfbec2b (patch)
tree2548dcfbb52370618d1f255f57e65bcf1cbb49a4 /intern/audaspace/OpenAL
parent4370099fb0bc1bdd21f78b14a91a1d8eb76e1bc1 (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')
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.cpp24
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.h9
2 files changed, 29 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
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.h b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
index 3ba761bad5a..3e8b05d79e2 100644
--- a/intern/audaspace/OpenAL/AUD_OpenALDevice.h
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
@@ -89,6 +89,9 @@ private:
/// Stop callback data.
void* m_stop_data;
+ /// Orientation.
+ AUD_Quaternion m_orientation;
+
/// Current status of the handle
AUD_Status m_status;
@@ -205,6 +208,11 @@ private:
AUD_Buffer m_buffer;
/**
+ * Orientation.
+ */
+ AUD_Quaternion m_orientation;
+
+ /**
* Starts the streaming thread.
*/
void start(bool join = true);
@@ -243,6 +251,7 @@ public:
virtual AUD_DeviceSpecs getSpecs() const;
virtual AUD_Reference<AUD_IHandle> play(AUD_Reference<AUD_IReader> reader, bool keep = false);
virtual AUD_Reference<AUD_IHandle> play(AUD_Reference<AUD_IFactory> factory, bool keep = false);
+ virtual void stopAll();
virtual void lock();
virtual void unlock();
virtual float getVolume() const;