summaryrefslogtreecommitdiffstats
path: root/OpenAL32
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 /OpenAL32
parente118ac93a01c15adee8e6d81a99dda73a985c54d (diff)
Use a proper struct for envelope properties
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMidi.h33
-rw-r--r--OpenAL32/alFontsound.c12
2 files changed, 19 insertions, 26 deletions
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;