diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2022-07-27 01:27:01 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-27 00:27:01 +0200 |
| commit | b9e9e029778e3feb63bfab47157e46496cbcbafa (patch) | |
| tree | 01ca3fae69168e7dcd579a250ae90321965370f3 /include/aomusicplayer.h | |
| parent | f8c2b1a2f06d2c2f99fa9eaa7b2334524823aac5 (diff) | |
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>
Diffstat (limited to 'include/aomusicplayer.h')
| -rw-r--r-- | include/aomusicplayer.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 037525fc..35bd7844 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<QString> music_watcher; |
