From f7556b827a11a507780a35e437ed62a0b3ee0d62 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 24 Dec 2013 02:55:11 -0800 Subject: [PATCH] Allow querying the soundfont sample length and format type --- OpenAL32/Include/alMain.h | 1 + OpenAL32/alSoundfont.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index d5730007..5e3cdc4f 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -35,6 +35,7 @@ #define AL_MIDI_BANK_SOFT 0x9996 #define AL_PRESETS_SIZE_SOFT 0x9995 #define AL_PRESETS_SOFT 0x9994 +#define AL_FORMAT_TYPE_SOFT 0x1991 #define AL_NOTEOFF_SOFT 0x0080 #define AL_NOTEON_SOFT 0x0090 #define AL_AFTERTOUCH_SOFT 0x00A0 diff --git a/OpenAL32/alSoundfont.c b/OpenAL32/alSoundfont.c index 7b19ccb6..4bc4da48 100644 --- a/OpenAL32/alSoundfont.c +++ b/OpenAL32/alSoundfont.c @@ -231,6 +231,14 @@ AL_API void AL_APIENTRY alGetSoundfontivSOFT(ALuint id, ALenum param, ALint *val values[i] = sfont->Presets[i]->id; break; + case AL_SAMPLE_LENGTH_SOFT: + values[0] = sfont->NumSamples; + break; + + case AL_FORMAT_TYPE_SOFT: + values[0] = AL_SHORT_SOFT; + break; + default: SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done); }