Commit: 009bb9e5c9fb6542193e6a4250643420a7016726
Author: Jörg Müller
Date:   Sat Nov 15 22:15:06 2014 +1300
Branches: master
https://developer.blender.org/rB009bb9e5c9fb6542193e6a4250643420a7016726

Audaspace: adapt internal C-API naming to external audaspace library.

===================================================================

M       intern/audaspace/intern/AUD_C-API.cpp
M       intern/audaspace/intern/AUD_C-API.h

===================================================================

diff --git a/intern/audaspace/intern/AUD_C-API.cpp 
b/intern/audaspace/intern/AUD_C-API.cpp
index 2ee141a..48a3c7b 100644
--- a/intern/audaspace/intern/AUD_C-API.cpp
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -99,7 +99,7 @@ extern "C" {
 #include <cassert>
 
 typedef boost::shared_ptr<AUD_IFactory> AUD_Sound;
-typedef boost::shared_ptr<AUD_ReadDevice> AUD_Device;
+typedef boost::shared_ptr<AUD_IDevice> AUD_Device;
 typedef boost::shared_ptr<AUD_IHandle> AUD_Handle;
 typedef boost::shared_ptr<AUD_SequencerEntry> AUD_SEntry;
 
@@ -130,12 +130,12 @@ void AUD_exitOnce()
 #endif
 }
 
-int AUD_init(const char* device, const char* name, AUD_DeviceSpecs specs, int 
buffersize)
+AUD_Device* AUD_init(const char* device, AUD_DeviceSpecs specs, int 
buffersize, const char* name)
 {
        boost::shared_ptr<AUD_IDevice> dev;
 
        if (AUD_device.get()) {
-               AUD_exit();
+               AUD_exit(NULL);
        }
 
        std::string dname = device;
@@ -163,13 +163,13 @@ int AUD_init(const char* device, const char* name, 
AUD_DeviceSpecs specs, int bu
                        struct stat st;
                        if (stat("/Library/Frameworks/Jackmp.framework", &st) 
!= 0) {
                                printf("Warning: Jack Framework not 
installed\n");
-                               return false;
+                               return NULL;
                        }
                        else
 #endif
                        if (!AUD_jack_supported()) {
                                printf("Warning: Jack cllient not installed\n");
-                               return false;
+                               return NULL;
                        }
                        else {
                                dev = boost::shared_ptr<AUD_IDevice>(new 
AUD_JackDevice(name, specs, buffersize));
@@ -178,21 +178,21 @@ int AUD_init(const char* device, const char* name, 
AUD_DeviceSpecs specs, int bu
 #endif
                else
                {
-                       return false;
+                       return NULL;
                }
 
                AUD_device = dev;
                AUD_3ddevice = dynamic_cast<AUD_I3DDevice *>(AUD_device.get());
 
-               return true;
+               return (AUD_Device*)1;
        }
        catch(AUD_Exception&)
        {
-               return false;
+               return NULL;
        }
 }
 
-void AUD_exit()
+void AUD_exit(AUD_Device* device)
 {
        AUD_device = boost::shared_ptr<AUD_IDevice>();
        AUD_3ddevice = NULL;
@@ -290,16 +290,26 @@ AUD_Sound *AUD_getSoundFromPython(void *sound)
 
 #endif
 
-void AUD_lock()
+void AUD_Device_lock(AUD_Device* device)
 {
        AUD_device->lock();
 }
 
-void AUD_unlock()
+void AUD_Device_unlock(AUD_Device* device)
 {
        AUD_device->unlock();
 }
 
+AUD_Channels AUD_Device_getChannels(AUD_Device* device)
+{
+       return AUD_device->getSpecs().channels;
+}
+
+AUD_SampleRate AUD_Device_getRate(AUD_Device* device)
+{
+       return AUD_device->getSpecs().rate;
+}
+
 AUD_SoundInfo AUD_getInfo(AUD_Sound *sound)
 {
        assert(sound);
@@ -325,19 +335,19 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound *sound)
        return info;
 }
 
-AUD_Sound *AUD_load(const char *filename)
+AUD_Sound *AUD_Sound_file(const char *filename)
 {
        assert(filename);
        return new AUD_Sound(new AUD_FileFactory(filename));
 }
 
-AUD_Sound *AUD_loadBuffer(unsigned char *buffer, int size)
+AUD_Sound *AUD_Sound_bufferFile(unsigned char *buffer, int size)
 {
        assert(buffer);
        return new AUD_Sound(new AUD_FileFactory(buffer, size));
 }
 
-AUD_Sound *AUD_bufferSound(AUD_Sound *sound)
+AUD_Sound *AUD_Sound_cache(AUD_Sound *sound)
 {
        assert(sound);
 
@@ -350,13 +360,13 @@ AUD_Sound *AUD_bufferSound(AUD_Sound *sound)
        }
 }
 
-AUD_Sound *AUD_monoSound(AUD_Sound *sound)
+AUD_Sound *AUD_Sound_rechannel(AUD_Sound *sound, AUD_Channels channels)
 {
        assert(sound);
 
        try {
                AUD_DeviceSpecs specs;
-               specs.channels = AUD_CHANNELS_MONO;
+               specs.channels = channels;
                specs.rate = AUD_RATE_INVALID;
                specs.format = AUD_FORMAT_INVALID;
                return new AUD_Sound(new AUD_ChannelMapperFactory(*sound, 
specs));
@@ -367,7 +377,7 @@ AUD_Sound *AUD_monoSound(AUD_Sound *sound)
        }
 }
 
-AUD_Sound *AUD_delaySound(AUD_Sound *sound, float delay)
+AUD_Sound *AUD_Sound_delay(AUD_Sound *sound, float delay)
 {
        assert(sound);
 
@@ -380,7 +390,7 @@ AUD_Sound *AUD_delaySound(AUD_Sound *sound, float delay)
        }
 }
 
-AUD_Sound *AUD_limitSound(AUD_Sound *sound, float start, float end)
+AUD_Sound *AUD_Sound_limit(AUD_Sound *sound, float start, float end)
 {
        assert(sound);
 
@@ -393,7 +403,7 @@ AUD_Sound *AUD_limitSound(AUD_Sound *sound, float start, 
float end)
        }
 }
 
-AUD_Sound *AUD_pingpongSound(AUD_Sound *sound)
+AUD_Sound *AUD_Sound_pingpong(AUD_Sound *sound)
 {
        assert(sound);
 
@@ -406,7 +416,7 @@ AUD_Sound *AUD_pingpongSound(AUD_Sound *sound)
        }
 }
 
-AUD_Sound *AUD_loopSound(AUD_Sound *sound)
+AUD_Sound *AUD_Sound_loop(AUD_Sound *sound)
 {
        assert(sound);
 
@@ -419,7 +429,7 @@ AUD_Sound *AUD_loopSound(AUD_Sound *sound)
        }
 }
 
-int AUD_setLoop(AUD_Handle *handle, int loops)
+int AUD_Handle_setLoopCount(AUD_Handle *handle, int loops)
 {
        assert(handle);
 
@@ -446,13 +456,13 @@ AUD_Sound *AUD_rectifySound(AUD_Sound *sound)
        }
 }
 
-void AUD_unload(AUD_Sound *sound)
+void AUD_Sound_free(AUD_Sound *sound)
 {
        assert(sound);
        delete sound;
 }
 
-AUD_Handle *AUD_play(AUD_Sound *sound, int keep)
+AUD_Handle *AUD_Device_play(AUD_Device* device, AUD_Sound *sound, int keep)
 {
        assert(sound);
        try {
@@ -467,19 +477,19 @@ AUD_Handle *AUD_play(AUD_Sound *sound, int keep)
        return NULL;
 }
 
-int AUD_pause(AUD_Handle *handle)
+int AUD_Handle_pause(AUD_Handle *handle)
 {
        assert(handle);
        return (*handle)->pause();
 }
 
-int AUD_resume(AUD_Handle *handle)
+int AUD_Handle_resume(AUD_Handle *handle)
 {
        assert(handle);
        return (*handle)->resume();
 }
 
-int AUD_stop(AUD_Handle *handle)
+int AUD_Handle_stop(AUD_Handle *handle)
 {
        assert(handle);
        int result = (*handle)->stop();
@@ -487,36 +497,36 @@ int AUD_stop(AUD_Handle *handle)
        return result;
 }
 
-void AUD_stopAll(void)
+void AUD_Device_stopAll(void* device)
 {
        AUD_device->stopAll();
 }
 
-int AUD_setKeep(AUD_Handle *handle, int keep)
+int AUD_Handle_setKeep(AUD_Handle *handle, int keep)
 {
        assert(handle);
        return (*handle)->setKeep(keep);
 }
 
-int AUD_seek(AUD_Handle *handle, float seekTo)
+int AUD_Handle_setPosition(AUD_Handle *handle, float seekTo)
 {
        assert(handle);
        return (*handle)->seek(seekTo);
 }
 
-float AUD_getPosition(AUD_Handle *handle)
+float AUD_Handle_getPosition(AUD_Handle *handle)
 {
        assert(handle);
        return (*handle)->getPosition();
 }
 
-AUD_Status AUD_getStatus(AUD_Handle *handle)
+AUD_Status AUD_Handle_getStatus(AUD_Handle *handle)
 {
        assert(handle);
        return (*handle)->getStatus();
 }
 
-int AUD_setListenerLocation(const float location[3])
+int AUD_Device_setListenerLocation(const float location[3])
 {
        if (AUD_3ddevice) {
                AUD_Vector3 v(location[0], location[1], location[2]);
@@ -527,7 +537,7 @@ int AUD_setListenerLocation(const float location[3])
        return false;
 }
 
-int AUD_setListenerVelocity(const float velocity[3])
+int AUD_Device_setListenerVelocity(const float velocity[3])
 {
        if (AUD_3ddevice) {
                AUD_Vector3 v(velocity[0], velocity[1], velocity[2]);
@@ -538,7 +548,7 @@ int AUD_setListenerVelocity(const float velocity[3])
        return false;
 }
 
-int AUD_setListenerOrientation(const float orientation[4])
+int AUD_Device_setListenerOrientation(const float orientation[4])
 {
        if (AUD_3ddevice) {
                AUD_Quaternion q(orientation[3], orientation[0], 
orientation[1], orientation[2]);
@@ -549,7 +559,7 @@ int AUD_setListenerOrientation(const float orientation[4])
        return false;
 }
 
-int AUD_setSpeedOfSound(float speed)
+int AUD_Device_setSpeedOfSound(void* device, float speed)
 {
        if (AUD_3ddevice) {
                AUD_3ddevice->setSpeedOfSound(speed);
@@ -559,7 +569,7 @@ int AUD_setSpeedOfSound(float speed)
        return false;
 }
 
-int AUD_setDopplerFactor(float factor)
+int AUD_Device_setDopplerFactor(void* device, float factor)
 {
        if (AUD_3ddevice) {
                AUD_3ddevice->setDopplerFactor(factor);
@@ -569,7 +579,7 @@ int AUD_setDopplerFactor(float factor)
        return false;
 }
 
-int AUD_setDistanceModel(AUD_DistanceModel model)
+int AUD_Device_setDistanceModel(void* device, AUD_DistanceModel model)
 {
        if (AUD_3ddevice) {
                AUD_3ddevice->setDistanceModel(model);
@@ -579,7 +589,7 @@ int AUD_setDistanceModel(AUD_DistanceModel model)
        return false;
 }
 
-int AUD_setSourceLocation(AUD_Handle *handle, const float location[3])
+int AUD_Handle_setLocation(AUD_Handle *handle, const float location[3])
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -592,7 +602,7 @@ int AUD_setSourceLocation(AUD_Handle *handle, const float 
location[3])
        return false;
 }
 
-int AUD_setSourceVelocity(AUD_Handle *handle, const float velocity[3])
+int AUD_Handle_setVelocity(AUD_Handle *handle, const float velocity[3])
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -605,7 +615,7 @@ int AUD_setSourceVelocity(AUD_Handle *handle, const float 
velocity[3])
        return false;
 }
 
-int AUD_setSourceOrientation(AUD_Handle *handle, const float orientation[4])
+int AUD_Handle_setOrientation(AUD_Handle *handle, const float orientation[4])
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -618,7 +628,7 @@ int AUD_setSourceOrientation(AUD_Handle *handle, const 
float orientation[4])
        return false;
 }
 
-int AUD_setRelative(AUD_Handle *handle, int relative)
+int AUD_Handle_setRelative(AUD_Handle *handle, int relative)
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -630,7 +640,7 @@ int AUD_setRelative(AUD_Handle *handle, int relative)
        return false;
 }
 
-int AUD_setVolumeMaximum(AUD_Handle *handle, float volume)
+int AUD_Handle_setVolumeMaximum(AUD_Handle *handle, float volume)
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -642,7 +652,7 @@ int AUD_setVolumeMaximum(AUD_Handle *handle, float volume)
        return false;
 }
 
-int AUD_setVolumeMinimum(AUD_Handle *handle, float volume)
+int AUD_Handle_setVolumeMinimum(AUD_Handle *handle, float volume)
 {
        assert(handle);
        boost::shared_ptr<AUD_I3DHandle> h = 
boost::dynamic_pointer_cast<AUD_I3DHandle>(*handle);
@@ -654,7 +664,7 @@ int AUD_setVolumeMinimum(AUD_Handle *handle, float volume)
        return false;
 }
 
-int AUD_setDistanceMaximum(AUD_Handle *handle, float distance)
+int AUD_Handle_setDistanceMaximum(AUD_Handle *handle, float distance)
 {
        assert(handle);
        boost::s

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to