From b9e9e029778e3feb63bfab47157e46496cbcbafa Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 27 Jul 2022 01:27:01 +0300 Subject: Fix an extremely rare issue where loop point goes outside track bounds if loop end is not defined (#748) * Fix an incredibly edge-case loop end issue where the loop end is outside track boundaries somehow * WIP-AB Cleanup and incorrect loop bugfix Cleanup AB-Loop code * Someone has to check if AB loop works properly still cause I have no idea how this shit works and the code prior was unreadable. Don't blame me, blame whoever left this code undocumented like the hag they are. * Increase max-sample we can accept in the AB loop Also change conversion to UInt. If someone adds a bad value, it will just return 0, which I guess is fair. Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com> --- include/aomusicplayer.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 037525f..35bd784 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -19,14 +19,21 @@ public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); virtual ~AOMusicPlayer(); void set_volume(int p_value, int channel = -1); - void set_looping(bool toggle, int channel = 0); + void set_looping(bool loop_song, int channel = 0); void set_muted(bool toggle); const int m_channelmax = 4; // These have to be public for the stupid sync thing - int loop_start[4] = {0, 0, 0, 0}; - int loop_end[4] = {0, 0, 0, 0}; + /** + * @brief The starting sample of the AB-Loop. + */ + unsigned int loop_start[4] = {0, 0, 0, 0}; + + /** + * @brief The end sample of the AB-Loop. + */ + unsigned int loop_end[4] = {0, 0, 0, 0}; QFutureWatcher music_watcher; -- cgit