165 lines
3.9 KiB
C
Raw Normal View History

2013-11-27 05:12:11 -08:00
#ifndef ALMIDI_H
#define ALMIDI_H
#include "alMain.h"
2013-12-17 21:56:28 -08:00
#include "atomic.h"
2013-11-27 05:12:11 -08:00
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ALsfmodulator {
struct {
ALenum Input;
ALenum Type;
ALenum Form;
} Source[2];
ALint Amount;
ALenum TransformOp;
ALenum Dest;
} ALsfmodulator;
typedef struct ALenvelope {
ALint DelayTime;
ALint AttackTime;
ALint HoldTime;
ALint DecayTime;
ALint SustainAttn;
ALint ReleaseTime;
ALint KeyToHoldTime;
ALint KeyToDecayTime;
} ALenvelope;
2013-12-19 00:57:07 -08:00
typedef struct ALfontsound {
RefCount ref;
struct ALbuffer *Buffer;
ALint MinKey, MaxKey;
ALint MinVelocity, MaxVelocity;
2013-12-29 02:25:40 -08:00
ALint ModLfoToPitch;
ALint VibratoLfoToPitch;
ALint ModEnvToPitch;
2013-12-29 03:18:31 -08:00
ALint FilterCutoff;
ALint FilterQ;
ALint ModLfoToFilterCutoff;
ALint ModEnvToFilterCutoff;
ALint ModLfoToVolume;
2013-12-29 03:18:31 -08:00
2013-12-29 04:36:01 -08:00
ALint ChorusSend;
ALint ReverbSend;
2013-12-29 04:24:32 -08:00
ALint Pan;
struct {
ALint Delay;
ALint Frequency;
} ModLfo;
struct {
ALint Delay;
ALint Frequency;
} VibratoLfo;
ALenvelope ModEnv;
ALenvelope VolEnv;
2013-12-29 02:14:10 -08:00
2013-12-29 04:24:32 -08:00
ALint Attenuation;
2013-12-29 03:43:00 -08:00
ALint CoarseTuning;
ALint FineTuning;
ALenum LoopMode;
ALint TuningScale;
ALint ExclusiveClass;
ALuint Start;
ALuint End;
ALuint LoopStart;
ALuint LoopEnd;
ALuint SampleRate;
ALubyte PitchKey;
ALbyte PitchCorrection;
ALenum SampleType;
2013-12-26 22:10:41 -08:00
struct ALfontsound *Link;
2014-01-02 14:43:44 -08:00
UIntMap ModulatorMap;
ALuint id;
} ALfontsound;
void ALfontsound_setPropi(ALfontsound *self, ALCcontext *context, ALenum param, ALint value);
void ALfontsound_setModStagei(ALfontsound *self, ALCcontext *context, ALsizei stage, ALenum param, ALint value);
ALfontsound *NewFontsound(ALCcontext *context);
2014-06-30 00:10:40 -07:00
void DeleteFontsound(ALCdevice *device, ALfontsound *sound);
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); }
2014-01-02 14:43:44 -08:00
inline struct ALsfmodulator *LookupModulator(ALfontsound *sound, ALuint id)
{ return (struct ALsfmodulator*)LookupUIntMapKey(&sound->ModulatorMap, id); }
inline struct ALsfmodulator *RemoveModulator(ALfontsound *sound, ALuint id)
{ return (struct ALsfmodulator*)RemoveUIntMapKey(&sound->ModulatorMap, id); }
void ReleaseALFontsounds(ALCdevice *device);
typedef struct ALsfpreset {
RefCount ref;
ALint Preset; /* a.k.a. MIDI program number */
ALint Bank; /* MIDI bank 0...127, or percussion (bank 128) */
2013-12-25 19:50:46 -08:00
ALfontsound **Sounds;
ALsizei NumSounds;
ALuint id;
} ALsfpreset;
ALsfpreset *NewPreset(ALCcontext *context);
2014-06-30 00:10:40 -07:00
void DeletePreset(ALCdevice *device, ALsfpreset *preset);
inline struct ALsfpreset *LookupPreset(ALCdevice *device, ALuint id)
{ return (struct ALsfpreset*)LookupUIntMapKey(&device->PresetMap, id); }
inline struct ALsfpreset *RemovePreset(ALCdevice *device, ALuint id)
{ return (struct ALsfpreset*)RemoveUIntMapKey(&device->PresetMap, id); }
void ReleaseALPresets(ALCdevice *device);
typedef struct ALsoundfont {
RefCount ref;
ALsfpreset **Presets;
ALsizei NumPresets;
RWLock Lock;
ALuint id;
} ALsoundfont;
void ALsoundfont_Construct(ALsoundfont *self);
void ALsoundfont_Destruct(ALsoundfont *self);
ALsoundfont *ALsoundfont_getDefSoundfont(ALCcontext *context);
void ALsoundfont_deleteSoundfont(ALsoundfont *self, ALCdevice *device);
inline struct ALsoundfont *LookupSfont(ALCdevice *device, ALuint id)
{ return (struct ALsoundfont*)LookupUIntMapKey(&device->SfontMap, id); }
inline struct ALsoundfont *RemoveSfont(ALCdevice *device, ALuint id)
{ return (struct ALsoundfont*)RemoveUIntMapKey(&device->SfontMap, id); }
void ReleaseALSoundfonts(ALCdevice *device);
2013-11-27 05:12:11 -08:00
#ifdef __cplusplus
}
#endif
#endif /* ALMIDI_H */