Add filter properties
[openal-soft.git] / OpenAL32 / Include / alMidi.h
bloba6e5c0a3decb9474b537aa6a597c054b9bb38960
1 #ifndef ALMIDI_H
2 #define ALMIDI_H
4 #include "alMain.h"
5 #include "atomic.h"
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 typedef struct ALsfmodulator {
12 ALenum SourceOp;
13 ALenum DestOp;
14 ALint Amount;
15 ALenum AmountSourceOp;
16 ALenum TransformOp;
17 } ALsfmodulator;
20 typedef struct ALfontsound {
21 volatile RefCount ref;
23 ALint MinKey, MaxKey;
24 ALint MinVelocity, MaxVelocity;
26 ALint ModLfoToPitch;
27 ALint VibratoLfoToPitch;
28 ALint ModEnvToPitch;
30 ALint FilterCutoff;
31 ALint FilterQ;
32 ALint ModLfoToFilterCutoff;
33 ALint ModEnvToFilterCutoff;
35 struct {
36 ALint DelayTime;
37 ALint AttackTime;
38 ALint HoldTime;
39 ALint DecayTime;
40 ALint SustainVol;
41 ALint ReleaseTime;
42 ALint KeyToHoldTime;
43 ALint KeyToDecayTime;
44 } ModEnv;
45 struct {
46 ALint DelayTime;
47 ALint AttackTime;
48 ALint HoldTime;
49 ALint DecayTime;
50 ALint SustainVol;
51 ALint ReleaseTime;
52 ALint KeyToHoldTime;
53 ALint KeyToDecayTime;
54 } VolEnv;
56 ALuint Start;
57 ALuint End;
58 ALuint LoopStart;
59 ALuint LoopEnd;
60 ALuint SampleRate;
61 ALenum LoopMode;
62 ALubyte PitchKey;
63 ALbyte PitchCorrection;
64 ALenum SampleType;
65 struct ALfontsound *Link;
67 ALsfmodulator *Modulators;
68 ALsizei NumModulators;
69 ALsizei ModulatorsMax;
71 ALuint id;
72 } ALfontsound;
74 void ALfontsound_Construct(ALfontsound *self);
75 void ALfontsound_Destruct(ALfontsound *self);
76 ALenum ALfontsound_addGenerator(ALfontsound *self, ALenum generator, ALint value);
77 ALenum ALfontsound_addModulator(ALfontsound *self, ALenum sourceop, ALenum destop, ALint amount, ALenum amtsourceop, ALenum transop);
80 inline struct ALfontsound *LookupFontsound(ALCdevice *device, ALuint id)
81 { return (struct ALfontsound*)LookupUIntMapKey(&device->FontsoundMap, id); }
82 inline struct ALfontsound *RemoveFontsound(ALCdevice *device, ALuint id)
83 { return (struct ALfontsound*)RemoveUIntMapKey(&device->FontsoundMap, id); }
85 void ReleaseALFontsounds(ALCdevice *device);
88 typedef struct ALsfpreset {
89 volatile RefCount ref;
91 ALint Preset; /* a.k.a. MIDI program number */
92 ALint Bank; /* MIDI bank 0...127, or percussion (bank 128) */
94 ALfontsound **Sounds;
95 ALsizei NumSounds;
97 ALuint id;
98 } ALsfpreset;
100 void ALsfpreset_Construct(ALsfpreset *self);
101 void ALsfpreset_Destruct(ALsfpreset *self);
104 inline struct ALsfpreset *LookupPreset(ALCdevice *device, ALuint id)
105 { return (struct ALsfpreset*)LookupUIntMapKey(&device->PresetMap, id); }
106 inline struct ALsfpreset *RemovePreset(ALCdevice *device, ALuint id)
107 { return (struct ALsfpreset*)RemoveUIntMapKey(&device->PresetMap, id); }
109 void ReleaseALPresets(ALCdevice *device);
112 typedef struct ALsoundfont {
113 volatile RefCount ref;
115 ALsfpreset **Presets;
116 ALsizei NumPresets;
118 ALshort *Samples;
119 ALint NumSamples;
121 RWLock Lock;
122 volatile ALenum Mapped;
124 ALuint id;
125 } ALsoundfont;
127 void ALsoundfont_Construct(ALsoundfont *self);
128 void ALsoundfont_Destruct(ALsoundfont *self);
130 inline struct ALsoundfont *LookupSfont(ALCdevice *device, ALuint id)
131 { return (struct ALsoundfont*)LookupUIntMapKey(&device->SfontMap, id); }
132 inline struct ALsoundfont *RemoveSfont(ALCdevice *device, ALuint id)
133 { return (struct ALsoundfont*)RemoveUIntMapKey(&device->SfontMap, id); }
135 void ReleaseALSoundfonts(ALCdevice *device);
137 #ifdef __cplusplus
139 #endif
141 #endif /* ALMIDI_H */