From c9f52b7223685d2e7fca925594171f94dd8c6e3b Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Wed, 15 May 2024 00:00:17 +0200 Subject: Ported to CMake, ... * Ported the project to CMake * Android and Mac support dropped for the time being. * Tests, BASS and Discord-RPC are now options * Restructured and reformated the project. * Merged `include` and `src` * Renamed `resource` to `data` * Renamed various files * External libraries headers are no longer included in `src` * Replaced header guards with #pragma once * Multiple refactors (keywords, headers) * Added Qt6 compatibility * Removed various unused functions and headers * Reworked AOPacket * When content is passed to AOPacket, it should be ensured that the content is already decoded. * Encoding/decoding are now static methods. * Fixed various memory leaks * Removed animation code for AOImage * AOImage is always using static images * Simplified ChatLogPiece --- src/aoblipplayer.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/aoblipplayer.h (limited to 'src/aoblipplayer.h') diff --git a/src/aoblipplayer.h b/src/aoblipplayer.h new file mode 100644 index 00000000..bc878b80 --- /dev/null +++ b/src/aoblipplayer.h @@ -0,0 +1,31 @@ +#pragma once + +#include "bass.h" +#include "bassopus.h" + +#include "aoapplication.h" + +#include +#include +#include +#include + +class AOBlipPlayer +{ +public: + AOBlipPlayer(AOApplication *p_ao_app); + + void set_blips(QString p_sfx); + void blip_tick(); + void set_volume(int p_volume); + void set_muted(bool toggle); + +private: + AOApplication *ao_app; + qreal m_volume = 0.0; + int m_cycle = 0; + bool m_muted = false; + HSTREAM m_stream_list[5]; + + void set_volume_internal(qreal p_volume); +}; -- cgit From 1ef96383c8f7ed136a0e028aef0835b4838b5e95 Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Fri, 17 May 2024 16:39:30 +0200 Subject: Lightly reworked `NetworkManager`, ... * Lightly reworked `NetworkManager` * Added new modules to handle various connection types. * TCP * WebSocket * Added general string splitter alias based on Qt version. * Replaced `lobby_constructed` and `courtroom_constructed` * Refactored and partially reimplemented the following classes: * `AOBlipPlayer` * `AOEmotePreview` * `AOMusicPlayer` * `AOSfxPlayer` * `AOTextArea` --- src/aoblipplayer.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/aoblipplayer.h') diff --git a/src/aoblipplayer.h b/src/aoblipplayer.h index bc878b80..c33e08b3 100644 --- a/src/aoblipplayer.h +++ b/src/aoblipplayer.h @@ -13,19 +13,24 @@ class AOBlipPlayer { public: - AOBlipPlayer(AOApplication *p_ao_app); + static constexpr int STREAM_COUNT = 5; - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(int p_volume); - void set_muted(bool toggle); + AOBlipPlayer(AOApplication *ao_app); + + void setVolume(int value); + void setMuted(bool enabled); + + void setBlip(QString blip); + + void playBlip(); private: AOApplication *ao_app; - qreal m_volume = 0.0; - int m_cycle = 0; + + int m_volume = 0; bool m_muted = false; - HSTREAM m_stream_list[5]; + HSTREAM m_stream[STREAM_COUNT]{}; + int m_cycle = 0; - void set_volume_internal(qreal p_volume); + void updateInternalVolume(); }; -- cgit From 0500a5426013e97b80cae1de0b19a117cc1bbaa7 Mon Sep 17 00:00:00 2001 From: TrickyLeifa Date: Fri, 17 May 2024 20:36:36 +0200 Subject: Changed include definitions to reflect third-party stature --- src/aoblipplayer.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/aoblipplayer.h') diff --git a/src/aoblipplayer.h b/src/aoblipplayer.h index c33e08b3..92b43d29 100644 --- a/src/aoblipplayer.h +++ b/src/aoblipplayer.h @@ -1,13 +1,14 @@ #pragma once -#include "bass.h" -#include "bassopus.h" - #include "aoapplication.h" +#include +#include + #include #include #include + #include class AOBlipPlayer -- cgit