diff options
Diffstat (limited to 'include/aosfxplayer.h')
| -rw-r--r-- | include/aosfxplayer.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index af3aef6d..99188719 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -3,6 +3,7 @@ #if defined(BASSAUDIO) #include "bass.h" +#include "bassopus.h" #elif defined(QTAUDIO) #include <QSoundEffect> #endif @@ -10,32 +11,36 @@ #include "aoapplication.h" #include <QDebug> -#include <QTimer> #include <QWidget> #include <string.h> -class AOSfxPlayer : public QObject { - Q_OBJECT +class AOSfxPlayer { public: AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); - void play(QString p_sfx, QString p_char = "", QString shout = ""); - void stop(); + void clear(); + void loop_clear(); + void play(QString p_sfx, QString p_char = "", QString shout = "", + int channel = -1); + void stop(int channel = -1); void set_volume(qreal p_volume); - void setLooping(bool is_looping); + void set_looping(bool toggle, int channel = -1); + int m_channel = 0; private: QWidget *m_parent; AOApplication *ao_app; qreal m_volume = 0; - bool looping_sfx = false; + bool m_looping = true; void set_volume_internal(qreal p_volume); + const int m_channelmax = 5; + #if defined(BASSAUDIO) - HSTREAM m_stream; + HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) - QSoundEffect m_sfx; + QSoundEffect m_stream_list[5]; #endif }; |
