aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSalanto <62221668+Salanto@users.noreply.github.com>2022-08-05 15:43:16 +0200
committerGitHub <noreply@github.com>2022-08-05 16:43:16 +0300
commit4a2f19433d555ba642ce59f87e8487d986699d1e (patch)
treeac375223350cd6e3667ddff8b7b6b20792226892 /src
parent90ff911376b0fbebce34dbf9eb3ce9b542292cd2 (diff)
Properly enter loop if starting point is 0, i.E undefined. (#844)
* Fix channel 0 being ignored * Allow music to properly loop * Added channel index. Co-authored-by: Leifa♥ <26681464+TrickyLeifa@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/aomusicplayer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp
index 564d9d6a..f29e0cf9 100644
--- a/src/aomusicplayer.cpp
+++ b/src/aomusicplayer.cpp
@@ -219,20 +219,20 @@ void AOMusicPlayer::set_looping(bool loop_song, int channel)
loop_sync[channel] = 0;
}
- if (loop_start[channel] > 0) {
- if (loop_end[channel] > 0 && (loop_end[channel] > loop_start[channel]))
+ if (loop_start[channel] >= 0) {
+ if (loop_start[channel] < loop_end[channel])
{
//Loop when the endpoint is reached.
loop_sync[channel] = BASS_ChannelSetSync(
- m_stream_list[channel], BASS_SYNC_END | BASS_SYNC_MIXTIME,
- loop_end[channel] , loopProc, &loop_start[channel]);
+ m_stream_list[channel], BASS_SYNC_POS | BASS_SYNC_MIXTIME,
+ loop_end[channel], loopProc, &loop_start[channel]);
}
else
{
//Loop when the end of the file is reached.
loop_sync[channel] = BASS_ChannelSetSync(
- m_stream_list[channel], BASS_SYNC_POS | BASS_SYNC_MIXTIME,
- 0 , loopProc, &loop_start[channel]);
+ m_stream_list[channel], BASS_SYNC_END | BASS_SYNC_MIXTIME,
+ 0, loopProc, &loop_start[channel]);
}
}
}