Allow querying the soundfont sample length and format type

This commit is contained in:
Chris Robinson 2013-12-24 02:55:11 -08:00
parent b0878fe609
commit f7556b827a
2 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#define AL_MIDI_BANK_SOFT 0x9996 #define AL_MIDI_BANK_SOFT 0x9996
#define AL_PRESETS_SIZE_SOFT 0x9995 #define AL_PRESETS_SIZE_SOFT 0x9995
#define AL_PRESETS_SOFT 0x9994 #define AL_PRESETS_SOFT 0x9994
#define AL_FORMAT_TYPE_SOFT 0x1991
#define AL_NOTEOFF_SOFT 0x0080 #define AL_NOTEOFF_SOFT 0x0080
#define AL_NOTEON_SOFT 0x0090 #define AL_NOTEON_SOFT 0x0090
#define AL_AFTERTOUCH_SOFT 0x00A0 #define AL_AFTERTOUCH_SOFT 0x00A0

View File

@ -231,6 +231,14 @@ AL_API void AL_APIENTRY alGetSoundfontivSOFT(ALuint id, ALenum param, ALint *val
values[i] = sfont->Presets[i]->id; values[i] = sfont->Presets[i]->id;
break; break;
case AL_SAMPLE_LENGTH_SOFT:
values[0] = sfont->NumSamples;
break;
case AL_FORMAT_TYPE_SOFT:
values[0] = AL_SHORT_SOFT;
break;
default: default:
SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done); SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
} }