aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/aosfxplayer.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h
index 30cbe9d..5b82534 100644
--- a/include/aosfxplayer.h
+++ b/include/aosfxplayer.h
@@ -1,13 +1,19 @@
#ifndef AOSFXPLAYER_H
#define AOSFXPLAYER_H
+#if defined(BASSAUDIO)
#include "bass.h"
+#elif defined(QTAUDIO)
+#include <QSoundEffect>
+#endif
+
#include "aoapplication.h"
#include <QWidget>
#include <string.h>
#include <QDebug>
+#if defined(BASSAUDIO)
class AOSfxPlayer
{
public:
@@ -24,5 +30,39 @@ private:
int m_volume = 0;
HSTREAM m_stream;
};
+#elif defined(QTAUDIO)
+class AOSfxPlayer
+{
+public:
+ AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
+
+ void play(QString p_sfx, QString p_char = "", QString shout = "");
+ void stop();
+ void set_volume(int p_volume);
+
+private:
+ QSoundEffect m_sfx;
+ QWidget *m_parent;
+ AOApplication *ao_app;
+
+ int m_volume = 0;
+};
+#else
+class AOSfxPlayer
+{
+public:
+ AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
+
+ void play(QString p_sfx, QString p_char = "", QString shout = "");
+ void stop();
+ void set_volume(int p_volume);
+
+private:
+ QWidget *m_parent;
+ AOApplication *ao_app;
+
+ int m_volume = 0;
+};
+#endif
#endif // AOSFXPLAYER_H