mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 09:32:02 +00:00
Rewind playlist if calling fluid_player_play after all loops complete (#994)
This commit is contained in:
parent
de05ef2a1c
commit
a3dd7fddcb
1 changed files with 10 additions and 0 deletions
|
@ -2200,6 +2200,9 @@ fluid_player_callback(void *data, unsigned int msec)
|
|||
* Activates play mode for a MIDI player if not already playing.
|
||||
* @param player MIDI player instance
|
||||
* @return #FLUID_OK on success, #FLUID_FAILED otherwise
|
||||
*
|
||||
* If the list of files added to the player has completed its requested number of loops,
|
||||
* the playlist will be restarted from the beginning with a loop count of 1.
|
||||
*/
|
||||
int
|
||||
fluid_player_play(fluid_player_t *player)
|
||||
|
@ -2215,10 +2218,17 @@ fluid_player_play(fluid_player_t *player)
|
|||
fluid_sample_timer_reset(player->synth, player->sample_timer);
|
||||
}
|
||||
|
||||
/* If we're at the end of the playlist and there are no loops left, loop once */
|
||||
if(player->currentfile == NULL && player->loop == 0)
|
||||
{
|
||||
player->loop = 1;
|
||||
}
|
||||
|
||||
fluid_atomic_int_set(&player->status, FLUID_PLAYER_PLAYING);
|
||||
|
||||
return FLUID_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pauses the MIDI playback.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue