[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37712] branches/soc-2011-pepper: 3D Audio GSoC:
Joerg Mueller
nexyon at gmail.com
Tue Jun 21 22:24:40 CEST 2011
Revision: 37712
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37712
Author: nexyon
Date: 2011-06-21 20:24:40 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
3D Audio GSoC:
- Implemented a nice rechanneling solution with unofficial speaker arrangement standards similar to what OpenAL soft has
- Renamend AUD_Channel in the C API to AUD_Handle
- Removed the unlogical 7.2 speaker configuration, that's a hardware only config
Modified Paths:
--------------
branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp
branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h
branches/soc-2011-pepper/intern/audaspace/intern/AUD_ChannelMapperFactory.cpp
branches/soc-2011-pepper/intern/audaspace/intern/AUD_ChannelMapperFactory.h
branches/soc-2011-pepper/intern/audaspace/intern/AUD_ChannelMapperReader.cpp
branches/soc-2011-pepper/intern/audaspace/intern/AUD_ChannelMapperReader.h
branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.cpp
branches/soc-2011-pepper/intern/audaspace/intern/AUD_Space.h
branches/soc-2011-pepper/source/blender/blenkernel/intern/sound.c
branches/soc-2011-pepper/source/gameengine/Ketsji/KX_SoundActuator.h
Modified: branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp 2011-06-21 20:21:43 UTC (rev 37711)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp 2011-06-21 20:24:40 UTC (rev 37712)
@@ -90,7 +90,7 @@
typedef AUD_Reference<AUD_IFactory> AUD_Sound;
typedef AUD_Reference<AUD_ReadDevice> AUD_Device;
-typedef AUD_Reference<AUD_IHandle> AUD_Channel;
+typedef AUD_Reference<AUD_IHandle> AUD_Handle;
typedef AUD_Reference<AUD_SequencerEntry> AUD_SEntry;
#define AUD_CAPI_IMPLEMENTATION
@@ -374,7 +374,7 @@
}
}
-int AUD_setLoop(AUD_Channel* handle, int loops)
+int AUD_setLoop(AUD_Handle* handle, int loops)
{
assert(handle);
@@ -409,14 +409,14 @@
delete sound;
}
-AUD_Channel* AUD_play(AUD_Sound* sound, int keep)
+AUD_Handle* AUD_play(AUD_Sound* sound, int keep)
{
assert(sound);
try
{
- AUD_Channel channel = AUD_device->play(*sound, keep);
- if(!channel.isNull())
- return new AUD_Channel(channel);
+ AUD_Handle handle = AUD_device->play(*sound, keep);
+ if(!handle.isNull())
+ return new AUD_Handle(handle);
}
catch(AUD_Exception&)
{
@@ -424,19 +424,19 @@
return NULL;
}
-int AUD_pause(AUD_Channel* handle)
+int AUD_pause(AUD_Handle* handle)
{
assert(handle);
return (*handle)->pause();
}
-int AUD_resume(AUD_Channel* handle)
+int AUD_resume(AUD_Handle* handle)
{
assert(handle);
return (*handle)->resume();
}
-int AUD_stop(AUD_Channel* handle)
+int AUD_stop(AUD_Handle* handle)
{
assert(handle);
int result = (*handle)->stop();
@@ -444,25 +444,25 @@
return result;
}
-int AUD_setKeep(AUD_Channel* handle, int keep)
+int AUD_setKeep(AUD_Handle* handle, int keep)
{
assert(handle);
return (*handle)->setKeep(keep);
}
-int AUD_seek(AUD_Channel* handle, float seekTo)
+int AUD_seek(AUD_Handle* handle, float seekTo)
{
assert(handle);
return (*handle)->seek(seekTo);
}
-float AUD_getPosition(AUD_Channel* handle)
+float AUD_getPosition(AUD_Handle* handle)
{
assert(handle);
return (*handle)->getPosition();
}
-AUD_Status AUD_getStatus(AUD_Channel* handle)
+AUD_Status AUD_getStatus(AUD_Handle* handle)
{
assert(handle);
return (*handle)->getStatus();
@@ -537,7 +537,7 @@
return false;
}
-int AUD_setSourceLocation(AUD_Channel* handle, const float* location)
+int AUD_setSourceLocation(AUD_Handle* handle, const float* location)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -551,7 +551,7 @@
return false;
}
-int AUD_setSourceVelocity(AUD_Channel* handle, const float* velocity)
+int AUD_setSourceVelocity(AUD_Handle* handle, const float* velocity)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -565,7 +565,7 @@
return false;
}
-int AUD_setSourceOrientation(AUD_Channel* handle, const float* orientation)
+int AUD_setSourceOrientation(AUD_Handle* handle, const float* orientation)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -579,7 +579,7 @@
return false;
}
-int AUD_setRelative(AUD_Channel* handle, int relative)
+int AUD_setRelative(AUD_Handle* handle, int relative)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -592,7 +592,7 @@
return false;
}
-int AUD_setVolumeMaximum(AUD_Channel* handle, float volume)
+int AUD_setVolumeMaximum(AUD_Handle* handle, float volume)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -605,7 +605,7 @@
return false;
}
-int AUD_setVolumeMinimum(AUD_Channel* handle, float volume)
+int AUD_setVolumeMinimum(AUD_Handle* handle, float volume)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -618,7 +618,7 @@
return false;
}
-int AUD_setDistanceMaximum(AUD_Channel* handle, float distance)
+int AUD_setDistanceMaximum(AUD_Handle* handle, float distance)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -631,7 +631,7 @@
return false;
}
-int AUD_setDistanceReference(AUD_Channel* handle, float distance)
+int AUD_setDistanceReference(AUD_Handle* handle, float distance)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -644,7 +644,7 @@
return false;
}
-int AUD_setAttenuation(AUD_Channel* handle, float factor)
+int AUD_setAttenuation(AUD_Handle* handle, float factor)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -657,7 +657,7 @@
return false;
}
-int AUD_setConeAngleOuter(AUD_Channel* handle, float angle)
+int AUD_setConeAngleOuter(AUD_Handle* handle, float angle)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -670,7 +670,7 @@
return false;
}
-int AUD_setConeAngleInner(AUD_Channel* handle, float angle)
+int AUD_setConeAngleInner(AUD_Handle* handle, float angle)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -683,7 +683,7 @@
return false;
}
-int AUD_setConeVolumeOuter(AUD_Channel* handle, float volume)
+int AUD_setConeVolumeOuter(AUD_Handle* handle, float volume)
{
assert(handle);
AUD_Reference<AUD_I3DHandle> h(*handle);
@@ -696,7 +696,7 @@
return false;
}
-int AUD_setSoundVolume(AUD_Channel* handle, float volume)
+int AUD_setSoundVolume(AUD_Handle* handle, float volume)
{
assert(handle);
try
@@ -707,7 +707,7 @@
return false;
}
-int AUD_setSoundPitch(AUD_Channel* handle, float pitch)
+int AUD_setSoundPitch(AUD_Handle* handle, float pitch)
{
assert(handle);
try
@@ -730,18 +730,18 @@
}
}
-AUD_Channel* AUD_playDevice(AUD_Device* device, AUD_Sound* sound, float seek)
+AUD_Handle* AUD_playDevice(AUD_Device* device, AUD_Sound* sound, float seek)
{
assert(device);
assert(sound);
try
{
- AUD_Channel channel = (*device)->play(*sound);
- if(!channel.isNull())
+ AUD_Handle handle = (*device)->play(*sound);
+ if(!handle.isNull())
{
- channel->seek(seek);
- return new AUD_Channel(channel);
+ handle->seek(seek);
+ return new AUD_Handle(handle);
}
}
catch(AUD_Exception&)
@@ -848,13 +848,13 @@
return result;
}
-static void pauseSound(AUD_Channel* handle)
+static void pauseSound(AUD_Handle* handle)
{
assert(handle);
(*handle)->pause();
}
-AUD_Channel* AUD_pauseAfter(AUD_Channel* handle, float seconds)
+AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds)
{
AUD_Reference<AUD_IFactory> silence = new AUD_SilenceFactory;
AUD_Reference<AUD_IFactory> limiter = new AUD_LimiterFactory(silence, 0, seconds);
@@ -863,12 +863,12 @@
try
{
- AUD_Channel channel = AUD_device->play(limiter);
- if(!channel.isNull())
+ AUD_Handle handle2 = AUD_device->play(limiter);
+ if(!handle2.isNull())
{
- channel->setStopCallback((stopCallback)pauseSound, handle);
+ handle2->setStopCallback((stopCallback)pauseSound, handle);
AUD_device->unlock();
- return new AUD_Channel(channel);
+ return new AUD_Handle(handle2);
}
}
catch(AUD_Exception&)
@@ -996,7 +996,7 @@
#endif
}
-void AUD_seekSequencer(AUD_Channel* handle, float time)
+void AUD_seekSequencer(AUD_Handle* handle, float time)
{
#ifdef WITH_JACK
AUD_JackDevice* device = dynamic_cast<AUD_JackDevice*>(AUD_device.get());
@@ -1010,7 +1010,7 @@
}
}
-float AUD_getSequencerPosition(AUD_Channel* handle)
+float AUD_getSequencerPosition(AUD_Handle* handle)
{
#ifdef WITH_JACK
AUD_JackDevice* device = dynamic_cast<AUD_JackDevice*>(AUD_device.get());
@@ -1048,7 +1048,7 @@
return new AUD_Reference<AUD_IFactory>(*sound);
}
-void AUD_freeChannel(AUD_Channel* channel)
+void AUD_freeHandle(AUD_Handle* handle)
{
- delete channel;
+ delete handle;
}
Modified: branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h 2011-06-21 20:21:43 UTC (rev 37711)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h 2011-06-21 20:24:40 UTC (rev 37712)
@@ -57,7 +57,7 @@
#ifndef AUD_CAPI_IMPLEMENTATION
typedef void AUD_Sound;
- typedef void AUD_Channel;
+ typedef void AUD_Handle;
typedef void AUD_Device;
typedef void AUD_SEntry;
typedef float (*AUD_volumeFunction)(void*, void*, float);
@@ -159,7 +159,7 @@
* \param loops The count of remaining loops, -1 for infinity.
* \return Whether the handle is valid.
*/
-extern int AUD_setLoop(AUD_Channel* handle, int loops);
+extern int AUD_setLoop(AUD_Handle* handle, int loops);
/**
* Rectifies a sound.
@@ -181,28 +181,28 @@
* paused when its end has been reached.
* \return A handle to the played back sound.
*/
-extern AUD_Channel* AUD_play(AUD_Sound* sound, int keep);
+extern AUD_Handle* AUD_play(AUD_Sound* sound, int keep);
/**
* Pauses a played back sound.
* \param handle The handle to the sound.
* \return Whether the handle has been playing or not.
*/
-extern int AUD_pause(AUD_Channel* handle);
+extern int AUD_pause(AUD_Handle* handle);
/**
* Resumes a paused sound.
* \param handle The handle to the sound.
* \return Whether the handle has been paused or not.
*/
-extern int AUD_resume(AUD_Channel* handle);
+extern int AUD_resume(AUD_Handle* handle);
/**
* Stops a playing or paused sound.
* \param handle The handle to the sound.
* \return Whether the handle has been valid or not.
*/
-extern int AUD_stop(AUD_Channel* handle);
+extern int AUD_stop(AUD_Handle* handle);
/**
* Sets the end behaviour of a playing or paused sound.
@@ -211,7 +211,7 @@
* paused when its end has been reached.
* \return Whether the handle has been valid or not.
*/
-extern int AUD_setKeep(AUD_Channel* handle, int keep);
+extern int AUD_setKeep(AUD_Handle* handle, int keep);
/**
* Seeks a playing or paused sound.
@@ -219,7 +219,7 @@
* \param seekTo From where the sound file should be played back in seconds.
* \return Whether the handle has been valid or not.
*/
-extern int AUD_seek(AUD_Channel* handle, float seekTo);
+extern int AUD_seek(AUD_Handle* handle, float seekTo);
/**
* Retrieves the playback position of a handle.
@@ -227,14 +227,14 @@
* \return The current playback position in seconds or 0.0 if the handle is
* invalid.
*/
-extern float AUD_getPosition(AUD_Channel* handle);
+extern float AUD_getPosition(AUD_Handle* handle);
/**
* Returns the status of a playing, paused or stopped sound.
* \param handle The handle to the sound.
* \return The status of the sound behind the handle.
*/
-extern AUD_Status AUD_getStatus(AUD_Channel* handle);
+extern AUD_Status AUD_getStatus(AUD_Handle* handle);
/**
* Sets the listener location.
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list