diff options
author | XANTRONIX Development | 2022-03-06 20:10:57 -0500 |
---|---|---|
committer | XANTRONIX Development | 2022-03-06 20:11:36 -0500 |
commit | d408944a8c0ce626ff35c80b6b6e5fb2f7dc1fb9 (patch) | |
tree | 1fc02aeaae49af28cdc7a578ba76e51183ab7f31 /src | |
parent | b1be8446edf9c4951f4fee321565f7af21ff4a8c (diff) | |
download | xas-d408944a8c0ce626ff35c80b6b6e5fb2f7dc1fb9.tar.gz xas-d408944a8c0ce626ff35c80b6b6e5fb2f7dc1fb9.tar.bz2 xas-d408944a8c0ce626ff35c80b6b6e5fb2f7dc1fb9.zip |
Implement xas_bank_player_set_flags()
Implement xas_bank_player_set_flags() to allow setting certain
playback flags, such as, XAS_BANK_PLAYER_LOOP
Diffstat (limited to 'src')
-rw-r--r-- | src/bank.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -140,6 +140,7 @@ xas_bank_player *xas_bank_player_new(xas_bank *bank) { player->bank = bank; player->status = XAS_BANK_PLAYER_STOPPED; player->gain = XAS_BANK_PLAYER_DEFAULT_GAIN; + player->flags = XAS_BANK_PLAYER_NONE; player->entry = 0; player->index = 0; @@ -195,6 +196,12 @@ int xas_bank_player_stop(xas_bank_player *player) { return 0; } +int xas_bank_player_set_flags(xas_bank_player *player, int flags) { + player->flags = flags; + + return 0; +} + int xas_bank_player_playing(xas_bank_player *player) { return player->status == XAS_BANK_PLAYER_PLAYING; } @@ -229,7 +236,11 @@ static ssize_t stream_fill(xas_bank_player *player, index_o += amount; if (player->index == entry->duration) { - xas_bank_player_stop(player); + if (player->flags & XAS_BANK_PLAYER_LOOP) { + player->index = 0; + } else { + xas_bank_player_stop(player); + } } } else { xas_audio_zero(bank->format, dest, index_o, left); |