diff options
author | Chris Robinson <[email protected]> | 2013-12-25 19:35:43 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-25 19:35:43 -0800 |
commit | 677b864565d6be9423197ce09dba43579fe20405 (patch) | |
tree | 25e66ceea9aeae1d18e6f16ffc93b29648ff8947 /OpenAL32 | |
parent | b650ecbc23222ebd295384fce45aaca8cfb5c368 (diff) |
Remove the zone, sample, and instrument object types
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 10 | ||||
-rw-r--r-- | OpenAL32/Include/alMidi.h | 64 | ||||
-rw-r--r-- | OpenAL32/alInstrument.c | 134 |
3 files changed, 0 insertions, 208 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index aafe6c90..2718b6c0 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -57,9 +57,6 @@ typedef ALboolean (AL_APIENTRY*LPALISPRESETSOFT)(ALuint id); typedef void (AL_APIENTRY*LPALPRESETISOFT)(ALuint id, ALenum param, ALint value); typedef void (AL_APIENTRY*LPALPRESETIVSOFT)(ALuint id, ALenum param, const ALint *values); typedef void (AL_APIENTRY*LPALGETPRESETIVSOFT)(ALuint id, ALenum param, ALint *values); -typedef void (AL_APIENTRY*LPALGENINSTRUMENTSSOFT)(ALsizei n, ALuint *ids); -typedef void (AL_APIENTRY*LPALDELETEINSTRUMENTSSOFT)(ALsizei n, const ALuint *ids); -typedef ALboolean (AL_APIENTRY*LPALISINSTRUMENTSOFT)(ALuint id); typedef void (AL_APIENTRY*LPALGENFONTSOUNDSSOFT)(ALsizei n, ALuint *ids); typedef void (AL_APIENTRY*LPALDELETEFONTSOUNDSSOFT)(ALsizei n, const ALuint *ids); typedef ALboolean (AL_APIENTRY*LPALISFONTSOUNDSOFT)(ALuint id); @@ -90,10 +87,6 @@ AL_API void AL_APIENTRY alPresetiSOFT(ALuint id, ALenum param, ALint value); AL_API void AL_APIENTRY alPresetivSOFT(ALuint id, ALenum param, const ALint *values); AL_API void AL_APIENTRY alGetPresetivSOFT(ALuint id, ALenum param, ALint *values); -AL_API void AL_APIENTRY alGenInstrumentsSOFT(ALsizei n, ALuint *ids); -AL_API void AL_APIENTRY alDeleteInstrumentsSOFT(ALsizei n, const ALuint *ids); -AL_API ALboolean AL_APIENTRY alIsInstrumentSOFT(ALuint id); - AL_API void AL_APIENTRY alGenFontsoundsSOFT(ALsizei n, ALuint *ids); AL_API void AL_APIENTRY alDeleteFontsoundsSOFT(ALsizei n, const ALuint *ids); AL_API ALboolean AL_APIENTRY alIsFontsoundSOFT(ALuint id); @@ -477,9 +470,6 @@ struct ALCdevice_struct // Map of Presets for this device UIntMap PresetMap; - // Map of Instruments for this device - UIntMap InstrumentMap; - // Map of Fontsounds for this device UIntMap FontsoundMap; diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h index 9b195d26..38042693 100644 --- a/OpenAL32/Include/alMidi.h +++ b/OpenAL32/Include/alMidi.h @@ -21,68 +21,6 @@ typedef struct ALsfmodulator { ALenum TransformOp; } ALsfmodulator; -typedef struct ALsfzone { - ALsfgenerator *Generators; - ALsizei NumGenerators; - ALsizei GeneratorsMax; - - ALsfmodulator *Modulators; - ALsizei NumModulators; - ALsizei ModulatorsMax; - - /* NOTE: Preset zones may have a reference to an ALsfinstrument. Instrument - * zones may have a reference to an ALsfsample. */ - ALvoid *Object; -} ALsfzone; - -void ALsfzone_Construct(ALsfzone *self); -void ALsfzone_Destruct(ALsfzone *self); -ALenum ALsfzone_addGenerator(ALsfzone *self, ALenum generator, ALint value); -ALenum ALsfzone_addModulator(ALsfzone *self, ALenum sourceop, ALenum destop, ALint amount, ALenum amtsourceop, ALenum transop); -/* Stores a new object pointer in the zone. Returns the old object pointer. */ -ALvoid *ALsfzone_setRefObject(ALsfzone *self, ALvoid *object); - - -typedef struct ALsfsample { - volatile RefCount ref; - - ALuint Start; - ALuint End; - ALuint LoopStart; - ALuint LoopEnd; - ALuint SampleRate; - ALubyte PitchKey; - ALbyte PitchCorrection; - ALushort SampleLink; - ALenum SampleType; - - ALuint id; -} ALsfsample; - -void ALsfsample_Construct(ALsfsample *self); -void ALsfsample_Destruct(ALsfsample *self); - - -typedef struct ALsfinstrument { - volatile RefCount ref; - - ALsfzone *Zones; - ALsizei NumZones; - - ALuint id; -} ALsfinstrument; - -void ALsfinstrument_Construct(ALsfinstrument *self); -void ALsfinstrument_Destruct(ALsfinstrument *self); - - -inline struct ALsfinstrument *LookupInstrument(ALCdevice *device, ALuint id) -{ return (struct ALsfinstrument*)LookupUIntMapKey(&device->InstrumentMap, id); } -inline struct ALsfinstrument *RemoveInstrument(ALCdevice *device, ALuint id) -{ return (struct ALsfinstrument*)RemoveUIntMapKey(&device->InstrumentMap, id); } - -void ReleaseALInstruments(ALCdevice *device); - typedef struct ALfontsound { volatile RefCount ref; @@ -131,8 +69,6 @@ typedef struct ALsfpreset { ALint Preset; /* a.k.a. MIDI program number */ ALint Bank; /* MIDI bank 0...127, or percussion (bank 128) */ - ALsfzone *Zones; - ALsizei NumZones; ALuint id; } ALsfpreset; diff --git a/OpenAL32/alInstrument.c b/OpenAL32/alInstrument.c deleted file mode 100644 index cd186475..00000000 --- a/OpenAL32/alInstrument.c +++ /dev/null @@ -1,134 +0,0 @@ - -#include "config.h" - -#include <stdlib.h> -#include <string.h> - -#include "alMain.h" -#include "alMidi.h" -#include "alError.h" -#include "alThunk.h" - -#include "midi/base.h" - - -extern inline struct ALsfinstrument *LookupInstrument(ALCdevice *device, ALuint id); -extern inline struct ALsfinstrument *RemoveInstrument(ALCdevice *device, ALuint id); - - -AL_API void AL_APIENTRY alGenInstrumentsSOFT(ALsizei n, ALuint *ids) -{ - ALCdevice *device; - ALCcontext *context; - ALsizei cur = 0; - ALenum err; - - context = GetContextRef(); - if(!context) return; - - if(!(n >= 0)) - SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); - - device = context->Device; - for(cur = 0;cur < n;cur++) - { - ALsfinstrument *inst = calloc(1, sizeof(ALsfinstrument)); - if(!inst) - { - alDeleteInstrumentsSOFT(cur, ids); - SET_ERROR_AND_GOTO(context, AL_OUT_OF_MEMORY, done); - } - ALsfinstrument_Construct(inst); - - err = NewThunkEntry(&inst->id); - if(err == AL_NO_ERROR) - err = InsertUIntMapEntry(&device->InstrumentMap, inst->id, inst); - if(err != AL_NO_ERROR) - { - ALsfinstrument_Destruct(inst); - memset(inst, 0, sizeof(*inst)); - free(inst); - - alDeleteInstrumentsSOFT(cur, ids); - SET_ERROR_AND_GOTO(context, err, done); - } - - ids[cur] = inst->id; - } - -done: - ALCcontext_DecRef(context); -} - -AL_API ALvoid AL_APIENTRY alDeleteInstrumentsSOFT(ALsizei n, const ALuint *ids) -{ - ALCdevice *device; - ALCcontext *context; - ALsfinstrument *inst; - ALsizei i; - - context = GetContextRef(); - if(!context) return; - - if(!(n >= 0)) - SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); - - device = context->Device; - for(i = 0;i < n;i++) - { - /* Check for valid ID */ - if((inst=LookupInstrument(device, ids[i])) == NULL) - SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done); - if(inst->ref != 0) - SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done); - } - - for(i = 0;i < n;i++) - { - if((inst=RemoveInstrument(device, ids[i])) == NULL) - continue; - - ALsfinstrument_Destruct(inst); - - memset(inst, 0, sizeof(*inst)); - free(inst); - } - -done: - ALCcontext_DecRef(context); -} - -AL_API ALboolean AL_APIENTRY alIsInstrumentSOFT(ALuint id) -{ - ALCcontext *context; - ALboolean ret; - - context = GetContextRef(); - if(!context) return AL_FALSE; - - ret = LookupInstrument(context->Device, id) ? AL_TRUE : AL_FALSE; - - ALCcontext_DecRef(context); - - return ret; -} - - -/* ReleaseALInstruments - * - * Called to destroy any instruments that still exist on the device - */ -void ReleaseALInstruments(ALCdevice *device) -{ - ALsizei i; - for(i = 0;i < device->InstrumentMap.size;i++) - { - ALsfinstrument *temp = device->InstrumentMap.array[i].value; - device->InstrumentMap.array[i].value = NULL; - - ALsfinstrument_Destruct(temp); - - memset(temp, 0, sizeof(*temp)); - free(temp); - } -} |