summaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-25 19:13:59 -0800
committerChris Robinson <[email protected]>2013-12-25 19:13:59 -0800
commit94ddc5cb1889a42c9ffe98b79e431b596a9563df (patch)
treeb513f8c94347fb697775e286c735ee79dcc201dd /OpenAL32/Include
parentcb3f82a4bf50aef28353629f2f7d6f45b5d420dc (diff)
Add a new fontsound object type
This is basically a combined preset and intrument zone with sample header.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h11
-rw-r--r--OpenAL32/Include/alMidi.h39
2 files changed, 50 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 5e3cdc4f..aafe6c90 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -60,6 +60,9 @@ typedef void (AL_APIENTRY*LPALGETPRESETIVSOFT)(ALuint id, ALenum param, ALint *v
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);
typedef void (AL_APIENTRY*LPALMIDISOUNDFONTSOFT)(const char *filename);
typedef void (AL_APIENTRY*LPALMIDIEVENTSOFT)(ALuint64SOFT time, ALenum event, ALsizei channel, ALsizei param1, ALsizei param2);
typedef void (AL_APIENTRY*LPALMIDISYSEXSOFT)(ALuint64SOFT time, const ALbyte *data, ALsizei size);
@@ -90,6 +93,11 @@ 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);
+
AL_API void AL_APIENTRY alMidiSoundfontSOFT(const char *filename);
AL_API void AL_APIENTRY alMidiEventSOFT(ALuint64SOFT time, ALenum event, ALsizei channel, ALsizei param1, ALsizei param2);
AL_API void AL_APIENTRY alMidiSysExSOFT(ALuint64SOFT time, const ALbyte *data, ALsizei size);
@@ -472,6 +480,9 @@ struct ALCdevice_struct
// Map of Instruments for this device
UIntMap InstrumentMap;
+ // Map of Fontsounds for this device
+ UIntMap FontsoundMap;
+
/* MIDI synth engine */
struct MidiSynth *Synth;
diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h
index b37a6546..374940c1 100644
--- a/OpenAL32/Include/alMidi.h
+++ b/OpenAL32/Include/alMidi.h
@@ -84,6 +84,45 @@ inline struct ALsfinstrument *RemoveInstrument(ALCdevice *device, ALuint id)
void ReleaseALInstruments(ALCdevice *device);
+typedef struct ALfontsound {
+ volatile RefCount ref;
+
+ ALint MinKey, MaxKey;
+ ALint MinVelocity, MaxVelocity;
+
+ ALsfgenerator *Generators;
+ ALsizei NumGenerators;
+ ALsizei GeneratorsMax;
+
+ ALsfmodulator *Modulators;
+ ALsizei NumModulators;
+ ALsizei ModulatorsMax;
+
+ ALuint Start;
+ ALuint End;
+ ALuint LoopStart;
+ ALuint LoopEnd;
+ ALuint SampleRate;
+ ALubyte PitchKey;
+ ALbyte PitchCorrection;
+ ALint SampleLink;
+ ALenum SampleType;
+
+ ALuint id;
+} ALfontsound;
+
+void ALfontsound_Construct(ALfontsound *self);
+void ALfontsound_Destruct(ALfontsound *self);
+
+
+inline struct ALfontsound *LookupFontsound(ALCdevice *device, ALuint id)
+{ return (struct ALfontsound*)LookupUIntMapKey(&device->FontsoundMap, id); }
+inline struct ALfontsound *RemoveFontsound(ALCdevice *device, ALuint id)
+{ return (struct ALfontsound*)RemoveUIntMapKey(&device->FontsoundMap, id); }
+
+void ReleaseALFontsounds(ALCdevice *device);
+
+
typedef struct ALsfpreset {
volatile RefCount ref;