diff options
Diffstat (limited to 'include/aosfxplayer.h')
| -rw-r--r-- | include/aosfxplayer.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 39bea0d4..5b4d2ece 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -1,7 +1,12 @@ #ifndef AOSFXPLAYER_H #define AOSFXPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include <QSoundEffect> +#endif + #include "aoapplication.h" #include <QWidget> @@ -17,15 +22,22 @@ public: void play(QString p_sfx, QString p_char = "", QString shout = ""); void stop(); - void set_volume(int p_volume); + void set_volume(qreal p_volume); void setLooping(bool is_looping); + private: QWidget *m_parent; AOApplication *ao_app; - - int m_volume = 0; + qreal m_volume = 0; bool looping_sfx = false; + + void set_volume_internal(qreal p_volume); + + #if defined(BASSAUDIO) HSTREAM m_stream; + #elif defined(QTAUDIO) + QSoundEffect m_sfx; + #endif }; #endif // AOSFXPLAYER_H |
