mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
SoundPlayer: Optionally allow playback to loop indefinitely
This commit is contained in:
parent
75dec15b43
commit
90a30f694d
3 changed files with 19 additions and 1 deletions
|
@ -73,6 +73,11 @@ void PlaybackManager::play()
|
|||
set_paused(false);
|
||||
}
|
||||
|
||||
void PlaybackManager::loop(bool loop)
|
||||
{
|
||||
m_loop = loop;
|
||||
}
|
||||
|
||||
void PlaybackManager::seek(const int position)
|
||||
{
|
||||
if (!m_loader)
|
||||
|
@ -166,7 +171,10 @@ void PlaybackManager::next_buffer()
|
|||
if (!m_next_buffer) {
|
||||
if (!m_connection->get_remaining_samples() && !m_paused) {
|
||||
dbgln("Exhausted samples :^)");
|
||||
stop();
|
||||
if (m_loop)
|
||||
seek(0);
|
||||
else
|
||||
stop();
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue