From 0b6f376f8f635bfcfd72f621a1077a35efc72342 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 12 Mar 2019 19:53:06 +0100 Subject: qt can play the blips just fine --- include/aoblipplayer.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'include/aoblipplayer.h') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index aebba77d..2bbe7187 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -1,13 +1,19 @@ #ifndef AOBLIPPLAYER_H #define AOBLIPPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include +#endif + #include "aoapplication.h" #include #include #include +#if defined(BASSAUDIO) class AOBlipPlayer { public: @@ -26,5 +32,41 @@ private: int m_volume; HSTREAM m_stream_list[5]; }; +#elif defined(QTAUDIO) +class AOBlipPlayer +{ +public: + AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); + + void set_blips(QString p_sfx); + void blip_tick(); + void set_volume(int p_volume); + + int m_cycle = 0; + +private: + QSoundEffect m_blips; + QWidget *m_parent; + AOApplication *ao_app; + + int m_volume; + //HSTREAM m_stream_list[5]; +}; +#else +class AOBlipPlayer +{ +public: + AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); + + void set_blips(QString p_sfx); + void blip_tick(); + void set_volume(int p_volume); + +private: + QWidget *m_parent; + AOApplication *ao_app; +}; +#endif + #endif // AOBLIPPLAYER_H -- cgit From 1504aaf6b2df422405b2cc6bd6e4f79de36e53c4 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 13 Mar 2019 13:05:10 +0100 Subject: saves space i guess --- include/aoblipplayer.h | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'include/aoblipplayer.h') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 2bbe7187..102a0408 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -13,7 +13,7 @@ #include #include -#if defined(BASSAUDIO) + class AOBlipPlayer { public: @@ -30,43 +30,11 @@ private: AOApplication *ao_app; int m_volume; + #if defined(BASSAUDIO) HSTREAM m_stream_list[5]; -}; -#elif defined(QTAUDIO) -class AOBlipPlayer -{ -public: - AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); - - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(int p_volume); - - int m_cycle = 0; - -private: + #elif defined(QTAUDIO) QSoundEffect m_blips; - QWidget *m_parent; - AOApplication *ao_app; - - int m_volume; - //HSTREAM m_stream_list[5]; + #endif }; -#else -class AOBlipPlayer -{ -public: - AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); - - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(int p_volume); - -private: - QWidget *m_parent; - AOApplication *ao_app; -}; -#endif - #endif // AOBLIPPLAYER_H -- cgit From 4700902551f80769b54cb452b0fcb794669c553b Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sat, 17 Aug 2019 20:47:41 +0200 Subject: fix qaudio volume --- include/aoblipplayer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/aoblipplayer.h') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 102a0408..68dca191 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -21,15 +21,16 @@ public: void set_blips(QString p_sfx); void blip_tick(); - void set_volume(int p_volume); + void set_volume(qreal p_volume); + void set_volume_internal(qreal p_volume); int m_cycle = 0; private: QWidget *m_parent; AOApplication *ao_app; + qreal m_volume; - int m_volume; #if defined(BASSAUDIO) HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) -- cgit From 49be444d74cfdecdaa1090a2a51c19f70ae9b0b1 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sat, 17 Aug 2019 21:09:13 +0200 Subject: OOP :convenience_store: --- include/aoblipplayer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/aoblipplayer.h') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 68dca191..44ca48bb 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -22,7 +22,6 @@ public: void set_blips(QString p_sfx); void blip_tick(); void set_volume(qreal p_volume); - void set_volume_internal(qreal p_volume); int m_cycle = 0; @@ -31,6 +30,8 @@ private: AOApplication *ao_app; qreal m_volume; + void set_volume_internal(qreal p_volume); + #if defined(BASSAUDIO) HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) -- cgit