mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
Add fluid_synth_all_notes_off and fluid_synth_all_sounds_off as public API functions
This commit is contained in:
parent
f75ed6243b
commit
b05e61fedf
2 changed files with 20 additions and 7 deletions
|
@ -99,6 +99,8 @@ FLUIDSYNTH_API int fluid_synth_get_channel_info (fluid_synth_t *synth, int chan,
|
|||
FLUIDSYNTH_API int fluid_synth_program_reset(fluid_synth_t* synth);
|
||||
FLUIDSYNTH_API int fluid_synth_system_reset(fluid_synth_t* synth);
|
||||
|
||||
FLUIDSYNTH_API int fluid_synth_all_notes_off(fluid_synth_t* synth, int chan);
|
||||
FLUIDSYNTH_API int fluid_synth_all_sounds_off(fluid_synth_t* synth, int chan);
|
||||
|
||||
enum fluid_midi_channel_type
|
||||
{
|
||||
|
|
|
@ -1459,14 +1459,21 @@ fluid_synth_sysex_midi_tuning (fluid_synth_t *synth, const char *data, int len,
|
|||
* @param synth FluidSynth instance
|
||||
* @param chan MIDI channel number (0 to MIDI channel count - 1), (chan=-1 selects all channels)
|
||||
* @return FLUID_OK on success, FLUID_FAILED otherwise
|
||||
* @since 1.1.4
|
||||
*/
|
||||
int
|
||||
fluid_synth_all_notes_off(fluid_synth_t* synth, int chan)
|
||||
{
|
||||
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
|
||||
fluid_return_val_if_fail (chan >= -1 && chan < synth->midi_channels, FLUID_FAILED);
|
||||
int result;
|
||||
|
||||
return fluid_synth_all_notes_off_LOCAL (synth, chan);
|
||||
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
|
||||
fluid_return_val_if_fail (chan >= -1, FLUID_FAILED);
|
||||
fluid_synth_api_enter(synth);
|
||||
if (chan >= synth->midi_channels)
|
||||
result = FLUID_FAILED;
|
||||
else
|
||||
result = fluid_synth_all_notes_off_LOCAL (synth, chan);
|
||||
FLUID_API_RETURN(result);
|
||||
}
|
||||
|
||||
/* Local synthesis thread variant of all notes off, (chan=-1 selects all channels) */
|
||||
|
@ -1490,16 +1497,20 @@ fluid_synth_all_notes_off_LOCAL(fluid_synth_t* synth, int chan)
|
|||
* @param synth FluidSynth instance
|
||||
* @param chan MIDI channel number (0 to MIDI channel count - 1), (chan=-1 selects all channels)
|
||||
* @return FLUID_OK on success, FLUID_FAILED otherwise
|
||||
* @since 1.1.4
|
||||
*/
|
||||
int
|
||||
fluid_synth_all_sounds_off(fluid_synth_t* synth, int chan)
|
||||
{
|
||||
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
|
||||
fluid_return_val_if_fail (chan >= -1 && chan < synth->midi_channels, FLUID_FAILED);
|
||||
int result;
|
||||
FLUID_API_ENTRY_CHAN(FLUID_FAILED);
|
||||
|
||||
result = fluid_synth_all_sounds_off_LOCAL (synth, chan);
|
||||
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
|
||||
fluid_return_val_if_fail (chan >= -1, FLUID_FAILED);
|
||||
fluid_synth_api_enter(synth);
|
||||
if (chan >= synth->midi_channels)
|
||||
result = FLUID_FAILED;
|
||||
else
|
||||
result = fluid_synth_all_sounds_off_LOCAL (synth, chan);
|
||||
FLUID_API_RETURN(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue