aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alState.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-28 01:53:05 -0800
committerChris Robinson <[email protected]>2013-11-28 01:53:05 -0800
commita48f362d282401ddefe742188bd13a59fc79835e (patch)
tree9964affac5410cce4d4189564afa18b6c350f84c /OpenAL32/alState.c
parent489723723c79b4a7470c0d01065bd24d1301a6d1 (diff)
Start a MIDI interface extension
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r--OpenAL32/alState.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 6c58e314..5f88ff5e 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -23,10 +23,12 @@
#include <stdlib.h>
#include "alMain.h"
#include "AL/alc.h"
+#include "AL/al.h"
#include "AL/alext.h"
#include "alError.h"
#include "alSource.h"
#include "alAuxEffectSlot.h"
+#include "alMidi.h"
static const ALchar alVendor[] = "OpenAL Community";
@@ -273,6 +275,54 @@ done:
return value;
}
+AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname)
+{
+ ALCcontext *context;
+ ALCdevice *device;
+ ALint64SOFT value = 0;
+
+ context = GetContextRef();
+ if(!context) return 0;
+
+ switch(pname)
+ {
+ case AL_DOPPLER_FACTOR:
+ value = (ALint64SOFT)context->DopplerFactor;
+ break;
+
+ case AL_DOPPLER_VELOCITY:
+ value = (ALint64SOFT)context->DopplerVelocity;
+ break;
+
+ case AL_DISTANCE_MODEL:
+ value = (ALint64SOFT)context->DistanceModel;
+ break;
+
+ case AL_SPEED_OF_SOUND:
+ value = (ALint64SOFT)context->SpeedOfSound;
+ break;
+
+ case AL_DEFERRED_UPDATES_SOFT:
+ value = (ALint64SOFT)context->DeferUpdates;
+ break;
+
+ case AL_MIDI_CLOCK_SOFT:
+ device = context->Device;
+ ALCdevice_Lock(device);
+ value = MidiSynth_getTime(device->Synth);
+ ALCdevice_Unlock(device);
+ break;
+
+ default:
+ SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
+ }
+
+done:
+ ALCcontext_DecRef(context);
+
+ return value;
+}
+
AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname, ALboolean *values)
{
ALCcontext *context;
@@ -405,6 +455,40 @@ done:
ALCcontext_DecRef(context);
}
+AL_API void AL_APIENTRY alGetInteger64vSOFT(ALenum pname, ALint64SOFT *values)
+{
+ ALCcontext *context;
+
+ if(values)
+ {
+ switch(pname)
+ {
+ case AL_DOPPLER_FACTOR:
+ case AL_DOPPLER_VELOCITY:
+ case AL_DISTANCE_MODEL:
+ case AL_SPEED_OF_SOUND:
+ case AL_DEFERRED_UPDATES_SOFT:
+ case AL_MIDI_CLOCK_SOFT:
+ values[0] = alGetInteger64SOFT(pname);
+ return;
+ }
+ }
+
+ context = GetContextRef();
+ if(!context) return;
+
+ if(!(values))
+ SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
+ switch(pname)
+ {
+ default:
+ SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
+ }
+
+done:
+ ALCcontext_DecRef(context);
+}
+
AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
{
const ALchar *value = NULL;