diff options
-rw-r--r-- | Alc/midi/base.c | 1 | ||||
-rw-r--r-- | Alc/midi/fluidsynth.c | 2 | ||||
-rw-r--r-- | Alc/midi/sf2load.c | 9 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 3 | ||||
-rw-r--r-- | OpenAL32/Include/alMidi.h | 1 | ||||
-rw-r--r-- | OpenAL32/alFontsound.c | 12 |
6 files changed, 24 insertions, 4 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c index 8b498680..470157e1 100644 --- a/Alc/midi/base.c +++ b/Alc/midi/base.c @@ -300,6 +300,7 @@ void ALfontsound_Construct(ALfontsound *self) self->LoopStart = 0; self->LoopEnd = 0; self->SampleRate = 0; + self->LoopMode = AL_NONE; self->PitchKey = 0; self->PitchCorrection = 0; self->SampleType = AL_NONE; diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c index 24937192..5b57de21 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -163,7 +163,7 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan if(voice == NULL) return FLUID_FAILED; - //fluid_voice_gen_set(voice, ); + fluid_voice_gen_set(voice, 54, sound->LoopMode); for(m = 0;m < sample->NumMods;m++) fluid_voice_add_mod(voice, &sample->Mods[m], FLUID_VOICE_OVERWRITE); diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c index 52ce931c..0c276d71 100644 --- a/Alc/midi/sf2load.c +++ b/Alc/midi/sf2load.c @@ -828,7 +828,7 @@ static void fillZone(ALuint id, const GenModList *zone) 0, /* 51 - corseTune */ 0, /* 52 - fineTune */ 0, /* 53 - */ - 0, /* 54 - sampleModes */ + AL_LOOP_MODE_SOFT, /* 54 - sampleModes */ 0, /* 55 - */ 0, /* 56 - scaleTuning */ 0, /* 57 - exclusiveClass */ @@ -872,9 +872,12 @@ static void fillZone(ALuint id, const GenModList *zone) param = Gen2Param[gen->mGenerator]; if(param) { - if(param == AL_BASE_KEY_SOFT && gen->mAmount == 0xffff) + ALint value = (ALshort)gen->mAmount; + if(param == AL_BASE_KEY_SOFT && value == -1) break; - alFontsoundiSOFT(id, param, (ALshort)gen->mAmount); + if(param == AL_LOOP_MODE_SOFT && value == 2) + value = 0; + alFontsoundiSOFT(id, param, value); } else if(gen->mGenerator < 256) { diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7b1b92dd..0cc06df3 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -50,6 +50,9 @@ #define AL_FONTSOUND_LINK_SOFT 0x2008 #define AL_KEY_RANGE_SOFT 0x002B #define AL_VELOCITY_RANGE_SOFT 0x002C +#define AL_LOOP_MODE_SOFT 0x0036 +#define AL_LOOP_CONTINUOUS_SOFT 0x0001 +#define AL_LOOP_UNTIL_RELEASE_SOFT 0x0003 #define AL_FORMAT_TYPE_SOFT 0x1991 #define AL_NOTEOFF_SOFT 0x0080 #define AL_NOTEON_SOFT 0x0090 diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h index acbc81b5..44d05c1a 100644 --- a/OpenAL32/Include/alMidi.h +++ b/OpenAL32/Include/alMidi.h @@ -28,6 +28,7 @@ typedef struct ALfontsound { ALuint LoopStart; ALuint LoopEnd; ALuint SampleRate; + ALenum LoopMode; ALubyte PitchKey; ALbyte PitchCorrection; ALenum SampleType; diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c index 663b1290..36f34570 100644 --- a/OpenAL32/alFontsound.c +++ b/OpenAL32/alFontsound.c @@ -152,6 +152,13 @@ AL_API void AL_APIENTRY alFontsoundiSOFT(ALuint id, ALenum param, ALint value) sound->SampleRate = value; break; + case AL_LOOP_MODE_SOFT: + if(!(value == AL_NONE || value == AL_LOOP_CONTINUOUS_SOFT || + value == AL_LOOP_UNTIL_RELEASE_SOFT)) + SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); + sound->LoopMode = value; + break; + case AL_BASE_KEY_SOFT: if(!((value >= 0 && value <= 127) || value == 255)) SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); @@ -248,6 +255,7 @@ AL_API void AL_APIENTRY alFontsoundivSOFT(ALuint id, ALenum param, const ALint * case AL_SAMPLE_LOOP_START_SOFT: case AL_SAMPLE_LOOP_END_SOFT: case AL_SAMPLE_RATE_SOFT: + case AL_LOOP_MODE_SOFT: case AL_BASE_KEY_SOFT: case AL_KEY_CORRECTION_SOFT: case AL_SAMPLE_TYPE_SOFT: @@ -318,6 +326,10 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val values[0] = sound->SampleRate; break; + case AL_LOOP_MODE_SOFT: + values[0] = sound->LoopMode; + break; + case AL_BASE_KEY_SOFT: values[0] = sound->PitchKey; break; |