aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-01-17 00:36:33 -0800
committerChris Robinson <[email protected]>2014-01-17 00:36:33 -0800
commit08ba5d9dba798c3985bad425906564431b4f6c0d (patch)
tree3c4e774f5cb2e99b7d3c4f46b56afbe76579ecce
parente118ac93a01c15adee8e6d81a99dda73a985c54d (diff)
Use a proper struct for envelope properties
-rw-r--r--Alc/midi/fluidsynth.c4
-rw-r--r--OpenAL32/Include/alMidi.h33
-rw-r--r--OpenAL32/alFontsound.c12
3 files changed, 21 insertions, 28 deletions
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c
index 0e3ddd6d..be3c0da7 100644
--- a/Alc/midi/fluidsynth.c
+++ b/Alc/midi/fluidsynth.c
@@ -320,7 +320,7 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan
fluid_voice_gen_set(voice, GEN_MODENVATTACK, sound->ModEnv.AttackTime);
fluid_voice_gen_set(voice, GEN_MODENVHOLD, sound->ModEnv.HoldTime);
fluid_voice_gen_set(voice, GEN_MODENVDECAY, sound->ModEnv.DecayTime);
- fluid_voice_gen_set(voice, GEN_MODENVSUSTAIN, sound->ModEnv.SustainVol);
+ fluid_voice_gen_set(voice, GEN_MODENVSUSTAIN, sound->ModEnv.SustainAttn);
fluid_voice_gen_set(voice, GEN_MODENVRELEASE, sound->ModEnv.ReleaseTime);
fluid_voice_gen_set(voice, GEN_KEYTOMODENVHOLD, sound->ModEnv.KeyToHoldTime);
fluid_voice_gen_set(voice, GEN_KEYTOMODENVDECAY, sound->ModEnv.KeyToDecayTime);
@@ -328,7 +328,7 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan
fluid_voice_gen_set(voice, GEN_VOLENVATTACK, sound->VolEnv.AttackTime);
fluid_voice_gen_set(voice, GEN_VOLENVHOLD, sound->VolEnv.HoldTime);
fluid_voice_gen_set(voice, GEN_VOLENVDECAY, sound->VolEnv.DecayTime);
- fluid_voice_gen_set(voice, GEN_VOLENVSUSTAIN, sound->VolEnv.SustainVol);
+ fluid_voice_gen_set(voice, GEN_VOLENVSUSTAIN, sound->VolEnv.SustainAttn);
fluid_voice_gen_set(voice, GEN_VOLENVRELEASE, sound->VolEnv.ReleaseTime);
fluid_voice_gen_set(voice, GEN_KEYTOVOLENVHOLD, sound->VolEnv.KeyToHoldTime);
fluid_voice_gen_set(voice, GEN_KEYTOVOLENVDECAY, sound->VolEnv.KeyToDecayTime);
diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h
index b24f43a0..24e6675f 100644
--- a/OpenAL32/Include/alMidi.h
+++ b/OpenAL32/Include/alMidi.h
@@ -19,6 +19,17 @@ typedef struct ALsfmodulator {
ALenum Dest;
} ALsfmodulator;
+typedef struct ALenvelope {
+ ALint DelayTime;
+ ALint AttackTime;
+ ALint HoldTime;
+ ALint DecayTime;
+ ALint SustainAttn;
+ ALint ReleaseTime;
+ ALint KeyToHoldTime;
+ ALint KeyToDecayTime;
+} ALenvelope;
+
typedef struct ALfontsound {
volatile RefCount ref;
@@ -50,26 +61,8 @@ typedef struct ALfontsound {
ALint Frequency;
} VibratoLfo;
- struct {
- ALint DelayTime;
- ALint AttackTime;
- ALint HoldTime;
- ALint DecayTime;
- ALint SustainVol;
- ALint ReleaseTime;
- ALint KeyToHoldTime;
- ALint KeyToDecayTime;
- } ModEnv;
- struct {
- ALint DelayTime;
- ALint AttackTime;
- ALint HoldTime;
- ALint DecayTime;
- ALint SustainVol;
- ALint ReleaseTime;
- ALint KeyToHoldTime;
- ALint KeyToDecayTime;
- } VolEnv;
+ ALenvelope ModEnv;
+ ALenvelope VolEnv;
ALint Attenuation;
diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c
index 3adb5783..cfe38ee7 100644
--- a/OpenAL32/alFontsound.c
+++ b/OpenAL32/alFontsound.c
@@ -328,7 +328,7 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val
values[0] = sound->ModEnv.DecayTime;
break;
case AL_MOD_ENV_SUSTAINVOLUME_SOFT:
- values[0] = sound->ModEnv.SustainVol;
+ values[0] = sound->ModEnv.SustainAttn;
break;
case AL_MOD_ENV_RELEASETIME_SOFT:
values[0] = sound->ModEnv.ReleaseTime;
@@ -353,7 +353,7 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val
values[0] = sound->VolEnv.DecayTime;
break;
case AL_VOLUME_ENV_SUSTAINVOLUME_SOFT:
- values[0] = sound->VolEnv.SustainVol;
+ values[0] = sound->VolEnv.SustainAttn;
break;
case AL_VOLUME_ENV_RELEASETIME_SOFT:
values[0] = sound->VolEnv.ReleaseTime;
@@ -540,7 +540,7 @@ static void ALfontsound_Construct(ALfontsound *self)
self->ModEnv.AttackTime = -12000;
self->ModEnv.HoldTime = -12000;
self->ModEnv.DecayTime = -12000;
- self->ModEnv.SustainVol = 0;
+ self->ModEnv.SustainAttn = 0;
self->ModEnv.ReleaseTime = -12000;
self->ModEnv.KeyToHoldTime = 0;
self->ModEnv.KeyToDecayTime = 0;
@@ -549,7 +549,7 @@ static void ALfontsound_Construct(ALfontsound *self)
self->VolEnv.AttackTime = -12000;
self->VolEnv.HoldTime = -12000;
self->VolEnv.DecayTime = -12000;
- self->VolEnv.SustainVol = 0;
+ self->VolEnv.SustainAttn = 0;
self->VolEnv.ReleaseTime = -12000;
self->VolEnv.KeyToHoldTime = 0;
self->VolEnv.KeyToDecayTime = 0;
@@ -681,7 +681,7 @@ void ALfontsound_setPropi(ALfontsound *self, ALCcontext *context, ALenum param,
self->ModEnv.DecayTime = value;
break;
case AL_MOD_ENV_SUSTAINVOLUME_SOFT:
- self->ModEnv.SustainVol = value;
+ self->ModEnv.SustainAttn = value;
break;
case AL_MOD_ENV_RELEASETIME_SOFT:
self->ModEnv.ReleaseTime = value;
@@ -706,7 +706,7 @@ void ALfontsound_setPropi(ALfontsound *self, ALCcontext *context, ALenum param,
self->VolEnv.DecayTime = value;
break;
case AL_VOLUME_ENV_SUSTAINVOLUME_SOFT:
- self->VolEnv.SustainVol = value;
+ self->VolEnv.SustainAttn = value;
break;
case AL_VOLUME_ENV_RELEASETIME_SOFT:
self->VolEnv.ReleaseTime = value;