From 8a23f1004027d3f3de9d97e55e9a97fd73f3eb74 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 12 Mar 2019 00:27:22 +0100 Subject: gcc didn't like that --- include/aoapplication.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 44aef7a..6c8039c 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -94,9 +94,9 @@ public: //////////////////versioning/////////////// - constexpr int get_release() const { return RELEASE; } - constexpr int get_major_version() const { return MAJOR_VERSION; } - constexpr int get_minor_version() const { return MINOR_VERSION; } + const int get_release() const { return RELEASE; } + const int get_major_version() const { return MAJOR_VERSION; } + const int get_minor_version() const { return MINOR_VERSION; } QString get_version_string(); /////////////////////////////////////////// -- cgit 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') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index aebba77..2bbe718 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 71da60b5d6f77629b73fd232f97bed2ecaefb4c3 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 12 Mar 2019 20:14:54 +0100 Subject: sfx tested and works --- include/aosfxplayer.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'include') 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 +#endif + #include "aoapplication.h" #include #include #include +#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 -- cgit From 1514ffea6ad747fc93f98752abb8f82acc9dc9bd Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 12 Mar 2019 20:47:47 +0100 Subject: qt music --- include/aomusicplayer.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 560a7f9..b34267c 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -1,13 +1,18 @@ #ifndef AOMUSICPLAYER_H #define AOMUSICPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include +#endif #include "aoapplication.h" #include #include #include +#if defined(BASSAUDIO) class AOMusicPlayer { public: @@ -24,5 +29,37 @@ private: int m_volume = 0; HSTREAM m_stream; }; +#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); + ~AOMusicPlayer(); + + void play(QString p_song); + void set_volume(int p_value); + +private: + QWidget *m_parent; + AOApplication *ao_app; +}; +#endif #endif // AOMUSICPLAYER_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 ++++------------------------------------ include/aosfxplayer.h | 38 +++----------------------------------- 2 files changed, 7 insertions(+), 71 deletions(-) (limited to 'include') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 2bbe718..102a040 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 diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 5b82534..4b97685 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -13,7 +13,6 @@ #include #include -#if defined(BASSAUDIO) class AOSfxPlayer { public: @@ -26,43 +25,12 @@ public: private: QWidget *m_parent; AOApplication *ao_app; - - int m_volume = 0; + #if defined(BASSAUDIO) 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: + #elif defined(QTAUDIO) QSoundEffect m_sfx; - QWidget *m_parent; - AOApplication *ao_app; - + #endif 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 -- cgit