mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-11 21:31:18 +00:00
Only send all_notes_off when stopping player (#934)
This commit is contained in:
parent
e096919477
commit
be79856caa
2 changed files with 17 additions and 10 deletions
|
@ -1651,6 +1651,7 @@ new_fluid_player(fluid_synth_t *synth)
|
||||||
}
|
}
|
||||||
|
|
||||||
fluid_atomic_int_set(&player->status, FLUID_PLAYER_READY);
|
fluid_atomic_int_set(&player->status, FLUID_PLAYER_READY);
|
||||||
|
fluid_atomic_int_set(&player->stopping, 0);
|
||||||
player->loop = 1;
|
player->loop = 1;
|
||||||
player->ntracks = 0;
|
player->ntracks = 0;
|
||||||
|
|
||||||
|
@ -2087,8 +2088,12 @@ fluid_player_callback(void *data, unsigned int msec)
|
||||||
loadnextfile = player->currentfile == NULL ? 1 : 0;
|
loadnextfile = player->currentfile == NULL ? 1 : 0;
|
||||||
|
|
||||||
if(fluid_player_get_status(player) != FLUID_PLAYER_PLAYING)
|
if(fluid_player_get_status(player) != FLUID_PLAYER_PLAYING)
|
||||||
|
{
|
||||||
|
if(fluid_atomic_int_get(&player->stopping))
|
||||||
{
|
{
|
||||||
fluid_synth_all_notes_off(synth, -1);
|
fluid_synth_all_notes_off(synth, -1);
|
||||||
|
fluid_atomic_int_set(&player->stopping, 0);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
|
@ -2198,6 +2203,7 @@ int
|
||||||
fluid_player_stop(fluid_player_t *player)
|
fluid_player_stop(fluid_player_t *player)
|
||||||
{
|
{
|
||||||
fluid_atomic_int_set(&player->status, FLUID_PLAYER_DONE);
|
fluid_atomic_int_set(&player->status, FLUID_PLAYER_DONE);
|
||||||
|
fluid_atomic_int_set(&player->stopping, 1);
|
||||||
fluid_player_seek(player, fluid_player_get_current_tick(player));
|
fluid_player_seek(player, fluid_player_get_current_tick(player));
|
||||||
return FLUID_OK;
|
return FLUID_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,6 +285,7 @@ typedef struct
|
||||||
struct _fluid_player_t
|
struct _fluid_player_t
|
||||||
{
|
{
|
||||||
fluid_atomic_int_t status;
|
fluid_atomic_int_t status;
|
||||||
|
fluid_atomic_int_t stopping; /* Flag for sending all_notes_off when player is stopped */
|
||||||
int ntracks;
|
int ntracks;
|
||||||
fluid_track_t *track[MAX_NUMBER_OF_TRACKS];
|
fluid_track_t *track[MAX_NUMBER_OF_TRACKS];
|
||||||
fluid_synth_t *synth;
|
fluid_synth_t *synth;
|
||||||
|
|
Loading…
Reference in a new issue