aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-05-23 19:18:35 +0200
committersD <stoned@derpymail.org>2020-05-23 19:18:35 +0200
commit8a4fc4516c406a2fa63039310914c6a5514e7c04 (patch)
treef5e4f29646ef0dfb9963aef722af8edffa8997b6 /include
parentf0a0ecb983a5e160adaefca139f0fe034cb11062 (diff)
fix qt music player
Diffstat (limited to 'include')
-rw-r--r--include/aomusicplayer.h54
1 files changed, 7 insertions, 47 deletions
diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h
index f08b7d21..de673e5e 100644
--- a/include/aomusicplayer.h
+++ b/include/aomusicplayer.h
@@ -8,13 +8,13 @@
#elif defined(QTAUDIO)
#include <QMediaPlayer>
#endif
+
#include "aoapplication.h"
#include <QDebug>
#include <QWidget>
#include <string.h>
-#if defined(BASSAUDIO)
class AOMusicPlayer {
public:
AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app);
@@ -25,8 +25,8 @@ public:
const int m_channelmax = 4;
// These have to be public for the stupid sync thing
- QWORD loop_start = 0;
- QWORD loop_end = 0;
+ int loop_start = 0;
+ int loop_end = 0;
public slots:
void play(QString p_song, int channel = 0, bool loop = false,
@@ -44,52 +44,12 @@ private:
// Channel 1 = ambience
// Channel 2 = extra
// Channel 3 = extra
+ #if defined(BASSAUDIO)
HSTREAM m_stream_list[4];
HSYNC loop_sync[4];
+ #elif defined(QTAUDIO)
+ QMediaPlayer m_stream_list[4];
+ #endif
};
-#elif defined(QTAUDIO)
-class AOMusicPlayer {
-public:
- AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app);
- ~AOMusicPlayer();
-
- void play(QString p_song);
- void set_volume(int p_value);
-
-private:
- QMediaPlayer m_player;
- QWidget *m_parent;
- AOApplication *ao_app;
-
- int m_volume = 0;
-};
-#else
-class AOMusicPlayer {
-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);
-
- const int m_channelmax = 4;
-
-public slots:
- void play(QString p_song, int channel = 0, bool loop = false,
- int effect_flags = 0);
- void stop(int channel = 0);
-
-private:
- QWidget *m_parent;
- AOApplication *ao_app;
-
- bool m_looping = false;
- int m_volume[4] = {0, 0, 0, 0};
-
- // Channel 0 = music
- // Channel 1 = ambience
- // Channel 2 = extra
- // Channel 3 = extra
-};
-#endif
#endif // AOMUSICPLAYER_H