From 73782055237ee8948b26935348e8ca2b8a71a95a Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 10 Sep 2019 21:57:06 +0300 Subject: Expand .apng and .webp support for get_image_suffix Add get_image_suffix for all .gif's so that all animated pieces can be .webp or .apng instead Expand on .webp .apng support and clean up the code somewhat --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 5475eb7b..68e82ce3 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -219,7 +219,7 @@ public: //Figure out if we can opus this or if we should fall back to wav QString get_sfx_suffix(QString sound_to_check); - // Can we use APNG for this? If not, fall back to a gif. + // Can we use APNG for this? If not, WEBP? If not, fall back to gif. QString get_image_suffix(QString path_to_check); //Returns the value of p_search_line within target_tag and terminator_tag -- cgit From 7e2ec58c7eb62077733f354764d0b729fe0e0a93 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 10 Sep 2019 23:26:03 +0300 Subject: Prevent the animated background/foreground from restarting itself if the image is the exact same as the currently playing one --- include/aoscene.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/aoscene.h b/include/aoscene.h index b58c0fd0..ddbefe08 100644 --- a/include/aoscene.h +++ b/include/aoscene.h @@ -21,6 +21,7 @@ private: QWidget *m_parent; QMovie *m_movie; AOApplication *ao_app; + QString last_image; }; -- cgit From 3b415f5a7005fd0b42ba7ccbb9a8836746a72d41 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 15:40:19 +0300 Subject: Expand get_image_suffix to fall back on .png last Reorganize the file_exists checks to be an array iterator instead for much less code duplication and easier ordering of priority Reorganize desk and set_image loading on AOScene class, resolve issues with last_image setting to prevent animations from being restarted when characters talk on the same pos in succession Apply get_image_suffix for seancestand and jurystand searches TODO: At the moment, if you feed a .png shout, it will send the "Done" signal on the first frame (frame 0), not showing you the .png image at all. The shout code should be reorganized to allow static images to be displayed for exactly 720ms - the standard AA objection length. Usage of the timer similarly to the realizationflash.png might be possible. --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 68e82ce3..19924e46 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -219,7 +219,7 @@ public: //Figure out if we can opus this or if we should fall back to wav QString get_sfx_suffix(QString sound_to_check); - // Can we use APNG for this? If not, WEBP? If not, fall back to gif. + // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to PNG. QString get_image_suffix(QString path_to_check); //Returns the value of p_search_line within target_tag and terminator_tag -- cgit From 2a899b14762be4084e4cd65e42918c1f43f5e4da Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 18:28:08 +0300 Subject: Allow AOMovie to have timers that take priority over the animated image frame count Set it up so feeding the timer value when playing the AOMovie would use the timer but only in cases where a non-animated image is used Update shouts and wtce to pass the 'duration' argument which will be used if the image used is non-animated. Otherwise, prioritize the animated image duration. --- include/aomovie.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomovie.h b/include/aomovie.h index 1f278bf8..33b31586 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,13 +15,15 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void play(QString p_gif, QString p_char = "", QString p_custom_theme = ""); + void start_timer(int delay); + void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int duration = 0); void combo_resize(int w, int h); void stop(); private: QMovie *m_movie; AOApplication *ao_app; + QTimer *timer; bool play_once = true; signals: @@ -29,6 +31,7 @@ signals: private slots: void frame_change(int n_frame); + void timer_done(); }; #endif // AOMOVIE_H -- cgit From 932f430b683dffb0b965c32cd2247e2b6361dd0e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:03:42 +0300 Subject: Remove unecessary hard-coded timers for the witness testimony .png Make the witness testimony use AOMovie instead of AOImage Remove pointless "testimony_in_progress" variable CONTROVERSIAL: Make the witness testimony indicator be position-ignorant so as to reduce the amount of hardcoding and allow broader usage of the witness testimony system (For example, Danganronpa investigation indicator, etc.) - This should not affect how the testimony indicator is received currently, as witness testimony usually requires the entire rest of the court to shut up until the cross-examination either way. --- include/courtroom.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index f0b69967..e053e237 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -309,11 +309,6 @@ private: //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) QTimer *realization_timer; - //times how long the blinking testimony should be shown(green one in the corner) - QTimer *testimony_show_timer; - //times how long the blinking testimony should be hidden - QTimer *testimony_hide_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -323,14 +318,6 @@ private: QString previous_ic_message = ""; - bool testimony_in_progress = false; - - //in milliseconds - const int testimony_show_time = 1500; - - //in milliseconds - const int testimony_hide_time = 500; - //char id, muted or not QMap mute_map; @@ -407,8 +394,8 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_testimony; AOImage *ui_vp_realization; + AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; -- cgit From bb98f79083648243216f665852a7d2326af11be0 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:37:44 +0300 Subject: Fix compilation error Allow realization flashes to be animated images by making them AOMovies Eploit the newly added 'duration' system for realization AOMovie --- include/courtroom.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index e053e237..fe870b46 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -306,9 +306,6 @@ private: //delay before sfx plays QTimer *sfx_delay_timer; - //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) - QTimer *realization_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -394,7 +391,7 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_realization; + AOMovie *ui_vp_realization; AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; @@ -538,11 +535,6 @@ public slots: void objection_done(); void preanim_done(); - void realization_done(); - - void show_testimony(); - void hide_testimony(); - void mod_called(QString p_ip); void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); -- cgit From e76a83ddfe8f6fe16ee7e2a91d3ac30e89f80345 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 18:28:08 +0300 Subject: Allow AOMovie to have timers that take priority over the animated image frame count Set it up so feeding the timer value when playing the AOMovie would use the timer but only in cases where a non-animated image is used Update shouts and wtce to pass the 'duration' argument which will be used if the image used is non-animated. Otherwise, prioritize the animated image duration. --- include/aomovie.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomovie.h b/include/aomovie.h index 1f278bf8..33b31586 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,13 +15,15 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void play(QString p_gif, QString p_char = "", QString p_custom_theme = ""); + void start_timer(int delay); + void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int duration = 0); void combo_resize(int w, int h); void stop(); private: QMovie *m_movie; AOApplication *ao_app; + QTimer *timer; bool play_once = true; signals: @@ -29,6 +31,7 @@ signals: private slots: void frame_change(int n_frame); + void timer_done(); }; #endif // AOMOVIE_H -- cgit From 5a31516a36e0f13211db807a48214f11ccef827d Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:03:42 +0300 Subject: Remove unecessary hard-coded timers for the witness testimony .png Make the witness testimony use AOMovie instead of AOImage Remove pointless "testimony_in_progress" variable CONTROVERSIAL: Make the witness testimony indicator be position-ignorant so as to reduce the amount of hardcoding and allow broader usage of the witness testimony system (For example, Danganronpa investigation indicator, etc.) - This should not affect how the testimony indicator is received currently, as witness testimony usually requires the entire rest of the court to shut up until the cross-examination either way. (cherry picked from commit 932f430b683dffb0b965c32cd2247e2b6361dd0e) --- include/courtroom.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index f0b69967..e053e237 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -309,11 +309,6 @@ private: //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) QTimer *realization_timer; - //times how long the blinking testimony should be shown(green one in the corner) - QTimer *testimony_show_timer; - //times how long the blinking testimony should be hidden - QTimer *testimony_hide_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -323,14 +318,6 @@ private: QString previous_ic_message = ""; - bool testimony_in_progress = false; - - //in milliseconds - const int testimony_show_time = 1500; - - //in milliseconds - const int testimony_hide_time = 500; - //char id, muted or not QMap mute_map; @@ -407,8 +394,8 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_testimony; AOImage *ui_vp_realization; + AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; -- cgit From 3b3507df60673079482372b4da08eeabf9317a20 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Sep 2019 19:37:44 +0300 Subject: Fix compilation error Allow realization flashes to be animated images by making them AOMovies Eploit the newly added 'duration' system for realization AOMovie (cherry picked from commit bb98f79083648243216f665852a7d2326af11be0) --- include/courtroom.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index e053e237..fe870b46 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -306,9 +306,6 @@ private: //delay before sfx plays QTimer *sfx_delay_timer; - //keeps track of how long realization is visible(it's just a white square and should be visible less than a second) - QTimer *realization_timer; - //every time point in char.inis times this equals the final time const int time_mod = 40; @@ -394,7 +391,7 @@ private: AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; QTextEdit *ui_vp_message; - AOImage *ui_vp_realization; + AOMovie *ui_vp_realization; AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; @@ -538,11 +535,6 @@ public slots: void objection_done(); void preanim_done(); - void realization_done(); - - void show_testimony(); - void hide_testimony(); - void mod_called(QString p_ip); void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); -- cgit From 8a5bc8632eb69db751ded4d6034e5648208b9212 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 18 Jan 2019 19:08:56 -0800 Subject: Kill Music on Object option (todo: actual functionality, cherrypicked from Goofball's 2.7 branch) --- include/aoapplication.h | 3 +++ include/aooptionsdialog.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 19924e46..94508ff8 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -150,6 +150,9 @@ public: //Returns true if blank blips is enabled in config.ini and false otherwise bool get_blank_blip(); + //Returns true if kill music on object is enabled in the config.ini + bool get_objectmusic(); + //Returns the value of default_music in config.ini int get_default_music(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 934d2577..34ae2b77 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -88,6 +88,8 @@ private: QLabel *ui_bliprate_lbl; QCheckBox *ui_blank_blips_cb; QLabel *ui_blank_blips_lbl; + QLabel *ui_objectmusic_lbl; + QCheckBox *ui_objectmusic_cb; QDialogButtonBox *ui_settings_buttons; QWidget *ui_casing_tab; -- cgit From 455e020b19bb1801304cedd08b2675fe4bb30605 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 11:13:50 +0300 Subject: Make log go downwards by default Rename kill_music_on_object to objection_stop_music for readability Update blip rate (faster overall, more accurate to the trilogy) - based on AOV values Update default blip rate to be "once every two symbols" --- include/aoapplication.h | 4 ++-- include/courtroom.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 94508ff8..e6cb21d6 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -150,8 +150,8 @@ public: //Returns true if blank blips is enabled in config.ini and false otherwise bool get_blank_blip(); - //Returns true if kill music on object is enabled in the config.ini - bool get_objectmusic(); + //Returns true if stop music on objection is enabled in the config.ini + bool objection_stop_music(); //Returns the value of default_music in config.ini int get_default_music(); diff --git a/include/courtroom.h b/include/courtroom.h index a3c4736b..ed5199df 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -249,7 +249,7 @@ private: bool message_is_centered = false; int current_display_speed = 3; - int message_display_speed[7] = {30, 40, 50, 60, 75, 100, 120}; + int message_display_speed[7] = {10, 20, 30, 40, 50, 60, 75}; // This is for checking if the character should start talking again // when an inline blue text ends. -- cgit From 5c69d10cd5fface32aea04cea1d288783d376179 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 11:31:06 +0300 Subject: Add a tool tip to blip rate settings Adapt the blip rate to allow variable speed value array sizes --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index e6cb21d6..4a3c669b 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -144,7 +144,7 @@ public: //Returns the value of ooc_name in config.ini QString get_ooc_name(); - //Returns the blip rate from config.ini + //Returns the blip rate from config.ini (once per X symbols) int read_blip_rate(); //Returns true if blank blips is enabled in config.ini and false otherwise -- cgit From bb8edab5798be59476557c0eae2b6aa1f4257448 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 11:41:59 +0300 Subject: Make shout, verdict and wtce default duration values into constants --- include/courtroom.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index ed5199df..b3303374 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -311,6 +311,15 @@ private: //every time point in char.inis times this equals the final time const int time_mod = 40; + //the amount of time non-animated objection/hold it/takethat images stay onscreen for in ms + const int shout_stay_time = 724; + + //the amount of time non-animated guilty/not guilty images stay onscreen for in ms + const int verdict_stay_time = 3000; + + //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms + const int wtce_stay_time = 1500; + static const int chatmessage_size = 23; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; -- cgit From 86523bb101e73417e44eaae71e6cac5a11a70751 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 11:56:22 +0300 Subject: Rename dubious "duration" to "default_duration" for play function in AOMovie class --- include/aomovie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomovie.h b/include/aomovie.h index 33b31586..974559d2 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -16,7 +16,7 @@ public: void set_play_once(bool p_play_once); void start_timer(int delay); - void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int duration = 0); + void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); void combo_resize(int w, int h); void stop(); -- cgit From 040898feff5d15f7236afb5e41c3bcc47e703a2a Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 13 Sep 2019 15:11:30 +0300 Subject: Set up screenshake button ui Rewrite Goofball's doScreenshake() function to be much more modular and multi-purpose (also rename to do_screenshake() to match other functions) Add networking needed to make screenshake work. Works with AOV version of tsuserver3 (button screenshake only so far). Add get_theme_pos helper function, currently unused. --- include/aoapplication.h | 1 + include/courtroom.h | 15 ++++++++++++++- include/datatypes.h | 7 ++++++- 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 4a3c669b..8d998f46 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -78,6 +78,7 @@ public: bool arup_enabled = false; bool casing_alerts_enabled = false; bool modcall_reason_enabled = false; + bool looping_sfx_support_enabled = false; ///////////////loading info/////////////////// diff --git a/include/courtroom.h b/include/courtroom.h index b3303374..682e12a1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -49,6 +49,9 @@ #include #include #include +#include +#include +#include #include @@ -124,6 +127,9 @@ public: //reads theme inis and sets size and pos based on the identifier void set_size_and_pos(QWidget *p_widget, QString p_identifier); + //reads theme inis and returns the size and pos as defined by it + QPoint get_theme_pos(QString p_identifier); + //sets status as taken on character with cid n_char and places proper shading on charselect void set_taken(int n_char, bool p_taken); @@ -213,6 +219,8 @@ public: void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); + void do_screenshake(); + void doRealization(); ~Courtroom(); @@ -231,6 +239,8 @@ private: bool first_message_sent = false; int maximumMessages = 0; + QParallelAnimationGroup *screenshake_animation_group; + // This is for inline message-colouring. enum INLINE_COLOURS { @@ -320,7 +330,7 @@ private: //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms const int wtce_stay_time = 1500; - static const int chatmessage_size = 23; + static const int chatmessage_size = 28; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; @@ -346,6 +356,7 @@ private: int objection_state = 0; int realization_state = 0; + int screenshake_state = 0; int text_color = 0; bool is_presenting_evidence = false; @@ -472,6 +483,7 @@ private: AOButton *ui_custom_objection; AOButton *ui_realization; + AOButton *ui_screenshake; AOButton *ui_mute; AOButton *ui_defense_plus; @@ -595,6 +607,7 @@ private slots: void on_custom_objection_clicked(); void on_realization_clicked(); + void on_screenshake_clicked(); void on_mute_clicked(); void on_pair_clicked(); diff --git a/include/datatypes.h b/include/datatypes.h index aaa5de52..1b76f725 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -100,7 +100,12 @@ enum CHAT_MESSAGE SELF_OFFSET, OTHER_OFFSET, OTHER_FLIP, - NONINTERRUPTING_PRE + NONINTERRUPTING_PRE, + LOOPING_SFX, + SCREENSHAKE, + FRAME_SCREENSHAKE, + FRAME_REALIZATION, + FRAME_SFX }; enum COLOR -- cgit From 1139bf5cd0473817ba223ac8a9fe9d193575206a Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sat, 19 Jan 2019 21:01:19 -0800 Subject: Bass.dll functionality-based clientside music looping system by using channel loopable flags (no use of QTimer required) Implement Goofball's AOV loopable music server message where any value that's not -1 when the length of the handle_message packet is longer than 3 will not loop the music (still confused about this but w/e) --- include/aomusicplayer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index b34267c9..da47128c 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -17,15 +17,18 @@ class AOMusicPlayer { public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + virtual ~AOMusicPlayer(); void play(QString p_song); + void stop(); void set_volume(int p_value); + void set_looping(bool toggle); private: QWidget *m_parent; AOApplication *ao_app; + bool m_looping = true; int m_volume = 0; HSTREAM m_stream; }; -- cgit From 4645d9dd080964560477e48d99812bc494c1965b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 14 Sep 2019 00:46:46 +0300 Subject: Add a blip sound QElapsedTimer so blipsounds don't play more frequently than 60ms to preserve all of our ears. Adjust the message display speeds to feel more accurate to AA, with }}} speed displaying text instantly for that section --- include/aoblipplayer.h | 4 ++++ include/courtroom.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 44ca48bb..9a428371 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -11,6 +11,7 @@ #include #include +#include #include @@ -26,9 +27,12 @@ public: int m_cycle = 0; private: + const int max_blip_ms = 60; + QWidget *m_parent; AOApplication *ao_app; qreal m_volume; + QElapsedTimer delay; void set_volume_internal(qreal p_volume); diff --git a/include/courtroom.h b/include/courtroom.h index 682e12a1..9c79a3e3 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -259,7 +259,7 @@ private: bool message_is_centered = false; int current_display_speed = 3; - int message_display_speed[7] = {10, 20, 30, 40, 50, 60, 75}; + int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; // This is for checking if the character should start talking again // when an inline blue text ends. -- cgit From 51c97ad51ce564ab400f5333eaad75b1fb2e5461 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 14 Sep 2019 19:38:56 +0300 Subject: Allow [Time] to be blank for pre-anims to not be required to use it play_talking and play_idle reduced in useless code --- include/aocharmovie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 7ef7da3f..f54f5105 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -36,7 +36,7 @@ private: QVector movie_frames; QTimer *preanim_timer; - const int time_mod = 62; + const int time_mod = 60; // These are the X and Y values before they are fixed based on the sprite's width. int x = 0; -- cgit From ab30cca586a05506c3cfb502cee53957409242e8 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 14 Sep 2019 19:50:46 +0300 Subject: Use a ticker and QImageReader instead of QMovie Issue: absolutely fucking broken, needs shittons of fixing or ditching. Might not be that efficient, anyway. --- include/aocharmovie.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index f54f5105..65ab79fe 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -1,7 +1,7 @@ #ifndef AOCHARMOVIE_H #define AOCHARMOVIE_H -#include +#include #include #include #include @@ -21,20 +21,24 @@ public: void play_talking(QString p_char, QString p_emote); void play_idle(QString p_char, QString p_emote); - void set_flipped(bool p_flipped) {m_flipped = p_flipped;} + void set_frame(QImage image); void stop(); + void set_flipped(bool p_flipped) {m_flipped = p_flipped;} + void move(int ax, int ay); void combo_resize(int w, int h); + private: AOApplication *ao_app; - QMovie *m_movie; - QVector movie_frames; + QImageReader *m_reader; QTimer *preanim_timer; + QTimer *ticker; + QString last_path; const int time_mod = 60; @@ -50,8 +54,8 @@ signals: void done(); private slots: - void frame_change(int n_frame); - void timer_done(); + void preanim_done(); + void movie_ticker(); }; #endif // AOCHARMOVIE_H -- cgit From 938f1aeea15c6b68495bb1cb0a80467f4e8cf343 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 14 Sep 2019 22:35:02 +0300 Subject: Optimize the heck out of animated images. There is no lag after the image is loaded now. HOWEVER, there's lag when the image is first loaded due to the aspect ratio and sizing (at least with .apng's). --- include/aocharmovie.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 65ab79fe..0921bc5f 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -6,6 +6,7 @@ #include #include #include +#include class AOApplication; @@ -21,7 +22,8 @@ public: void play_talking(QString p_char, QString p_emote); void play_idle(QString p_char, QString p_emote); - void set_frame(QImage image); + QPixmap get_pixmap(QImage image); + void set_frame(QPixmap f_pixmap); void stop(); @@ -35,19 +37,22 @@ public: private: AOApplication *ao_app; - QImageReader *m_reader; + QVector movie_frames; + QVector movie_delays; QTimer *preanim_timer; QTimer *ticker; QString last_path; + QElapsedTimer actual_time; const int time_mod = 60; // These are the X and Y values before they are fixed based on the sprite's width. int x = 0; int y = 0; - bool m_flipped = false; + int frame = 0; + bool m_flipped = false; bool play_once = true; signals: -- cgit From 37d192b4300efd1c2f3e35b2efb40e93ec99fa03 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 02:14:40 +0300 Subject: Load frames as they're needed instead of loading everything at once, and cache them for optimization. The cache is cleared when a new animation is played. Resolve an issue where if a preanim transitions into (a)idle it would get stuck on the first frame of that (removed the ticker->stop();) --- include/aocharmovie.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 0921bc5f..c852bb36 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -42,6 +42,7 @@ private: QTimer *preanim_timer; QTimer *ticker; QString last_path; + QImageReader *m_reader = new QImageReader(); QElapsedTimer actual_time; const int time_mod = 60; @@ -51,6 +52,7 @@ private: int y = 0; int frame = 0; + int max_frames = 0; bool m_flipped = false; bool play_once = true; -- cgit From 4db114007456f12c77f002cac4e26cd3f6917638 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 14:26:57 +0300 Subject: Add a bunch of cool refactors to support variable speed percentage Partially bring back the differing [Time] duration variable, however, the speed of the image will not be adjusted to accomodate it due to the need for using m_reader to read through every frame to determine the final full delay value (which tanks performance). Comment all the functions for the charmovie in aocharmovie.h --- include/aocharmovie.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index c852bb36..b8b73b7e 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -17,22 +17,44 @@ class AOCharMovie : public QLabel public: AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); - void play(QString p_char, QString p_emote, QString emote_prefix); + //Set the movie's image to provided paths, preparing for playback. + void load_image(QString p_char, QString p_emote, QString emote_prefix); + + //Start playback of the movie (if animated). + void play(); + + //Play a hat.gif - style preanimation void play_pre(QString p_char, QString p_emote, int duration); + + //Play a (b)normal.gif - style animation (talking) void play_talking(QString p_char, QString p_emote); + + //Play an (a)normal.gif - style animation (not talking) void play_idle(QString p_char, QString p_emote); + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage QPixmap get_pixmap(QImage image); + + //Set the movie's frame to provided pixmap void set_frame(QPixmap f_pixmap); + //Stop the movie, clearing the image void stop(); + //Set the m_flipped variable to true/false void set_flipped(bool p_flipped) {m_flipped = p_flipped;} + //Set the movie's playback speed (between 10% and 1000%) + void set_speed(int modifier) {speed = qMax(10, qMin(modifier, 1000));} + + //Move the label itself around void move(int ax, int ay); + //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of void combo_resize(int w, int h); + //Return the frame delay adjusted for speed + int get_frame_delay(int delay); private: AOApplication *ao_app; @@ -54,6 +76,8 @@ private: int frame = 0; int max_frames = 0; + int speed = 100; + bool m_flipped = false; bool play_once = true; -- cgit From a2f9df4042585ab0849b54e2bb0b9699f9064aed Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 17:44:02 +0300 Subject: Finally implement frame-specific effects such as screenshake, realization flash, sound effects, etc. Fix screenshake animation modifying the default positions of shook elements Fix aomovie sometimes not playing the last frame and causing lagspikes due to the delay() method --- include/aoapplication.h | 12 ++++++++++++ include/aocharmovie.h | 12 ++++++++++++ include/aomovie.h | 1 - include/courtroom.h | 7 ++++--- 4 files changed, 28 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 8d998f46..8164e166 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -271,6 +271,18 @@ public: //Returns the sfx of p_char's p_emote QString get_sfx_name(QString p_char, int p_emote); + //Returns if the sfx is defined as looping in char.ini + QString get_sfx_looping(QString p_char, QString p_sfx); + + //Returns if an emote has a frame specific SFX for it + QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_flash_frame(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); + //Not in use int get_sfx_delay(QString p_char, int p_emote); diff --git a/include/aocharmovie.h b/include/aocharmovie.h index b8b73b7e..5eaafaf6 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -32,6 +32,9 @@ public: //Play an (a)normal.gif - style animation (not talking) void play_idle(QString p_char, QString p_emote); + //Play a frame-specific effect, if there's any defined for that specific frame. + void play_frame_effect(int frame); + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage QPixmap get_pixmap(QImage image); @@ -61,6 +64,12 @@ private: QVector movie_frames; QVector movie_delays; + + //Effects such as sfx, screenshakes and realization flashes are stored in here. + //QString entry format: "sfx^[sfx_name]", "shake", "flash". + //The program uses the QVector index as reference. + QVector> movie_effects; + QTimer *preanim_timer; QTimer *ticker; QString last_path; @@ -83,6 +92,9 @@ private: signals: void done(); + void shake(); + void flash(); + void play_sfx(QString sfx); private slots: void preanim_done(); diff --git a/include/aomovie.h b/include/aomovie.h index 974559d2..a5af735e 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,7 +15,6 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void start_timer(int delay); void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); void combo_resize(int w, int h); void stop(); diff --git a/include/courtroom.h b/include/courtroom.h index 9c79a3e3..7fbde274 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -219,8 +219,6 @@ public: void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); - void do_screenshake(); - void doRealization(); ~Courtroom(); @@ -239,7 +237,7 @@ private: bool first_message_sent = false; int maximumMessages = 0; - QParallelAnimationGroup *screenshake_animation_group; + QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; // This is for inline message-colouring. @@ -557,6 +555,9 @@ private: public slots: void objection_done(); void preanim_done(); + void do_screenshake(); + void do_flash(); + void play_char_sfx(QString sfx_name); void mod_called(QString p_ip); -- cgit From e94640b3493700a266619388d75dac5e56b3189a Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 17:44:47 +0300 Subject: Looping SFX system - Defined this way: [SoundL] sfx-roar = 1 --- include/aoapplication.h | 3 +++ include/aosfxplayer.h | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 8164e166..88855968 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -151,6 +151,9 @@ public: //Returns true if blank blips is enabled in config.ini and false otherwise bool get_blank_blip(); + //Returns true if looping sound effects are enabled in the config.ini + bool get_looping_sfx(); + //Returns true if stop music on objection is enabled in the config.ini bool objection_stop_music(); diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 19d4bdf3..112e3ec6 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -18,19 +18,24 @@ class AOSfxPlayer public: AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); - void play(QString p_sfx, QString p_char = "", QString shout = ""); - void stop(); + void clear(); + void loop_clear(); + void play(QString p_sfx, QString p_char = "", QString shout = "", int channel=-1); + void stop(int channel=-1); void set_volume(qreal p_volume); - + void set_looping(bool toggle, int channel=-1); + int m_channel = 0; private: QWidget *m_parent; AOApplication *ao_app; qreal m_volume = 0; + bool m_looping = true; void set_volume_internal(qreal p_volume); #if defined(BASSAUDIO) - HSTREAM m_stream; + const int m_channelmax = 5; + HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) QSoundEffect m_sfx; #endif -- cgit From 661ec87646fe57a0081d49e428267b0dfe3f0d65 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 20:02:24 +0300 Subject: Implement networking for frame-specific effects data sending/parsing if the server supports it Reorganize charmovie.h a bit and make some functions private Add a new helper function "read_char_ini_tag" which returns a qstringlist of all key=value strings associated with the tag --- include/aoapplication.h | 3 +++ include/aocharmovie.h | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 88855968..eb12b0c1 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -232,6 +232,9 @@ public: //Returns the value of p_search_line within target_tag and terminator_tag QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); + //Returns a QStringList of all key=value definitions on a given tag. + QStringList read_char_ini_tag(QString p_char, QString target_tag); + //Returns the side of the p_char character from that characters ini file QString get_char_side(QString p_char); diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 5eaafaf6..d066a399 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -17,12 +17,6 @@ class AOCharMovie : public QLabel public: AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); - //Set the movie's image to provided paths, preparing for playback. - void load_image(QString p_char, QString p_emote, QString emote_prefix); - - //Start playback of the movie (if animated). - void play(); - //Play a hat.gif - style preanimation void play_pre(QString p_char, QString p_emote, int duration); @@ -32,15 +26,6 @@ public: //Play an (a)normal.gif - style animation (not talking) void play_idle(QString p_char, QString p_emote); - //Play a frame-specific effect, if there's any defined for that specific frame. - void play_frame_effect(int frame); - - //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage - QPixmap get_pixmap(QImage image); - - //Set the movie's frame to provided pixmap - void set_frame(QPixmap f_pixmap); - //Stop the movie, clearing the image void stop(); @@ -59,6 +44,8 @@ public: //Return the frame delay adjusted for speed int get_frame_delay(int delay); + QStringList network_strings; + private: AOApplication *ao_app; @@ -75,6 +62,9 @@ private: QString last_path; QImageReader *m_reader = new QImageReader(); + QString m_char; + QString m_emote; + QElapsedTimer actual_time; const int time_mod = 60; @@ -90,6 +80,27 @@ private: bool m_flipped = false; bool play_once = true; + //Set the movie's image to provided paths, preparing for playback. + void load_image(QString p_char, QString p_emote, QString emote_prefix); + + //Start playback of the movie (if animated). + void play(); + + //Play a frame-specific effect, if there's any defined for that specific frame. + void play_frame_effect(int frame); + + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage + QPixmap get_pixmap(QImage image); + + //Set the movie's frame to provided pixmap + void set_frame(QPixmap f_pixmap); + + //Initialize the frame-specific effects from the char.ini + void load_effects(); + + //Initialize the frame-specific effects from the provided network_strings, this is only initialized if network_strings has size more than 0. + void load_network_effects(); + signals: void done(); void shake(); -- cgit From ba28c244aa7591892abb2699cdc547ec431543a7 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 21:15:40 +0300 Subject: Add an opton to enable/disable screenshake + flashing Fix moderation guard button not doing what it's supposed to (enable/disable modcalls) Fix moderation guard button appearing with failed logins Fix the option to toggle looping sfx not doing anything --- include/aoapplication.h | 4 ++++ include/aooptionsdialog.h | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index eb12b0c1..6bc86e6d 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -170,6 +170,10 @@ public: // from the config.ini. bool is_discord_enabled(); + // Returns the value of whether shaking and flashing should be enabled. + // from the config.ini. + bool is_shake_flash_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 34ae2b77..0deb0a82 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -64,6 +64,9 @@ private: QLabel *ui_language_label; QComboBox *ui_language_combobox; + QLabel *ui_epilepsy_lbl; + QCheckBox *ui_epilepsy_cb; + QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; QVBoxLayout *ui_callwords_layout; @@ -88,6 +91,8 @@ private: QLabel *ui_bliprate_lbl; QCheckBox *ui_blank_blips_cb; QLabel *ui_blank_blips_lbl; + QLabel *ui_loopsfx_lbl; + QCheckBox *ui_loopsfx_cb; QLabel *ui_objectmusic_lbl; QCheckBox *ui_objectmusic_cb; QDialogButtonBox *ui_settings_buttons; -- cgit From 1b36be9dbc0cc665ddb69e1e1ee70267612b5d6c Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 15 Sep 2019 21:39:39 +0300 Subject: Add an option for networking frame-specific effects I'm starting to realize the options menu/system needs a complete overhaul at this point. (Auto-generating options menu, anyone?) --- include/aoapplication.h | 4 ++++ include/aooptionsdialog.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 6bc86e6d..e63ab8e7 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -174,6 +174,10 @@ public: // from the config.ini. bool is_shake_flash_enabled(); + // Returns the value of whether frame-specific effects defined in char.ini should be sent/received over the network. + // from the config.ini. + bool is_frame_network_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 0deb0a82..03226619 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -66,6 +66,8 @@ private: QLabel *ui_epilepsy_lbl; QCheckBox *ui_epilepsy_cb; + QLabel *ui_framenetwork_lbl; + QCheckBox *ui_framenetwork_cb; QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; -- cgit From bf999f195a0be20519356644df1940cf18d905e7 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 01:16:37 +0300 Subject: Add file reading, writing and appending functions that create folders if bool is true Fix server_address not being properly created in packet distribution Create a log file when you join a server in the logs//.log and update it every time there's a new chat entry minor refactor of chatlogpiece --- include/aoapplication.h | 12 ++++++++++++ include/chatlogpiece.h | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index e63ab8e7..24dc35ce 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -201,6 +201,15 @@ public: //Returns the list of words in callwords.ini QStringList get_call_words(); + //Process a file and return its text as a QString + QString read_file(QString filename); + + //Write text to file. make_dir would auto-create the directory if it doesn't exist. + bool write_to_file(QString p_text, QString p_file, bool make_dir = false); + + //Append text to the end of the file. make_dir would auto-create the directory if it doesn't exist. + bool append_to_file(QString p_text, QString p_file, bool make_dir = false); + //Appends the argument string to serverlist.txt void write_to_serverlist_txt(QString p_line); @@ -337,6 +346,9 @@ public: // Get the message for the CM for casing alerts. QString get_casing_can_host_cases(); + //The file name of the log file in base/logs. + QString log_filename; + private: const int RELEASE = 2; const int MAJOR_VERSION = 6; diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h index 34c5926b..303c2351 100644 --- a/include/chatlogpiece.h +++ b/include/chatlogpiece.h @@ -14,7 +14,7 @@ public: QString get_name(); QString get_showname(); QString get_message(); - bool get_is_song(); + bool is_song(); QDateTime get_datetime(); QString get_datetime_as_string(); @@ -25,7 +25,7 @@ private: QString showname; QString message; QDateTime datetime; - bool is_song; + bool p_is_song; }; #endif // CHATLOGPIECE_H -- cgit From 2268df7b152ac6de774d4eb8afa7ae502026b543 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 01:17:13 +0300 Subject: Update preanim_timer to follow the weird ass time_mod constant --- include/aocharmovie.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index d066a399..ec7b9522 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -66,6 +66,8 @@ private: QString m_emote; QElapsedTimer actual_time; + + //it will forever be a mystery who thought this time_mod system would ever be a good idea with precision-based emotes const int time_mod = 60; // These are the X and Y values before they are fixed based on the sprite's width. -- cgit From 6785f357622363edf73cb55763b730bcb0542229 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 01:20:03 +0300 Subject: Begin implementation of scroll bars in the options menu --- include/aooptionsdialog.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 03226619..51984106 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include -- cgit From 03ebad6bb6c922323b16b3ae6a701ddc34ba538b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 04:16:59 +0300 Subject: Add expanded style sheet support Allow lobby fonts to happen --- include/aoapplication.h | 3 +++ include/courtroom.h | 6 ++++++ include/lobby.h | 4 ++++ 3 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 24dc35ce..fcee38fd 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -252,6 +252,9 @@ public: //Returns a QStringList of all key=value definitions on a given tag. QStringList read_char_ini_tag(QString p_char, QString target_tag); + //Returns the text between target_tag and terminator_tag in p_file + QString get_stylesheet(QString target_tag, QString p_file); + //Returns the side of the p_char character from that characters ini file QString get_char_side(QString p_char); diff --git a/include/courtroom.h b/include/courtroom.h index 7fbde274..9d33a911 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -122,6 +122,12 @@ public: //helper function that calls above function on the relevant widgets void set_fonts(); + //sets dropdown menu stylesheet + void set_dropdown(QWidget *widget, QString target_tag); + + //helper funciton that call above function on the relevant widgets + void set_dropdowns(); + void set_window_title(QString p_title); //reads theme inis and sets size and pos based on the identifier diff --git a/include/lobby.h b/include/lobby.h index 4293ac36..e0cd03da 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -32,6 +32,10 @@ public: void append_chatmessage(QString f_name, QString f_message); void append_error(QString f_message); void set_player_count(int players_online, int max_players); + void set_stylesheet(QWidget *widget, QString target_tag); + void set_stylesheets(); + void set_fonts(); + void set_font(QWidget *widget, QString p_identifier); void set_loading_text(QString p_text); void show_loading_overlay(){ui_loading_background->show();} void hide_loading_overlay(){ui_loading_background->hide();} -- cgit From 9b39b7d6aa2beb8b5496a528c2351adf125c4601 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 06:09:39 +0300 Subject: Allow char.ini to override the chat font and font size with chat_font = and chat_size = Scream at the coders that decided hard-coding fonts and colors was a good idea (gotta properly let the themes modify that later) Fix a lot of ui elements not properly respecting the themes and their colors add a set_qfont method for those situations that need it Allow the theme to change sender colors for ooc and ms chatlogs rename url parser variable to something more immediately apparent as to what it is for readability's sake --- include/aoapplication.h | 8 +++++++- include/aotextarea.h | 2 +- include/courtroom.h | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index fcee38fd..e4a5b7f6 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -261,9 +261,15 @@ public: //Returns the showname from the ini of p_char QString get_showname(QString p_char); - //Returns the value of chat from the specific p_char's ini file + //Returns the value of chat image from the specific p_char's ini file QString get_chat(QString p_char); + //Returns the value of chat font from the specific p_char's ini file + QString get_chat_font(QString p_char); + + //Returns the value of chat font size from the specific p_char's ini file + int get_chat_size(QString p_char); + //Returns the value of shouts from the specified p_char's ini file QString get_char_shouts(QString p_char); diff --git a/include/aotextarea.h b/include/aotextarea.h index d44596b2..266b7222 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -16,7 +16,7 @@ public: void append_error(QString p_message); private: - const QRegExp omnis_dank_url_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); + const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down); }; diff --git a/include/courtroom.h b/include/courtroom.h index 9d33a911..304dd64f 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -117,8 +117,13 @@ public: //sets position of widgets based on theme ini files void set_widgets(); + //sets font size based on theme ini files void set_font(QWidget *widget, QString p_identifier); + + //actual operation of setting the font on a widget + void set_qfont(QWidget *widget, QFont font, QColor f_color = Qt::black, bool bold = false); + //helper function that calls above function on the relevant widgets void set_fonts(); -- cgit From b037edc9d8360ee679cae8d5f6c4d138ede4482b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 18:11:19 +0300 Subject: Add additive text option where your messages are added to your previous one, fully networked and ready for the server Adjust some pointless static bool casts to be actual logic checks --- include/aoapplication.h | 1 + include/aocharmovie.h | 6 +++--- include/courtroom.h | 9 +++++++-- include/datatypes.h | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index e4a5b7f6..f499faf0 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -79,6 +79,7 @@ public: bool casing_alerts_enabled = false; bool modcall_reason_enabled = false; bool looping_sfx_support_enabled = false; + bool additive_enabled = false; ///////////////loading info/////////////////// diff --git a/include/aocharmovie.h b/include/aocharmovie.h index ec7b9522..adfa7b88 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -46,6 +46,9 @@ public: QStringList network_strings; + QString m_char; + QString m_emote; + private: AOApplication *ao_app; @@ -62,9 +65,6 @@ private: QString last_path; QImageReader *m_reader = new QImageReader(); - QString m_char; - QString m_emote; - QElapsedTimer actual_time; //it will forever be a mystery who thought this time_mod system would ever be a good idea with precision-based emotes diff --git a/include/courtroom.h b/include/courtroom.h index 304dd64f..9b3c0577 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -315,6 +315,9 @@ private: bool rainbow_appended = false; bool blank_blip = false; + //Whether or not is this message additive to the previous one + bool is_additive = false; + // Used for getting the current maximum blocks allowed in the IC chatlog. int log_maximum_blocks = 0; @@ -339,7 +342,7 @@ private: //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms const int wtce_stay_time = 1500; - static const int chatmessage_size = 28; + static const int chatmessage_size = 29; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; @@ -484,6 +487,7 @@ private: QCheckBox *ui_pre; QCheckBox *ui_flip; + QCheckBox *ui_additive; QCheckBox *ui_guard; QCheckBox *ui_casing; @@ -601,7 +605,7 @@ private slots: void on_emote_dropdown_changed(int p_index); void on_pos_dropdown_changed(int p_index); - void on_evidence_name_edited(); + void on_evidence_name_edited(QString text); void on_evidence_image_name_edited(); void on_evidence_image_button_clicked(); void on_evidence_clicked(int p_id); @@ -653,6 +657,7 @@ private slots: void on_pre_clicked(); void on_flip_clicked(); + void on_additive_clicked(); void on_guard_clicked(); void on_showname_enable_clicked(); diff --git a/include/datatypes.h b/include/datatypes.h index 1b76f725..54e5c741 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -105,7 +105,8 @@ enum CHAT_MESSAGE SCREENSHAKE, FRAME_SCREENSHAKE, FRAME_REALIZATION, - FRAME_SFX + FRAME_SFX, + ADDITIVE }; enum COLOR -- cgit From b085be5a2a0512c432bc9fd58413a9d8f93d451e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 21:08:43 +0300 Subject: Add two new helper functions - get_design_element and get_static_image_suffix Modify all set_image calls to utilize said suffix helper function Dynamically change betweehn chatblank, chat, chatmed, chatbig based on the showname's length Use char.ini showname if showname is set to whitespace (doesn't yet check if char.ini showname is also whitespace) --- include/aoapplication.h | 6 ++++++ include/aoimage.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index f499faf0..052ad08a 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -226,6 +226,9 @@ public: //Returns the dimensions of widget with specified identifier from p_file pos_size_type get_element_dimensions(QString p_identifier, QString p_file); + //Returns the value to you + QString get_design_element(QString p_identifier, QString p_file); + //Returns the name of the font with p_identifier from p_file QString get_font_name(QString p_identifier, QString p_file); @@ -247,6 +250,9 @@ public: // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to PNG. QString get_image_suffix(QString path_to_check); + // If this image is static and non-animated, return the supported static image formats. Currently only PNG. + QString get_static_image_suffix(QString path_to_check); + //Returns the value of p_search_line within target_tag and terminator_tag QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); diff --git a/include/aoimage.h b/include/aoimage.h index 4713be0a..25c8e068 100644 --- a/include/aoimage.h +++ b/include/aoimage.h @@ -17,8 +17,8 @@ public: QWidget *m_parent; AOApplication *ao_app; - void set_image(QString p_image); - void set_image_from_path(QString p_path); + bool set_image(QString p_image); + bool set_chatbox(QString p_path); void set_size_and_pos(QString identifier); }; -- cgit From f3c7beab70aeb1e9b1446553c3cb57345a1e5eb7 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 21:10:21 +0300 Subject: Chat arrow indicator to inform you if the current message stopped being processed Can be modified from the theme in chat_arrow of courtroom_design.ini Uses chat_arrow .png/.gif/etc. --- include/courtroom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 9b3c0577..45a3dfd3 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -424,6 +424,7 @@ private: AOEvidenceDisplay *ui_vp_evidence_display; AOImage *ui_vp_chatbox; QLabel *ui_vp_showname; + AOMovie *ui_vp_chat_arrow; QTextEdit *ui_vp_message; AOMovie *ui_vp_realization; AOMovie *ui_vp_testimony; -- cgit From 13221319b889a48255f8409389ef41f37ee8ac98 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 16 Sep 2019 23:22:34 +0300 Subject: Change get_stylesheet to return text of a parsed stylesheet file, its functionality was transferred to get_tagged_stylesheet Remove some useless/unused ui elements Implement stylesheet for courtrooms in a way that lets the end user modify a lot of its elements Use get_image_suffix for evidence_appear images --- include/aoapplication.h | 6 +++++- include/courtroom.h | 9 +++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 052ad08a..c33130f4 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -259,8 +259,12 @@ public: //Returns a QStringList of all key=value definitions on a given tag. QStringList read_char_ini_tag(QString p_char, QString target_tag); + + //Returns the text between target_tag and terminator_tag in p_file + QString get_stylesheet(QString p_file); + //Returns the text between target_tag and terminator_tag in p_file - QString get_stylesheet(QString target_tag, QString p_file); + QString get_tagged_stylesheet(QString target_tag, QString p_file); //Returns the side of the p_char character from that characters ini file QString get_char_side(QString p_char); diff --git a/include/courtroom.h b/include/courtroom.h index 45a3dfd3..0a7002bc 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -119,16 +119,16 @@ public: void set_widgets(); //sets font size based on theme ini files - void set_font(QWidget *widget, QString p_identifier); + void set_font(QWidget *widget, QString class_name, QString p_identifier); //actual operation of setting the font on a widget - void set_qfont(QWidget *widget, QFont font, QColor f_color = Qt::black, bool bold = false); + void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); //helper function that calls above function on the relevant widgets void set_fonts(); //sets dropdown menu stylesheet - void set_dropdown(QWidget *widget, QString target_tag); + void set_dropdown(QWidget *widget); //helper funciton that call above function on the relevant widgets void set_dropdowns(); @@ -514,9 +514,6 @@ private: AOImage *ui_muted; - QSpinBox *ui_log_limit_spinbox; - QLabel *ui_log_limit_label; - AOButton *ui_evidence_button; AOImage *ui_evidence; AOLineEdit *ui_evidence_name; -- cgit From 6747bfdd5edee3693144c088ad1e732b5748fb8b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 17 Sep 2019 03:31:18 +0300 Subject: Allow lobby server descriptions to parse links Fix bad reference to ui_emote_right image Fix chatbox being part of the viewport (gets cut off if it's outside) --- include/aotextarea.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/aotextarea.h b/include/aotextarea.h index 266b7222..13b29c9e 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -12,6 +12,7 @@ class AOTextArea : public QTextBrowser public: AOTextArea(QWidget *p_parent = nullptr); + void append_linked(QString p_message); void append_chatmessage(QString p_name, QString p_message, QString p_colour); void append_error(QString p_message); -- cgit From 9d20cf03222add2ef04d4d2cc305458bdf00fcad Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 17 Sep 2019 18:51:40 +0300 Subject: Streamlined ini swapping so the user can set up multiple character folders associated with a character. This will save to the character folder's iniswaps.ini. You can click on the dropdown and edit the text inside to add an iniswap, and press the [X] button that'll appear next to it to remove the ini swap. Recode the enter_courtroom and add a new update_character feature - the two are now separate and responsible for different things. The courtroom will reload the whole theme and widgets while the character is only responsible for all ui elements related to the character. This drastically improves performance when switching characters using /switch or something Add a set_char_ini helper function that allows you to modify the character variables. For now only used to set name= field when iniswapping --- include/aoapplication.h | 5 +++++ include/courtroom.h | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index c33130f4..f26c8161 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -202,6 +202,9 @@ public: //Returns the list of words in callwords.ini QStringList get_call_words(); + //returns all of the file's lines in a QStringList + QStringList get_list_file(QString p_file); + //Process a file and return its text as a QString QString read_file(QString filename); @@ -259,6 +262,8 @@ public: //Returns a QStringList of all key=value definitions on a given tag. QStringList read_char_ini_tag(QString p_char, QString target_tag); + //Sets the char.ini p_search_line key under tag target_tag to value. + void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); //Returns the text between target_tag and terminator_tag in p_file QString get_stylesheet(QString p_file); diff --git a/include/courtroom.h b/include/courtroom.h index 0a7002bc..91f1f9ac 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -184,8 +184,11 @@ public: QString get_current_char() {return current_char;} QString get_current_background() {return current_background;} + //updates character to p_cid and updates necessary ui elements + void update_character(int p_cid); + //properly sets up some varibles: resets user state - void enter_courtroom(int p_cid); + void enter_courtroom(); //helper function that populates ui_music_list with the contents of music_list void list_music(); @@ -461,6 +464,9 @@ private: QComboBox *ui_emote_dropdown; QComboBox *ui_pos_dropdown; + QComboBox *ui_iniswap_dropdown; + AOButton *ui_iniswap_remove; + AOImage *ui_defense_bar; AOImage *ui_prosecution_bar; @@ -602,6 +608,10 @@ private slots: void on_emote_dropdown_changed(int p_index); void on_pos_dropdown_changed(int p_index); + void on_iniswap_dropdown_changed(int p_index); + + void set_iniswap_dropdown(); + void on_iniswap_remove_clicked(); void on_evidence_name_edited(QString text); void on_evidence_image_name_edited(); -- cgit From e151964785301269500b96ecfd25dbdf227f55f8 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 17 Sep 2019 23:50:01 +0300 Subject: Add a sfx list that allows you to choose custom sfx from a list. Allows the same amount of customization as the iniswap list. It tries to read soundlist.ini in the character folder first. If it can't find it, it will fall back to the theme's character_soundlist.ini. It will only save the soundlist.ini if it differs from the character.soundlist.ini. There is currently no way to dynamically change sound delay atm but the function for it is there. Add more tooltips, my favorite! --- include/courtroom.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 91f1f9ac..8d1588e9 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -467,6 +467,9 @@ private: QComboBox *ui_iniswap_dropdown; AOButton *ui_iniswap_remove; + QComboBox *ui_sfx_dropdown; + AOButton *ui_sfx_remove; + AOImage *ui_defense_bar; AOImage *ui_prosecution_bar; @@ -608,11 +611,18 @@ private slots: void on_emote_dropdown_changed(int p_index); void on_pos_dropdown_changed(int p_index); - void on_iniswap_dropdown_changed(int p_index); + void on_iniswap_dropdown_changed(int p_index); void set_iniswap_dropdown(); void on_iniswap_remove_clicked(); + void on_sfx_dropdown_changed(int p_index); + void set_sfx_dropdown(); + void on_sfx_remove_clicked(); + + QString get_char_sfx(); + int get_char_sfx_delay(); + void on_evidence_name_edited(QString text); void on_evidence_image_name_edited(); void on_evidence_image_button_clicked(); -- cgit From 605e15bb8c0ad103fb0f75454d8912ba83ba7a17 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 04:14:52 +0300 Subject: Implement effects system that reads your folder in theme/effects, or misc// Add an effect packet Allow aomovie to be fed a direct path Add some really terrible helper functions that shouldn't exist, sorry. --- include/aoapplication.h | 13 +++++++++++++ include/aomovie.h | 2 +- include/courtroom.h | 12 ++++++++++-- include/datatypes.h | 3 ++- 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index f26c8161..f8ce2269 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -80,6 +80,7 @@ public: bool modcall_reason_enabled = false; bool looping_sfx_support_enabled = false; bool additive_enabled = false; + bool effects_enabled = false; ///////////////loading info/////////////////// @@ -298,6 +299,18 @@ public: //Not in use int get_text_delay(QString p_char, QString p_emote); + //Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string + QStringList get_char_effects(QString p_char); + + //Get the theme's effects folder, read it and return the list of filenames in a string + QStringList get_effects(); + + //t + QString get_effect(QString effect, QString p_char); + + //Return the effect sound associated with the fx_name in the misc/effects//sounds.ini, or theme/effects/sounds.ini. + QString get_effect_sound(QString fx_name, QString p_char); + // Returns the custom realisation used by the character. QString get_custom_realization(QString p_char); diff --git a/include/aomovie.h b/include/aomovie.h index a5af735e..ec286199 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -15,7 +15,7 @@ public: AOMovie(QWidget *p_parent, AOApplication *p_ao_app); void set_play_once(bool p_play_once); - void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); + void play(QString p_image, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); void combo_resize(int w, int h); void stop(); diff --git a/include/courtroom.h b/include/courtroom.h index 8d1588e9..6ba3d651 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -345,7 +345,7 @@ private: //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms const int wtce_stay_time = 1500; - static const int chatmessage_size = 29; + static const int chatmessage_size = 30; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; @@ -375,6 +375,8 @@ private: int text_color = 0; bool is_presenting_evidence = false; + QString effect = ""; + int defense_bar_state = 0; int prosecution_bar_state = 0; @@ -429,7 +431,7 @@ private: QLabel *ui_vp_showname; AOMovie *ui_vp_chat_arrow; QTextEdit *ui_vp_message; - AOMovie *ui_vp_realization; + AOMovie *ui_vp_effect; AOMovie *ui_vp_testimony; AOMovie *ui_vp_wtce; AOMovie *ui_vp_objection; @@ -470,6 +472,8 @@ private: QComboBox *ui_sfx_dropdown; AOButton *ui_sfx_remove; + QComboBox *ui_effects_dropdown; + AOImage *ui_defense_bar; AOImage *ui_prosecution_bar; @@ -579,6 +583,7 @@ public slots: void preanim_done(); void do_screenshake(); void do_flash(); + void do_effect(QString fx_path, QString fx_sound, QString p_char); void play_char_sfx(QString sfx_name); void mod_called(QString p_ip); @@ -620,6 +625,9 @@ private slots: void set_sfx_dropdown(); void on_sfx_remove_clicked(); + void set_effects_dropdown(); + void on_effects_dropdown_changed(int p_index); + QString get_char_sfx(); int get_char_sfx_delay(); diff --git a/include/datatypes.h b/include/datatypes.h index 54e5c741..5426d981 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -106,7 +106,8 @@ enum CHAT_MESSAGE FRAME_SCREENSHAKE, FRAME_REALIZATION, FRAME_SFX, - ADDITIVE + ADDITIVE, + EFFECTS }; enum COLOR -- cgit From ad057c6f7a71ffac53e8d5adbbd22ab17d3e0e98 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 05:22:00 +0300 Subject: make icons for effects n shit they're grabbed from the effects/icons/*same name as effects* gotta be .png or w/e i need my sleep --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index f8ce2269..78de2b80 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -303,7 +303,7 @@ public: QStringList get_char_effects(QString p_char); //Get the theme's effects folder, read it and return the list of filenames in a string - QStringList get_effects(); + QStringList get_effects(QString p_char); //t QString get_effect(QString effect, QString p_char); -- cgit From 2d329cdbd27c19d958275fbf1c6862135c96a395 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 05:45:02 +0300 Subject: Bugfixes for the thing and how it orders things --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 78de2b80..5fb63386 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -300,7 +300,7 @@ public: int get_text_delay(QString p_char, QString p_emote); //Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string - QStringList get_char_effects(QString p_char); + QStringList get_theme_effects(); //Get the theme's effects folder, read it and return the list of filenames in a string QStringList get_effects(QString p_char); -- cgit From 04daff7446061bb87bdf85ed080079041a75f142 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 15:46:43 +0300 Subject: When the realization button is pressed, update the Effects thing too. --- include/courtroom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 6ba3d651..a980aba8 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -627,6 +627,7 @@ private slots: void set_effects_dropdown(); void on_effects_dropdown_changed(int p_index); + bool effects_dropdown_find_and_set(QString effect); QString get_char_sfx(); int get_char_sfx_delay(); -- cgit From 0fe94d5d9f0e175ba8355305cdfd6cd35e0a545f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 17:34:22 +0300 Subject: Evidence and emotes reloading when reload_theme is pressed Update evidence a bit and change the way it sets images to something much better and less confusing Update the hovering logic a bit so there's less weird occurences happening e.g. evidence button is deleted --- include/aoevidencebutton.h | 1 - include/courtroom.h | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h index 80b747cd..f7baa9fa 100644 --- a/include/aoevidencebutton.h +++ b/include/aoevidencebutton.h @@ -15,7 +15,6 @@ class AOEvidenceButton : public QPushButton public: AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); - void reset(); void set_image(QString p_image); void set_theme_image(QString p_image); void set_id(int p_id) {m_id = p_id;} diff --git a/include/courtroom.h b/include/courtroom.h index a980aba8..97f695c9 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -571,11 +571,13 @@ private: void put_button_in_place(int starting, int chars_on_this_page); void filter_character_list(); - void construct_emotes(); + void initialize_emotes(); + void refresh_emotes(); void set_emote_page(); void set_emote_dropdown(); - void construct_evidence(); + void initialize_evidence(); + void refresh_evidence(); void set_evidence_page(); public slots: -- cgit From cda7d430b3fa988258819012a5a96249aa553f1e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 19:43:11 +0300 Subject: use SetIcon for AOEmoteButton instead of stylesheets Fix aolineedit not sending the double_clicked signal Add tooltips for emotes that display the number and the emote_comment (name) Add similar tooltips to evidence buttons Resolve an issue where you could edit evidence name without double-clicking a piece of evidence first --- include/aoemotebutton.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index c99a73b0..4c310147 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -13,9 +13,8 @@ class AOEmoteButton : public QPushButton public: AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); - //void set_on(QString p_char, int p_emote); - //void set_off(QString p_char, int p_emote); - void set_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); void set_id(int p_id) {m_id = p_id;} int get_id() {return m_id;} -- cgit From a175a1884cd057cb01e53b66f56491f9ae0e80d5 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 20:02:51 +0300 Subject: Concurrent evidence updating! Similar to the way Google Docs work, the evidence will be updated immediately as you make any changes to it. --- include/courtroom.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 97f695c9..d02c756d 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -691,10 +691,12 @@ private slots: void on_showname_enable_clicked(); + void on_evidence_name_double_clicked(); void on_evidence_button_clicked(); void on_evidence_delete_clicked(); void on_evidence_x_clicked(); + void on_evidence_description_edited(); void on_back_to_lobby_clicked(); -- cgit From 3899dbe0bd82875214ebd676130692120f89a412 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 05:30:07 +0300 Subject: I dunno what the fuck was I doing for the past 4 hours but I made crossfading music work. Music packets can receive channel to play the song in and the crossfading option too. --- include/aomusicplayer.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index da47128c..8ed07710 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -1,5 +1,6 @@ #ifndef AOMUSICPLAYER_H #define AOMUSICPLAYER_H +#include "file_functions.h" #if defined(BASSAUDIO) #include "bass.h" @@ -19,18 +20,30 @@ public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); virtual ~AOMusicPlayer(); - void play(QString p_song); - void stop(); - void set_volume(int p_value); - void set_looping(bool toggle); + void play(QString p_song, int channel=0, bool crossfade=false); + void stop(int channel=0); + void set_volume(int p_value, int channel=0); + void set_looping(bool toggle, int channel=0); + + //These have to be public for the stupid sync thing +// QWORD loop_start = 0; +// QWORD loop_end = 0; private: QWidget *m_parent; AOApplication *ao_app; - bool m_looping = true; + bool m_looping = false; int m_volume = 0; - HSTREAM m_stream; + + const int m_channelmax = 4; + // Channel 0 = music + // Channel 1 = ambience + // Channel 2 = extra + // Channel 3 = extra + HSTREAM m_stream_list[4]; + +// HSYNC loop_sync; }; #elif defined(QTAUDIO) class AOMusicPlayer -- cgit From d3f23708c43bc132c322b778b2aa8d31a68d1c0c Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 15:54:45 +0300 Subject: Revert buttons using setIcon and use a better stylesheet method instead Fix evidence buttons and emote buttons being hardcoded size --- include/aoemotebutton.h | 2 +- include/aoevidencebutton.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index 4c310147..a13688bb 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -11,7 +11,7 @@ class AOEmoteButton : public QPushButton Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); void set_image(QString p_image, QString p_emote_comment); void set_char_image(QString p_char, int p_emote, QString suffix); diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h index f7baa9fa..53fa11ff 100644 --- a/include/aoevidencebutton.h +++ b/include/aoevidencebutton.h @@ -13,7 +13,7 @@ class AOEvidenceButton : public QPushButton Q_OBJECT public: - AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); + AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); void set_image(QString p_image); void set_theme_image(QString p_image); -- cgit From 6dd0845f1c732e9c07afaaffb9163ba736a2ae25 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 17:03:49 +0300 Subject: Better scaling algorithm for characters of variable size --- include/aocharmovie.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index adfa7b88..8aed1eb8 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -73,6 +73,9 @@ private: // These are the X and Y values before they are fixed based on the sprite's width. int x = 0; int y = 0; + // These are the width and height values before they are fixed based on the sprite's width. + int f_w = 0; + int f_h = 0; int frame = 0; int max_frames = 0; -- cgit From 842b829bee8b840149c0042bb7adfc3bda6eec9d Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 22:11:37 +0300 Subject: Tweak the ambience/crosfade layer to fade in regardless of another sample being there Fix music not being looped sometimes Prevent channel less than 0 from being passed Set up a new music display element with an attached music name, it displays a scrolling text of the currently playing music Fix music packet processing issues Make SFX slider responsible for all music channels besides 0 (actual music) scrolltext.cpp code recipe was taken from https://stackoverflow.com/questions/10651514/text-scrolling-marquee-in-qlabel - thanks to leemes for that one, I only adapted it for newer C++ version and tweaked some stuff. --- include/aomusicplayer.h | 12 +++++++----- include/courtroom.h | 4 ++++ include/scrolltext.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 include/scrolltext.h (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 8ed07710..8e0d239a 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -19,16 +19,19 @@ class AOMusicPlayer public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); virtual ~AOMusicPlayer(); - - void play(QString p_song, int channel=0, bool crossfade=false); - void stop(int channel=0); - void set_volume(int p_value, int channel=0); + void set_volume(int p_value, int channel=-1); void set_looping(bool toggle, int channel=0); + const int m_channelmax = 4; + //These have to be public for the stupid sync thing // QWORD loop_start = 0; // QWORD loop_end = 0; +public slots: + void play(QString p_song, int channel=0, bool crossfade=false); + void stop(int channel=0); + private: QWidget *m_parent; AOApplication *ao_app; @@ -36,7 +39,6 @@ private: bool m_looping = false; int m_volume = 0; - const int m_channelmax = 4; // Channel 0 = music // Channel 1 = ambience // Channel 2 = extra diff --git a/include/courtroom.h b/include/courtroom.h index d02c756d..465b8ce1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -26,6 +26,7 @@ #include "datatypes.h" #include "debug_functions.h" #include "chatlogpiece.h" +#include "scrolltext.h" #include #include @@ -445,6 +446,9 @@ private: QListWidget *ui_area_list; QListWidget *ui_music_list; + ScrollText *ui_music_name; + AOMovie *ui_music_display; + AOButton *ui_pair_button; QListWidget *ui_pair_list; QSpinBox *ui_pair_offset_spinbox; diff --git a/include/scrolltext.h b/include/scrolltext.h new file mode 100644 index 00000000..cf791c03 --- /dev/null +++ b/include/scrolltext.h @@ -0,0 +1,50 @@ +#ifndef SCROLLTEXT_H +#define SCROLLTEXT_H + +#include +#include +#include +#include +#include + + +class ScrollText : public QWidget +{ + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QString separator READ separator WRITE setSeparator) + +public: + explicit ScrollText(QWidget *parent = nullptr); + +public slots: + QString text() const; + void setText(QString text); + + QString separator() const; + void setSeparator(QString separator); + + +protected: + virtual void paintEvent(QPaintEvent *); + virtual void resizeEvent(QResizeEvent *); + +private: + void updateText(); + QString _text; + QString _separator; + QStaticText staticText; + int singleTextWidth; + QSize wholeTextSize; + int leftMargin; + bool scrollEnabled; + int scrollPos; + QImage alphaChannel; + QImage buffer; + QTimer timer; + +private slots: + virtual void timer_timeout(); +}; + +#endif // SCROLLTEXT_H -- cgit From 2c265ebc0befebaef41c27a851d2ebff76bf0fec Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 21 Sep 2019 00:23:01 +0300 Subject: Clear the screen and display the background in the correct position when background change func is called --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 465b8ce1..e350db2b 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -161,7 +161,7 @@ public: void set_pair_list(); //sets desk and bg based on pos in chatmessage - void set_scene(); + void set_scene(QString f_desk_mod, QString f_side); //sets text color based on text color in chatmessage void set_text_color(); -- cgit From 398f37794facc239153a8c21e0630d2eb7850739 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 23 Sep 2019 15:48:35 +0300 Subject: Make music list a QTreeWidget instead for easier category searching, etc. Temporarily allow music suffix until I let the client perform a fileExists check similar to how images are handled (.mp3? play mp3, if not mp3, play .ogg, etc. etc.) --- include/courtroom.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index e350db2b..59e97dd3 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -444,7 +446,7 @@ private: QListWidget *ui_mute_list; QListWidget *ui_area_list; - QListWidget *ui_music_list; + QTreeWidget *ui_music_list; ScrollText *ui_music_name; AOMovie *ui_music_display; @@ -610,7 +612,7 @@ private slots: void on_ooc_return_pressed(); void on_music_search_edited(QString p_text); - void on_music_list_double_clicked(QModelIndex p_model); + void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); void on_area_list_double_clicked(QModelIndex p_model); void select_emote(int p_id); -- cgit From d8857aa2e48c89a5002f8511ce566df9c557598e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 24 Sep 2019 00:38:26 +0300 Subject: When the background is changed, display it in the correct position as dictated by the server packets Add a new "set pos" packet Udpate the pos dropdown according to the current pos --- include/courtroom.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 59e97dd3..26018e2c 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -150,6 +150,9 @@ public: //sets the current background to argument. also does some checks to see if it's a legacy bg void set_background(QString p_background); + //sets the local character pos/side to use. + void set_side(QString p_side); + //sets the evidence list member variable to argument void set_evidence_list(QVector &p_evi_list); @@ -412,6 +415,7 @@ private: bool server_ooc = true; QString current_background = "default"; + QString current_side = ""; AOMusicPlayer *music_player; AOSfxPlayer *sfx_player; -- cgit From 7097053723bab5cb91c312abaafeb69dc07dd4ac Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 24 Sep 2019 21:24:25 +0300 Subject: Change all instances of "colour" to "color" for consistency's sake Overhaul inline colors system to properly support additive text and further expansion Add two new colors - Gray and Blank, the latter being used for IC parsing. Instead of adding text symbol by symbol, reveal more of the already-rendered text instead so that it properly anticipates words that need to be on the newline. Changed the append_ic function slightly so it appends ": " to text only after it's no longer needed. Made gray color less inconsistent with everything else --- include/aoapplication.h | 2 +- include/aotextarea.h | 2 +- include/courtroom.h | 27 ++++----------------------- include/datatypes.h | 4 +++- 4 files changed, 9 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 5fb63386..fef299b2 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -242,7 +242,7 @@ public: //Returns the color with p_identifier from p_file QColor get_color(QString p_identifier, QString p_file); - // Returns the colour from the misc folder. + // Returns the color from the misc folder. QColor get_chat_color(QString p_identifier, QString p_chat); //Returns the sfx with p_identifier from sounds.ini in the current theme path diff --git a/include/aotextarea.h b/include/aotextarea.h index 13b29c9e..643a8e34 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -13,7 +13,7 @@ public: AOTextArea(QWidget *p_parent = nullptr); void append_linked(QString p_message); - void append_chatmessage(QString p_name, QString p_message, QString p_colour); + void append_chatmessage(QString p_name, QString p_message, QString p_colur); void append_error(QString p_message); private: diff --git a/include/courtroom.h b/include/courtroom.h index 26018e2c..5aad1cb4 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -171,7 +171,7 @@ public: //sets text color based on text color in chatmessage void set_text_color(); - // And gets the colour, too! + // And gets the color, too! QColor get_text_color(QString color); //takes in serverD-formatted IP list as prints a converted version to server OOC @@ -202,7 +202,7 @@ public: //these are for OOC chat void append_ms_chatmessage(QString f_name, QString f_message); - void append_server_chatmessage(QString p_name, QString p_message, QString p_colour); + void append_server_chatmessage(QString p_name, QString p_message, QString p_color); //these functions handle chatmessages sequentially. //The process itself is very convoluted and merits separate documentation @@ -213,7 +213,7 @@ public: //This function filters out the common CC inline text trickery, for appending to //the IC chatlog. - QString filter_ic_text(QString p_text); + QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = WHITE); //adds text to the IC chatlog. p_name first as bold then p_text then a newlin //this function keeps the chatlog scrolled to the top unless there's text selected @@ -259,18 +259,6 @@ private: QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; - // This is for inline message-colouring. - - enum INLINE_COLOURS { - INLINE_BLUE, - INLINE_GREEN, - INLINE_ORANGE, - INLINE_GREY - }; - - // A stack of inline colours. - std::stack inline_colour_stack; - bool next_character_is_not_special = false; // If true, write the // next character as it is. @@ -279,14 +267,6 @@ private: int current_display_speed = 3; int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; - // This is for checking if the character should start talking again - // when an inline blue text ends. - bool entire_message_is_blue = false; - - // And this is the inline 'talking checker'. Counts how 'deep' we are - // in inline blues. - int inline_blue_depth = 0; - // The character ID of the character this user wants to appear alongside with. int other_charid = -1; @@ -356,6 +336,7 @@ private: bool chatmessage_is_empty = false; QString previous_ic_message = ""; + QString additive_previous = ""; //char id, muted or not QMap mute_map; diff --git a/include/datatypes.h b/include/datatypes.h index 5426d981..1917482a 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -120,7 +120,9 @@ enum COLOR YELLOW, RAINBOW, PINK, - CYAN + CYAN, + GRAY, + BLANK }; #endif // DATATYPES_H -- cgit From 923548c99746858846764e47fa96899e7c5ef2ab Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 25 Sep 2019 02:05:52 +0300 Subject: Hellcommit of doom and suffering Create two new helper functions - get_chat_markdown and remake read_char_ini_tag to be read_ini_tags for more general purpose Modify aolineedit to support preserving selection after unfocusing (building this for using dropdown list for setting colors), as well as remove the setReadOnly functionality and use it in signals instead Overhaul the color system to get rid of inline colors, allow full customization of colors and usage of configuration files for every facet of how a color functions (should we be talking, should we remove that markdown char, etc.) Complete overhaul of color markdowns system TODO: Make this thing not lag to hell, fix chat messages hogging the IC as the animation never ends apparently --- include/aoapplication.h | 5 ++++- include/aolineedit.h | 11 ++++++----- include/courtroom.h | 16 +++++++--------- include/datatypes.h | 15 --------------- 4 files changed, 17 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index fef299b2..89bfaa26 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -242,6 +242,9 @@ public: //Returns the color with p_identifier from p_file QColor get_color(QString p_identifier, QString p_file); + // Returns the markdown symbol used for specified p_identifier such as colors + QString get_chat_markdown(QString p_identifier, QString p_file); + // Returns the color from the misc folder. QColor get_chat_color(QString p_identifier, QString p_chat); @@ -261,7 +264,7 @@ public: QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); //Returns a QStringList of all key=value definitions on a given tag. - QStringList read_char_ini_tag(QString p_char, QString target_tag); + QStringList read_ini_tags(QString p_file, QString target_tag = ""); //Sets the char.ini p_search_line key under tag target_tag to value. void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); diff --git a/include/aolineedit.h b/include/aolineedit.h index ce17680d..09521729 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -11,16 +11,17 @@ class AOLineEdit : public QLineEdit public: AOLineEdit(QWidget *parent); + void preserve_selection(bool toggle) {p_selection = toggle;} + +private: + bool p_selection = false; + protected: void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: void double_clicked(); - -private slots: - void on_enter_pressed(); - - }; #endif // AOLINEEDIT_H diff --git a/include/courtroom.h b/include/courtroom.h index 5aad1cb4..72dec046 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -168,12 +168,6 @@ public: //sets desk and bg based on pos in chatmessage void set_scene(QString f_desk_mod, QString f_side); - //sets text color based on text color in chatmessage - void set_text_color(); - - // And gets the color, too! - QColor get_text_color(QString color); - //takes in serverD-formatted IP list as prints a converted version to server OOC //admittedly poorly named void set_ip_list(QString p_list); @@ -213,7 +207,7 @@ public: //This function filters out the common CC inline text trickery, for appending to //the IC chatlog. - QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = WHITE); + QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); //adds text to the IC chatlog. p_name first as bold then p_text then a newlin //this function keeps the chatlog scrolled to the top unless there's text selected @@ -360,6 +354,9 @@ private: int realization_state = 0; int screenshake_state = 0; int text_color = 0; + static const int max_colors = 12; //How many unique user colors are possible + QVector color_row_to_number; //Current color list indexes to real color references + bool is_presenting_evidence = false; QString effect = ""; @@ -440,7 +437,7 @@ private: QListWidget *ui_pair_list; QSpinBox *ui_pair_offset_spinbox; - QLineEdit *ui_ic_chat_message; + AOLineEdit *ui_ic_chat_message; QLineEdit *ui_ic_chat_name; QLineEdit *ui_ooc_chat_message; @@ -625,7 +622,7 @@ private slots: QString get_char_sfx(); int get_char_sfx_delay(); - void on_evidence_name_edited(QString text); + void on_evidence_name_edited(); void on_evidence_image_name_edited(); void on_evidence_image_button_clicked(); void on_evidence_clicked(int p_id); @@ -654,6 +651,7 @@ private slots: void on_prosecution_plus_clicked(); void on_text_color_changed(int p_color); + void set_text_color_dropdown(); void on_music_slider_moved(int p_value); void on_sfx_slider_moved(int p_value); diff --git a/include/datatypes.h b/include/datatypes.h index 1917482a..835cf8f4 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -110,19 +110,4 @@ enum CHAT_MESSAGE EFFECTS }; -enum COLOR -{ - WHITE = 0, - GREEN, - RED, - ORANGE, - BLUE, - YELLOW, - RAINBOW, - PINK, - CYAN, - GRAY, - BLANK -}; - #endif // DATATYPES_H -- cgit From b67f083506803c3cf075e8872cacb329b063e8b3 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 25 Sep 2019 03:40:44 +0300 Subject: Optimize color markdown stuff properly by creating lists and preloading things --- include/courtroom.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 72dec046..d6bf4512 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -354,8 +354,29 @@ private: int realization_state = 0; int screenshake_state = 0; int text_color = 0; - static const int max_colors = 12; //How many unique user colors are possible - QVector color_row_to_number; //Current color list indexes to real color references + + //How many unique user colors are possible + static const int max_colors = 12; + + //Text Color-related optimization: + //Current color list indexes to real color references + QVector color_row_to_number; + + //List of associated RGB colors for this color index + QVector color_rgb_list; + + //List of markdown start characters, their index is tied to the color index + QStringList color_markdown_start_list; + + //List of markdown end characters, their index is tied to the color index + QStringList color_markdown_end_list; + + //Whether or not we're supposed to remove this char during parsing + QVector color_markdown_remove_list; + + //Whether or not this color allows us to play the talking animation + QVector color_markdown_talking_list; + //Text Color-related optimization END bool is_presenting_evidence = false; -- cgit From a3d1d5bf9d195969cf9a1cd55b59316dd262ab0b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 27 Sep 2019 15:11:46 +0300 Subject: i did it i did the thing Final overhaul of filter_ic_text Fix spoken colors not being actually spoken Fix a message of ()()()() spamming idle/talking animations (instead it just does the idle animation until you feed it an actual character) Prevent spamming of play_idle and play_talking on the fastest text speed Properly escape html and construct a message that works with characters &, <, >, ", etc. for filter_ic_text Turn whitespace into html entities to prevent html from eating it up (alternative/better solution would be to erase excessive whitespace entirely but yaknow, some niche applications, whatever) Fix filter_ic_text not displaying the best string it could in ic logs (strip html, display newlines as \n, etc.) Scroll the scrollbar of the message box correctly according to some real wacky magic stuff I'm doing here. Let's hope there's no situations where it desyncs from the actual text. --- include/courtroom.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index d6bf4512..476fd118 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -291,8 +291,10 @@ private: //int chat_tick_interval = 60; //which tick position(character in chat message) we are at int tick_pos = 0; + //the actual document tick pos we gotta worry about for making the text scroll better + int real_tick_pos = 0; //used to determine how often blips sound - int blip_pos = 0; + int blip_ticker = 0; int blip_rate = 1; int rainbow_counter = 0; bool rainbow_appended = false; @@ -342,6 +344,9 @@ private: //state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = noniterrupting preanim int anim_state = 3; + //whether or not current color is a talking one + bool color_is_talking = true; + //state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done int text_state = 2; -- cgit From d3a58770d3b923d488b5df090c8e98edf5bf0b2b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 28 Sep 2019 20:22:38 +0300 Subject: Overhaul the evidence system: You can now press the checkmark to save evidence. The checkmark only appears when your edited evidence differs from evidence on the server. You will now be alerted if you try to exit out of the evidence with unsaved changes (pressing "X") Fix double-clicking on image name not doing anything You will now be alerted if the evidence changed as you were editing it Add tooltips Make an evidence_close function that can be referred to from multiple places --- include/courtroom.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 476fd118..0fc56fe9 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -554,6 +555,7 @@ private: AOLineEdit *ui_evidence_image_name; AOButton *ui_evidence_image_button; AOButton *ui_evidence_x; + AOButton *ui_evidence_ok; AOTextEdit *ui_evidence_description; AOImage *ui_char_select_background; @@ -707,11 +709,17 @@ private slots: void on_showname_enable_clicked(); void on_evidence_name_double_clicked(); + void on_evidence_image_name_double_clicked(); void on_evidence_button_clicked(); void on_evidence_delete_clicked(); void on_evidence_x_clicked(); - void on_evidence_description_edited(); + void on_evidence_ok_clicked(); + + void on_evidence_edited(); + + void evidence_close(); + bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); void on_back_to_lobby_clicked(); -- cgit From 709ebb7e1872394731c2edb282a1ce73fdc353f9 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 28 Sep 2019 20:43:19 +0300 Subject: Fix AOEvidenceDisplay not respecting the size of the viewport properly and breaking if a static image was used for evidence appearance Fix an issue with chat message being resized before the chat box is in reload theme --- include/aoevidencedisplay.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/aoevidencedisplay.h b/include/aoevidencedisplay.h index 13ca00d5..93455c09 100644 --- a/include/aoevidencedisplay.h +++ b/include/aoevidencedisplay.h @@ -3,9 +3,9 @@ #include "aoapplication.h" #include "aosfxplayer.h" +#include "aomovie.h" #include -#include #include class AOEvidenceDisplay : public QLabel @@ -18,15 +18,16 @@ public: void show_evidence(QString p_evidence_image, bool is_left_side, int p_volume); QLabel* get_evidence_icon(); void reset(); + void combo_resize(int w, int h); private: AOApplication *ao_app; - QMovie *evidence_movie; + AOMovie *evidence_movie; QLabel *evidence_icon; AOSfxPlayer *sfx_player; private slots: - void frame_change(int p_frame); + void show_done(); }; #endif // AOEVIDENCEDISPLAY_H -- cgit From b0f11e53dff7187a147f01da2d8da5bf392cd38d Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 28 Sep 2019 22:00:16 +0300 Subject: Strip out QRandomGenerator because it's "too new" of a module (linux build does not compile with it) Add QPluginLoader checks for qapng and qwebp --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 0fc56fe9..866a75f0 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -55,7 +55,7 @@ #include #include #include -#include +//#include #include -- cgit From d5cbb085db9cc61ddc007217d1217c343307322e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 29 Sep 2019 03:27:36 +0300 Subject: Update Bass.dll headers to newer version Remove a bunch of comments Add lqapng and lqwebp to try and get apng and webp support to fuckin load already --- include/aomusicplayer.h | 2 -- include/bass.h | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 8e0d239a..9ce74852 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -44,8 +44,6 @@ private: // Channel 2 = extra // Channel 3 = extra HSTREAM m_stream_list[4]; - -// HSYNC loop_sync; }; #elif defined(QTAUDIO) class AOMusicPlayer diff --git a/include/bass.h b/include/bass.h index 1c50903c..388d4068 100644 --- a/include/bass.h +++ b/include/bass.h @@ -1,6 +1,6 @@ /* BASS 2.4 C/C++ header file - Copyright (c) 1999-2018 Un4seen Developments Ltd. + Copyright (c) 1999-2019 Un4seen Developments Ltd. See the BASS.CHM file for more detailed documentation */ @@ -117,6 +117,7 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_CONFIG_VERIFY 23 #define BASS_CONFIG_UPDATETHREADS 24 #define BASS_CONFIG_DEV_BUFFER 27 +#define BASS_CONFIG_REC_LOOPBACK 28 #define BASS_CONFIG_VISTA_TRUEPOS 30 #define BASS_CONFIG_IOS_MIXAUDIO 34 #define BASS_CONFIG_DEV_DEFAULT 36 @@ -141,11 +142,14 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_CONFIG_AM_DISABLE 58 #define BASS_CONFIG_NET_PLAYLIST_DEPTH 59 #define BASS_CONFIG_NET_PREBUF_WAIT 60 +#define BASS_CONFIG_WASAPI_PERSIST 65 +#define BASS_CONFIG_REC_WASAPI 66 // BASS_SetConfigPtr options #define BASS_CONFIG_NET_AGENT 16 #define BASS_CONFIG_NET_PROXY 17 #define BASS_CONFIG_IOS_NOTIFY 46 +#define BASS_CONFIG_LIBSSL 64 // BASS_Init flags #define BASS_DEVICE_8BITS 1 // 8 bit @@ -507,6 +511,7 @@ RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the st #define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream #define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream #define STREAMPROC_DEVICE (STREAMPROC*)-2 // device mix stream +#define STREAMPROC_DEVICE_3D (STREAMPROC*)-3 // device 3D mix stream // BASS_StreamCreateFileUser file systems #define STREAMFILE_NOBUFFER 0 @@ -561,6 +566,8 @@ user : The 'user' parameter value given when calling BASS_StreamCreateURL */ #define BASS_SYNC_MUSICINST 1 #define BASS_SYNC_MUSICFX 3 #define BASS_SYNC_OGG_CHANGE 12 +#define BASS_SYNC_DEV_FAIL 14 +#define BASS_SYNC_DEV_FORMAT 15 #define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime #define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously @@ -593,10 +600,11 @@ user : The 'user' parameter value given when calling BASS_RecordStart RETURN : TRUE = continue recording, FALSE = stop */ // BASS_ChannelIsActive return values -#define BASS_ACTIVE_STOPPED 0 -#define BASS_ACTIVE_PLAYING 1 -#define BASS_ACTIVE_STALLED 2 -#define BASS_ACTIVE_PAUSED 3 +#define BASS_ACTIVE_STOPPED 0 +#define BASS_ACTIVE_PLAYING 1 +#define BASS_ACTIVE_STALLED 2 +#define BASS_ACTIVE_PAUSED 3 +#define BASS_ACTIVE_PAUSED_DEVICE 4 // Channel attributes #define BASS_ATTRIB_FREQ 1 @@ -641,6 +649,7 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window #define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias #define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data +#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value // BASS_ChannelGetLevelEx flags #define BASS_LEVEL_MONO 1 @@ -1006,6 +1015,7 @@ float BASSDEF(BASS_GetCPU)(); BOOL BASSDEF(BASS_Start)(); BOOL BASSDEF(BASS_Stop)(); BOOL BASSDEF(BASS_Pause)(); +BOOL BASSDEF(BASS_IsStarted)(); BOOL BASSDEF(BASS_SetVolume)(float volume); float BASSDEF(BASS_GetVolume)(); -- cgit From 9bf41a714b6a46559bba23ea4fa4e0ad432d6997 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 29 Sep 2019 16:51:37 +0300 Subject: Bump up version numbers to 2.8.0 --- include/aoapplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 89bfaa26..af1433f8 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -392,8 +392,8 @@ public: private: const int RELEASE = 2; - const int MAJOR_VERSION = 6; - const int MINOR_VERSION = 2; + const int MAJOR_VERSION = 8; + const int MINOR_VERSION = 0; QString current_theme = "default"; -- cgit From 4f738bfe34695db745d251e9461823b8835de201 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 1 Oct 2019 01:07:03 +0300 Subject: Fix some read_file errors on effect loading Make FM packet only fetch music, and new FA packet to fetch areas (this way you don't have to reload the entire music list just to get new areas) Fix a possible segfault with emote lists if emote list size is bad Hide casing button if server doesn't support casing Hide the remove buttons by default for iniswaps and sfx list so they're not clickable when they shouldn't be Prevent background from being displayed unless the server asked us to Fix some redundancy surrounding current_side Rework music list so list_music doesn't care about search bar and the hiding is actually done in the search function Implement text centering, rightening and justifying Fix text scrolling meme that happened with \n and skipped chars Fix the pos dropdown not actually caring if you selected jur and sea pos. Fix the pos dropdown sending like a million packets when scrolled through. Prevent characters from being incorrectly resized if a different-scaled character speaks Fix character select screen letting you choose characters that the server doesn't want us to be --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 866a75f0..c680de06 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -149,7 +149,7 @@ public: void set_taken(int n_char, bool p_taken); //sets the current background to argument. also does some checks to see if it's a legacy bg - void set_background(QString p_background); + void set_background(QString p_background, bool display=false); //sets the local character pos/side to use. void set_side(QString p_side); -- cgit From 292c425c7895afcd8a545afa40dffefea803aabc Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 1 Oct 2019 04:58:57 +0300 Subject: Fix music volume being weird due to m_volume being shared by ambience and music at the same time Fix version= being wrong --- include/aomusicplayer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 9ce74852..15014afc 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -37,7 +37,7 @@ private: AOApplication *ao_app; bool m_looping = false; - int m_volume = 0; + int m_volume[4] = {0, 0, 0, 0}; // Channel 0 = music // Channel 1 = ambience -- cgit From 4c23e159350eeb3d74faf7e814f2874787e02565 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 2 Oct 2019 01:20:00 +0300 Subject: Rewrite pairing character ordering logic to instead operate based on a user-accessible drpodown menu (it's a dropdown for the future when there's more options) Fix current charmovie breaking offsets Make pairing offsets applicable even without a pairing partner, making it a generic offset Fix the chat message hardcoding max colors to 8 (when it should be max_colors) Come up with a way to convey the ordering information without creating an extra new packet in a cool way (backwards compatibility AND less clutter!) More info on the evidence_x and evidence_ok tooltips Don't mute music when you switch to CSS anymore --- include/courtroom.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index c680de06..aeef3caa 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -266,7 +266,10 @@ private: int other_charid = -1; // The offset this user has given if they want to appear alongside someone. - int offset_with_pair = 0; + int char_offset = 0; + + // 0 = in front, 1 = behind + int pair_order = 0; QVector char_list; QVector evidence_list; @@ -464,6 +467,8 @@ private: QListWidget *ui_pair_list; QSpinBox *ui_pair_offset_spinbox; + QComboBox *ui_pair_order_dropdown; + AOLineEdit *ui_ic_chat_message; QLineEdit *ui_ic_chat_name; @@ -672,6 +677,7 @@ private slots: void on_mute_clicked(); void on_pair_clicked(); + void on_pair_order_dropdown_changed(int p_index); void on_defense_minus_clicked(); void on_defense_plus_clicked(); -- cgit From e3ddc41cc8362fc17e803708826293d389413fc7 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 2 Oct 2019 20:28:42 +0300 Subject: Add rightclick context menus to sfx dropdown, iniswap dropdown and effects dropdown to open the ini's and respective folders try to fix settings menu (I failed) --- include/courtroom.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index aeef3caa..86a4ea79 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -55,6 +55,8 @@ #include #include #include +#include +#include //#include #include @@ -628,6 +630,9 @@ private slots: void on_music_search_edited(QString p_text); void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); + void on_music_list_context_menu_requested(const QPoint &pos); + void music_list_expand_all(); + void music_list_collapse_all(); void on_area_list_double_clicked(QModelIndex p_model); void select_emote(int p_id); @@ -642,13 +647,20 @@ private slots: void on_iniswap_dropdown_changed(int p_index); void set_iniswap_dropdown(); + void on_iniswap_context_menu_requested(const QPoint &pos); + void on_iniswap_edit_requested(); void on_iniswap_remove_clicked(); void on_sfx_dropdown_changed(int p_index); void set_sfx_dropdown(); + void on_sfx_context_menu_requested(const QPoint &pos); + void on_sfx_edit_requested(); void on_sfx_remove_clicked(); void set_effects_dropdown(); + void on_effects_context_menu_requested(const QPoint &pos); + void on_effects_edit_requested(); + void on_character_effects_edit_requested(); void on_effects_dropdown_changed(int p_index); bool effects_dropdown_find_and_set(QString effect); -- cgit From 829604e8089736945e8121cd134c3c3fcbf28291 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 3 Oct 2019 15:44:18 +0300 Subject: Positional evidence implemented. Click a button to change between private/global evidence list. There's also a button to transfer evidence to global/private, context sensitive. TODO: Save/load private evidence list --- include/courtroom.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 86a4ea79..9f3b659b 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -411,6 +411,11 @@ private: int max_emotes_on_page = 10; QVector local_evidence_list; + QVector private_evidence_list; + QVector global_evidence_list; + + //false = use private_evidence_list + bool current_evidence_global = true; int current_evidence_page = 0; int current_evidence = 0; @@ -563,6 +568,8 @@ private: AOButton *ui_evidence_image_button; AOButton *ui_evidence_x; AOButton *ui_evidence_ok; + AOButton *ui_evidence_switch; + AOButton *ui_evidence_transfer; AOTextEdit *ui_evidence_description; AOImage *ui_char_select_background; @@ -733,10 +740,13 @@ private slots: void on_evidence_delete_clicked(); void on_evidence_x_clicked(); void on_evidence_ok_clicked(); + void on_evidence_switch_clicked(); + void on_evidence_transfer_clicked(); void on_evidence_edited(); void evidence_close(); + void evidence_switch(bool global); bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); void on_back_to_lobby_clicked(); -- cgit From bdef10ace5e99ebd0ae09d0821cc2557b07defdd Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 3 Oct 2019 17:01:41 +0300 Subject: Remove /rainbow as clientside slash commands are cursed. I shall purge all clientside slash command memery soon... Fix /save_case iterating from last to first instead of first to last Implement private evidence saving/loading to and from an .ini file --- include/courtroom.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 9f3b659b..f72e106a 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -570,6 +570,8 @@ private: AOButton *ui_evidence_ok; AOButton *ui_evidence_switch; AOButton *ui_evidence_transfer; + AOButton *ui_evidence_save; + AOButton *ui_evidence_load; AOTextEdit *ui_evidence_description; AOImage *ui_char_select_background; @@ -747,6 +749,8 @@ private slots: void evidence_close(); void evidence_switch(bool global); + void on_evidence_save_clicked(); + void on_evidence_load_clicked(); bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); void on_back_to_lobby_clicked(); -- cgit From 9451822e0929643f638b3c79d4fd646df98b567a Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 3 Oct 2019 23:17:21 +0300 Subject: Fix move func making characters slowly move to the left every frame on animated chars which are sized differently from viewport Add a new get_qfont function Fix message box font being different from every other font due to incorrect font loading scheme Fix ui_evidence_save and ui_evidence_load tooltips being wrong --- include/courtroom.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index f72e106a..e8004154 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -127,6 +127,9 @@ public: //sets font size based on theme ini files void set_font(QWidget *widget, QString class_name, QString p_identifier); + //Get the properly constructed font + QFont get_qfont(QString font_name, int f_pointsize); + //actual operation of setting the font on a widget void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); -- cgit From 65332f209c9344e1d3f643ebca32a23dd6f31bdf Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 4 Oct 2019 14:41:33 +0300 Subject: fucking hell it's not accurate and doesn't match the absolute quality when it's played back in audacity jesus christ will the torture ever end --- include/aomusicplayer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 15014afc..1a91d8f4 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -25,8 +25,8 @@ public: const int m_channelmax = 4; //These have to be public for the stupid sync thing -// QWORD loop_start = 0; -// QWORD loop_end = 0; + QWORD loop_start = 0; + QWORD loop_end = 0; public slots: void play(QString p_song, int channel=0, bool crossfade=false); @@ -44,6 +44,7 @@ private: // Channel 2 = extra // Channel 3 = extra HSTREAM m_stream_list[4]; + HSYNC loop_sync[4]; }; #elif defined(QTAUDIO) class AOMusicPlayer -- cgit From 9f543f9ef7109340142134124e8bda6c9f750a18 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 5 Oct 2019 20:32:19 +0300 Subject: I HAVE CONQUERED BASS HELL BEHOLD, LOOP_START AND LOOP_END MUSIC POINTS! It reads the songname.mp3.txt file, looking for loop_start, loop_length and loop_end in samples MUSIC EFFECTS SYSTEM THAT CAN ***COMMUNICATE WITH THE SERVER***, WOAHHHHHHHHH! RIGHT-CLICK CONTEXT MENUS TO ENABLE/DISABLE SPECIFIC MUSIC EFFECTS MUSIC EFFECTS ENUMS Fix an issue with music looping --- include/aomusicplayer.h | 2 +- include/courtroom.h | 6 ++++++ include/datatypes.h | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 1a91d8f4..52c97c3e 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -29,7 +29,7 @@ public: QWORD loop_end = 0; public slots: - void play(QString p_song, int channel=0, bool crossfade=false); + void play(QString p_song, int channel=0, bool loop=false, int effect_flags=0); void stop(int channel=0); private: diff --git a/include/courtroom.h b/include/courtroom.h index e8004154..4b6ccc36 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -396,6 +396,9 @@ private: QString effect = ""; + //Music effect flags we want to send to server when we play music + int music_flags = 0; + int defense_bar_state = 0; int prosecution_bar_state = 0; @@ -643,6 +646,9 @@ private slots: void on_music_search_edited(QString p_text); void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); void on_music_list_context_menu_requested(const QPoint &pos); + void music_fade_out(bool toggle); + void music_fade_in(bool toggle); + void music_synchronize(bool toggle); void music_list_expand_all(); void music_list_collapse_all(); void on_area_list_double_clicked(QModelIndex p_model); diff --git a/include/datatypes.h b/include/datatypes.h index 835cf8f4..921f6135 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -110,4 +110,11 @@ enum CHAT_MESSAGE EFFECTS }; +enum MUSIC_EFFECT +{ + FADE_IN = 1, + FADE_OUT = 2, + SYNC_POS = 4 +}; + #endif // DATATYPES_H -- cgit From 91eeffb959fb59545d89116e67312e83468e0af1 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 6 Oct 2019 13:47:36 +0300 Subject: Courtroom Fonts can now have the "sharpness" setting (pixelated/no anti alias) --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 4b6ccc36..590fa0f9 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -128,7 +128,7 @@ public: void set_font(QWidget *widget, QString class_name, QString p_identifier); //Get the properly constructed font - QFont get_qfont(QString font_name, int f_pointsize); + QFont get_qfont(QString font_name, int f_pointsize, bool antialias=true); //actual operation of setting the font on a widget void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); -- cgit From a9a0f65ddb351797d8805b28fe18b1e5114dd708 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sat, 12 Oct 2019 17:57:18 +0300 Subject: Allow area list to contain metadata (as well as categories for future expansion) Fix backwards compatibility breaking when you join a server that doesn't support effects after previously joining a server that does --- include/courtroom.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 590fa0f9..ea841229 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -288,10 +288,6 @@ private: QVector ic_chatlog_history; - // These map music row items and area row items to their actual IDs. - QVector music_row_to_number; - QVector area_row_to_number; - //triggers ping_server() every 60 seconds QTimer *keepalive_timer; @@ -470,7 +466,7 @@ private: AOTextArea *ui_server_chatlog; QListWidget *ui_mute_list; - QListWidget *ui_area_list; + QTreeWidget *ui_area_list; QTreeWidget *ui_music_list; ScrollText *ui_music_name; @@ -651,7 +647,7 @@ private slots: void music_synchronize(bool toggle); void music_list_expand_all(); void music_list_collapse_all(); - void on_area_list_double_clicked(QModelIndex p_model); + void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); void select_emote(int p_id); -- cgit From 7d73347618719dc7b8bf0312ba5c782995c95e9f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 20 Oct 2019 17:59:38 +0300 Subject: Version 2.8.0.5 Add Killing Fever Online icon (mac icon not updated yet) --- include/lobby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index e0cd03da..f0c4227c 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -32,7 +32,7 @@ public: void append_chatmessage(QString f_name, QString f_message); void append_error(QString f_message); void set_player_count(int players_online, int max_players); - void set_stylesheet(QWidget *widget, QString target_tag); + void set_stylesheet(QWidget *widget); void set_stylesheets(); void set_fonts(); void set_font(QWidget *widget, QString p_identifier); -- cgit From 3595fd11e60fd07a2a6802150f4dff60cf6669fc Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 20 Oct 2019 18:35:28 +0300 Subject: oops --- include/lobby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index f0c4227c..e0cd03da 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -32,7 +32,7 @@ public: void append_chatmessage(QString f_name, QString f_message); void append_error(QString f_message); void set_player_count(int players_online, int max_players); - void set_stylesheet(QWidget *widget); + void set_stylesheet(QWidget *widget, QString target_tag); void set_stylesheets(); void set_fonts(); void set_font(QWidget *widget, QString p_identifier); -- cgit From bef368e98651fa01e743728a2a88783fdfab74ac Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 23 Oct 2019 05:08:20 +0300 Subject: Allow gender (blip sounds) that don't use sfx-blip naming convention Fix "prezoom" packet being ignored Allow char.ini's to indicate a zoom w/ preanimation by using emote_mod=4 ((ALL OF THESE ARE UNTESTED - TESTING NEEDED!)) --- include/aocharmovie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 8aed1eb8..15fa7cf4 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -67,7 +67,7 @@ private: QElapsedTimer actual_time; - //it will forever be a mystery who thought this time_mod system would ever be a good idea with precision-based emotes + //Usually used to turn seconds into milliseconds such as for [Time] tag in char.ini const int time_mod = 60; // These are the X and Y values before they are fixed based on the sprite's width. -- cgit From 773a61f3d4ce2284b2d5d753b5c696f7bd44a531 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 4 Nov 2019 15:32:01 +0300 Subject: Make the music search bar search in music metadata instead of just the displayed name (aka the filepath) Make sfx player able to play sfx without the file extension provided Allow blipsounds to seek in blips/ folder to allow better categorization, as well as direct sound references add get_emote_blip for detecting the blipsound used by an emote. Currently unused. Less strict/hardcoded custom objection detection system Allow system (charid -1) messages, and don't do the same message detection on blankposting Allow objection, hold it, take that and custom sound players to detect sounds that are not exclusively .wav --- include/aoapplication.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index af1433f8..8dd48c6a 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -335,6 +335,9 @@ public: //Returns the sfx of p_char's p_emote QString get_sfx_name(QString p_char, int p_emote); + //Returns the blipsound of p_char's p_emote + QString get_emote_blip(QString p_char, int p_emote); + //Returns if the sfx is defined as looping in char.ini QString get_sfx_looping(QString p_char, QString p_sfx); -- cgit From a49c4a503bcdfd09b9bbda3552e1598a4d147f40 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 4 Nov 2019 16:10:54 +0300 Subject: add .opus support --- include/aoblipplayer.h | 1 + include/aomusicplayer.h | 1 + include/aosfxplayer.h | 1 + include/bassopus.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 include/bassopus.h (limited to 'include') diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index 9a428371..a848e806 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -3,6 +3,7 @@ #if defined(BASSAUDIO) #include "bass.h" +#include "bassopus.h" #elif defined(QTAUDIO) #include #endif diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 52c97c3e..1a535828 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -4,6 +4,7 @@ #if defined(BASSAUDIO) #include "bass.h" +#include "bassopus.h" #elif defined(QTAUDIO) #include #endif diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 112e3ec6..3ae8bdf1 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -3,6 +3,7 @@ #if defined(BASSAUDIO) #include "bass.h" +#include "bassopus.h" #elif defined(QTAUDIO) #include #endif diff --git a/include/bassopus.h b/include/bassopus.h new file mode 100644 index 00000000..4e48124f --- /dev/null +++ b/include/bassopus.h @@ -0,0 +1,52 @@ +/* + BASSOPUS 2.4 C/C++ header file + Copyright (c) 2012-2015 Un4seen Developments Ltd. + + See the BASSOPUS.CHM file for more detailed documentation +*/ + +#ifndef BASSOPUS_H +#define BASSOPUS_H + +#include "bass.h" + +#if BASSVERSION!=0x204 +#error conflicting BASS and BASSOPUS versions +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef BASSOPUSDEF +#define BASSOPUSDEF(f) WINAPI f +#endif + +// BASS_CHANNELINFO type +#define BASS_CTYPE_STREAM_OPUS 0x11200 + +// Additional attributes +#define BASS_ATTRIB_OPUS_ORIGFREQ 0x13000 +#define BASS_ATTRIB_OPUS_GAIN 0x13001 + +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user); + +#ifdef __cplusplus +} + +#if defined(_WIN32) && !defined(NOBASSOVERLOADS) +static inline HSTREAM BASS_OPUS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_OPUS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_OPUS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_OPUS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); +} +#endif +#endif + +#endif -- cgit From 159f073514e2f60fd2229f21f7a536ffaddecfc2 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 21 Nov 2019 00:23:35 +0300 Subject: Set version to 2.8.1 woop woop --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 8dd48c6a..fe1a5b75 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -396,7 +396,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 0; + const int MINOR_VERSION = 1; QString current_theme = "default"; -- cgit From eb014a97785db4a196d41fb38ee61612a54e0f6e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 5 Dec 2019 22:46:26 +0300 Subject: Add a message delay modifier when punctuation is reached to simulate Ace Attorney 1 chat parsing (replicating the effect where characters would make a short pause, as if saying the line out loud) TODO: Make this a configurable thing --- include/courtroom.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index ea841229..6bca28e4 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -332,6 +332,12 @@ private: //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms const int wtce_stay_time = 1500; + //characters we consider punctuation + const QString punctuation_chars = ".,?!:;"; + + //amount by which we multiply the delay when we parse punctuation chars + const int punctuation_modifier = 3; + static const int chatmessage_size = 30; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; -- cgit From 6138bb107b5ab4d882e9ceb75e1394c2b8ec82a3 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 15 Jan 2020 16:42:44 +0300 Subject: Separate screenshake options button from effects options button Add a color logging option button Update version to 2.8.2 --- include/aoapplication.h | 14 +++++++++++--- include/aooptionsdialog.h | 9 +++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index fe1a5b75..0ab6831b 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -172,14 +172,22 @@ public: // from the config.ini. bool is_discord_enabled(); - // Returns the value of whether shaking and flashing should be enabled. + // Returns the value of whether shaking should be enabled. // from the config.ini. - bool is_shake_flash_enabled(); + bool is_shake_enabled(); + + // Returns the value of whether effects should be enabled. + // from the config.ini. + bool is_effects_enabled(); // Returns the value of whether frame-specific effects defined in char.ini should be sent/received over the network. // from the config.ini. bool is_frame_network_enabled(); + // Returns the value of whether colored ic log should be a thing. + // from the config.ini. + bool is_colorlog_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); @@ -396,7 +404,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 1; + const int MINOR_VERSION = 2; QString current_theme = "default"; diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 51984106..9e34e651 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -65,11 +65,16 @@ private: QLabel *ui_language_label; QComboBox *ui_language_combobox; - QLabel *ui_epilepsy_lbl; - QCheckBox *ui_epilepsy_cb; + QLabel *ui_shake_lbl; + QCheckBox *ui_shake_cb; + QLabel *ui_effects_lbl; + QCheckBox *ui_effects_cb; QLabel *ui_framenetwork_lbl; QCheckBox *ui_framenetwork_cb; + QLabel *ui_colorlog_lbl; + QCheckBox *ui_colorlog_cb; + QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; QVBoxLayout *ui_callwords_layout; -- cgit From 43c4e3e9d703a0b7d48b634d6970906dcb5709b2 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 17 Jan 2020 18:41:27 +0300 Subject: Network effects folder so you don't need to modify your own char.ini to see custom effects --- include/aoapplication.h | 2 +- include/courtroom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 0ab6831b..9f110874 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -317,7 +317,7 @@ public: QStringList get_effects(QString p_char); //t - QString get_effect(QString effect, QString p_char); + QString get_effect(QString effect, QString p_char, QString p_folder); //Return the effect sound associated with the fx_name in the misc/effects//sounds.ini, or theme/effects/sounds.ini. QString get_effect_sound(QString fx_name, QString p_char); diff --git a/include/courtroom.h b/include/courtroom.h index 6bca28e4..d2044172 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -625,7 +625,7 @@ public slots: void preanim_done(); void do_screenshake(); void do_flash(); - void do_effect(QString fx_path, QString fx_sound, QString p_char); + void do_effect(QString fx_path, QString fx_sound, QString p_char, QString p_folder); void play_char_sfx(QString sfx_name); void mod_called(QString p_ip); -- cgit From a4e448576b43b9cf4f984253abb3daf7296aa154 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 24 Feb 2020 22:20:43 +0300 Subject: Make pos dropdown more abstract and actually useful by letting servers send only pos you can actually access. Pos dropdown system also reads the actual bg folder of the current BG to see all the created pos. --- include/courtroom.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index d2044172..417d4557 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -159,6 +159,9 @@ public: //sets the local character pos/side to use. void set_side(QString p_side); + //sets the pos dropdown + void set_pos_dropdown(QStringList pos_dropdowns); + //sets the evidence list member variable to argument void set_evidence_list(QVector &p_evi_list); @@ -394,6 +397,9 @@ private: QVector color_markdown_talking_list; //Text Color-related optimization END + //List of all currently available pos + QStringList pos_dropdown_list; + bool is_presenting_evidence = false; QString effect = ""; -- cgit From 39f9d1043e7f362275a189d71066ca642753f86f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 5 Mar 2020 21:23:42 +0300 Subject: Add sorting by name for lobby --- include/lobby.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/lobby.h b/include/lobby.h index e0cd03da..4b95fb2f 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -64,7 +65,7 @@ private: QLabel *ui_version; AOButton *ui_about; - QListWidget *ui_server_list; + QTreeWidget *ui_server_list; QLabel *ui_player_count; AOTextArea *ui_description; @@ -79,7 +80,7 @@ private: QProgressBar *ui_progress_bar; AOButton *ui_cancel; - QModelIndex last_model; + int last_index; void set_size_and_pos(QWidget *p_widget, QString p_identifier); @@ -94,8 +95,8 @@ private slots: void on_connect_pressed(); void on_connect_released(); void on_about_clicked(); - void on_server_list_clicked(QModelIndex p_model); - void on_server_list_doubleclicked(QModelIndex p_model); + void on_server_list_clicked(QTreeWidgetItem* p_item, int column); + void on_server_list_doubleclicked(QTreeWidgetItem* p_item, int column); void on_chatfield_return_pressed(); }; -- cgit From 7aa24bf50158b3a93c17c56e1371b72389238185 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Mar 2020 18:09:56 +0300 Subject: Add a search bar for server list Add options for sticky sounds, sticky effects and sticky preanims Optimize the search for areas and music (previously, area search also searched for music in the background, causing lag with huge music lists) --- include/aoapplication.h | 12 ++++++++++++ include/aooptionsdialog.h | 9 +++++++++ include/lobby.h | 2 ++ 3 files changed, 23 insertions(+) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 9f110874..3ed70463 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -188,6 +188,18 @@ public: // from the config.ini. bool is_colorlog_enabled(); + // Returns the value of whether sticky sounds should be a thing. + // from the config.ini. + bool is_stickysounds_enabled(); + + // Returns the value of whether sticky effects should be a thing. + // from the config.ini. + bool is_stickyeffects_enabled(); + + // Returns the value of whether sticky preanims should be a thing. + // from the config.ini. + bool is_stickypres_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 9e34e651..4a63ca35 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -75,6 +75,15 @@ private: QLabel *ui_colorlog_lbl; QCheckBox *ui_colorlog_cb; + QLabel *ui_stickysounds_lbl; + QCheckBox *ui_stickysounds_cb; + + QLabel *ui_stickyeffects_lbl; + QCheckBox *ui_stickyeffects_cb; + + QLabel *ui_stickypres_lbl; + QCheckBox *ui_stickypres_cb; + QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; QVBoxLayout *ui_callwords_layout; diff --git a/include/lobby.h b/include/lobby.h index 4b95fb2f..10a7c1d5 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -66,6 +66,7 @@ private: AOButton *ui_about; QTreeWidget *ui_server_list; + QLineEdit *ui_server_search; QLabel *ui_player_count; AOTextArea *ui_description; @@ -97,6 +98,7 @@ private slots: void on_about_clicked(); void on_server_list_clicked(QTreeWidgetItem* p_item, int column); void on_server_list_doubleclicked(QTreeWidgetItem* p_item, int column); + void on_server_search_edited(QString p_text); void on_chatfield_return_pressed(); }; -- cgit From 4c8bf57268c09c298edc3f3695e4a2ede84643ac Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 12 Mar 2020 18:34:51 +0300 Subject: VERSION 2.8.3 BABYYYYYYYY Add "KFO" to version display in lobby so it's even clearer this is a custom client Add a settings button to the Lobby screen --- include/aoapplication.h | 2 +- include/lobby.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 3ed70463..8b520bc4 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -416,7 +416,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 2; + const int MINOR_VERSION = 3; QString current_theme = "default"; diff --git a/include/lobby.h b/include/lobby.h index 10a7c1d5..a969f865 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -65,6 +65,8 @@ private: QLabel *ui_version; AOButton *ui_about; + AOButton *ui_settings; + QTreeWidget *ui_server_list; QLineEdit *ui_server_search; @@ -96,6 +98,7 @@ private slots: void on_connect_pressed(); void on_connect_released(); void on_about_clicked(); + void on_settings_clicked(); void on_server_list_clicked(QTreeWidgetItem* p_item, int column); void on_server_list_doubleclicked(QTreeWidgetItem* p_item, int column); void on_server_search_edited(QString p_text); -- cgit From 1634db78641526ddb88f844a46b1bdc615a89e59 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Thu, 26 Mar 2020 14:41:56 +0300 Subject: Make backgrounds preserve aspect ratio when used with different aspect ratio themes (e.g. a 16:9 theme would not stretch a 4:3 bg and instead have a letterboxing effect. A 4:3 theme using a 16:9 BG will not stretch the BG but instead center it, making it look like the BG is 4:3 all along.) --- include/aoscene.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/aoscene.h b/include/aoscene.h index ddbefe08..46d8c3b8 100644 --- a/include/aoscene.h +++ b/include/aoscene.h @@ -17,12 +17,23 @@ public: void set_image(QString p_image); void set_legacy_desk(QString p_image); + //Move the label itself around + void move(int ax, int ay); + + //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of + void combo_resize(int w, int h); private: QWidget *m_parent; QMovie *m_movie; AOApplication *ao_app; QString last_image; + // These are the X and Y values before they are fixed based on the sprite's width. + int x = 0; + int y = 0; + // These are the width and height values before they are fixed based on the sprite's width. + int f_w = 0; + int f_h = 0; }; #endif // AOSCENE_H -- cgit From 8007b1d1b95d476821a6b2616c09824e54911ea9 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 31 Mar 2020 18:12:15 +0300 Subject: Add courtroom_design.ini partial parsing for misc/ folder (only chat_arrow and showname atm) Initialize chat arrow n stuff this is still pretty gay because you can't ignore size and set pos or something like that --- include/aoapplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 8b520bc4..e44f2d3c 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -248,10 +248,10 @@ public: QPoint get_button_spacing(QString p_identifier, QString p_file); //Returns the dimensions of widget with specified identifier from p_file - pos_size_type get_element_dimensions(QString p_identifier, QString p_file); + pos_size_type get_element_dimensions(QString p_identifier, QString p_file, QString p_char=""); //Returns the value to you - QString get_design_element(QString p_identifier, QString p_file); + QString get_design_element(QString p_identifier, QString p_file, QString p_char=""); //Returns the name of the font with p_identifier from p_file QString get_font_name(QString p_identifier, QString p_file); -- cgit From dfac0652c8eb9bd48ceea7ae755e9c2f7e5cb1a2 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Mon, 13 Apr 2020 17:16:26 +0300 Subject: Add possibility for custom use text besides just "played music" Implemented "presented evidence" message --- include/courtroom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 417d4557..c1bd0a64 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -221,7 +221,7 @@ public: //adds text to the IC chatlog. p_name first as bold then p_text then a newlin //this function keeps the chatlog scrolled to the top unless there's text selected // or the user isn't already scrolled to the top - void append_ic_text(QString p_text, QString p_name = "", bool is_songchange = false); + void append_ic_text(QString p_text, QString p_name = "", QString action = ""); //prints who played the song to IC chat and plays said song(if found on local filesystem) //takes in a list where the first element is the song name and the second is the char id of who played it -- cgit From c8e12558cdd3fd0769b81679ad09edf1f29b780f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 01:18:24 +0300 Subject: Clang-ify the code with this styling using Visual Studio Code: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup) --- include/aoapplication.h | 561 +++++++------- include/aoblipplayer.h | 40 +- include/aobutton.h | 15 +- include/aocaseannouncerdialog.h | 41 +- include/aocharbutton.h | 37 +- include/aocharmovie.h | 144 ++-- include/aoemotebutton.h | 27 +- include/aoevidencebutton.h | 43 +- include/aoevidencedisplay.h | 29 +- include/aoimage.h | 19 +- include/aolineedit.h | 17 +- include/aomovie.h | 29 +- include/aomusicplayer.h | 79 +- include/aooptionsdialog.h | 5 +- include/aopacket.h | 31 +- include/aoscene.h | 44 +- include/aosfxplayer.h | 50 +- include/aotextarea.h | 21 +- include/aotextedit.h | 14 +- include/bass.h | 1542 +++++++++++++++++++-------------------- include/bassopus.h | 12 +- include/chatlogpiece.h | 35 +- include/courtroom.h | 1127 ++++++++++++++-------------- include/datatypes.h | 178 +++-- include/debug_functions.h | 2 +- include/discord-rpc.h | 48 +- include/discord_register.h | 24 +- include/discord_rich_presence.h | 42 +- include/discord_rpc.h | 52 +- include/encryption_functions.h | 6 +- include/file_functions.h | 2 +- include/hex_functions.h | 11 +- include/lobby.h | 139 ++-- include/misc_functions.h | 2 +- include/networkmanager.h | 73 +- include/scrolltext.h | 11 +- include/text_file_functions.h | 8 +- 37 files changed, 2256 insertions(+), 2304 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index e44f2d3c..ff75e4d1 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -6,23 +6,23 @@ #include "discord_rich_presence.h" #include -#include #include #include +#include #include -#include #include +#include #include #include #include -#include -#include #include #include +#include +#include #ifdef QTAUDIO #include #endif @@ -31,404 +31,403 @@ class NetworkManager; class Lobby; class Courtroom; -class AOApplication : public QApplication -{ - Q_OBJECT +class AOApplication : public QApplication { + Q_OBJECT public: - AOApplication(int &argc, char **argv); - ~AOApplication(); + AOApplication(int &argc, char **argv); + ~AOApplication(); - NetworkManager *net_manager; - Lobby *w_lobby; - Courtroom *w_courtroom; - AttorneyOnline::Discord *discord; + NetworkManager *net_manager; + Lobby *w_lobby; + Courtroom *w_courtroom; + AttorneyOnline::Discord *discord; - bool lobby_constructed = false; - bool courtroom_constructed = false; + bool lobby_constructed = false; + bool courtroom_constructed = false; - void construct_lobby(); - void destruct_lobby(); + void construct_lobby(); + void destruct_lobby(); - void construct_courtroom(); - void destruct_courtroom(); + void construct_courtroom(); + void destruct_courtroom(); - void ms_packet_received(AOPacket *p_packet); - void server_packet_received(AOPacket *p_packet); + void ms_packet_received(AOPacket *p_packet); + void server_packet_received(AOPacket *p_packet); - void send_ms_packet(AOPacket *p_packet); - void send_server_packet(AOPacket *p_packet, bool encoded = true); + void send_ms_packet(AOPacket *p_packet); + void send_server_packet(AOPacket *p_packet, bool encoded = true); - void call_settings_menu(); - void call_announce_menu(Courtroom *court); + void call_settings_menu(); + void call_announce_menu(Courtroom *court); - /////////////////server metadata////////////////// + /////////////////server metadata////////////////// - unsigned int s_decryptor = 5; - bool encryption_needed = true; + unsigned int s_decryptor = 5; + bool encryption_needed = true; - bool yellow_text_enabled = false; - bool prezoom_enabled = false; - bool flipping_enabled = false; - bool custom_objection_enabled = false; - bool improved_loading_enabled = false; - bool desk_mod_enabled = false; - bool evidence_enabled = false; - bool cccc_ic_support_enabled = false; - bool arup_enabled = false; - bool casing_alerts_enabled = false; - bool modcall_reason_enabled = false; - bool looping_sfx_support_enabled = false; - bool additive_enabled = false; - bool effects_enabled = false; + bool yellow_text_enabled = false; + bool prezoom_enabled = false; + bool flipping_enabled = false; + bool custom_objection_enabled = false; + bool improved_loading_enabled = false; + bool desk_mod_enabled = false; + bool evidence_enabled = false; + bool cccc_ic_support_enabled = false; + bool arup_enabled = false; + bool casing_alerts_enabled = false; + bool modcall_reason_enabled = false; + bool looping_sfx_support_enabled = false; + bool additive_enabled = false; + bool effects_enabled = false; - ///////////////loading info/////////////////// + ///////////////loading info/////////////////// - //player number, it's hardly used but might be needed for some old servers - int s_pv = 0; + //player number, it's hardly used but might be needed for some old servers + int s_pv = 0; - QString server_software = ""; + QString server_software = ""; - int char_list_size = 0; - int loaded_chars = 0; - int generated_chars = 0; - int evidence_list_size = 0; - int loaded_evidence = 0; - int music_list_size = 0; - int loaded_music = 0; + int char_list_size = 0; + int loaded_chars = 0; + int generated_chars = 0; + int evidence_list_size = 0; + int loaded_evidence = 0; + int music_list_size = 0; + int loaded_music = 0; - bool courtroom_loaded = false; + bool courtroom_loaded = false; - //////////////////versioning/////////////// + //////////////////versioning/////////////// - int get_release() const { return RELEASE; } - int get_major_version() const { return MAJOR_VERSION; } - int get_minor_version() const { return MINOR_VERSION; } - QString get_version_string(); + int get_release() const { return RELEASE; } + int get_major_version() const { return MAJOR_VERSION; } + int get_minor_version() const { return MINOR_VERSION; } + QString get_version_string(); - /////////////////////////////////////////// + /////////////////////////////////////////// - void set_favorite_list(); - QVector& get_favorite_list() {return favorite_list;} - void add_favorite_server(int p_server); + void set_favorite_list(); + QVector &get_favorite_list() { return favorite_list; } + void add_favorite_server(int p_server); - void set_server_list(); - QVector& get_server_list() {return server_list;} + void set_server_list(); + QVector &get_server_list() { return server_list; } - //reads the theme from config.ini and sets it accordingly - void reload_theme(); + //reads the theme from config.ini and sets it accordingly + void reload_theme(); - //Returns the character the player has currently selected - QString get_current_char(); + //Returns the character the player has currently selected + QString get_current_char(); - //implementation in path_functions.cpp - QString get_base_path(); - QString get_data_path(); - QString get_theme_path(QString p_file); - QString get_default_theme_path(QString p_file); - QString get_custom_theme_path(QString p_theme, QString p_file); - QString get_character_path(QString p_char, QString p_file); - QString get_sounds_path(QString p_file); - QString get_music_path(QString p_song); - QString get_background_path(QString p_file); - QString get_default_background_path(QString p_file); - QString get_evidence_path(QString p_file); - QString get_case_sensitive_path(QString p_file); + //implementation in path_functions.cpp + QString get_base_path(); + QString get_data_path(); + QString get_theme_path(QString p_file); + QString get_default_theme_path(QString p_file); + QString get_custom_theme_path(QString p_theme, QString p_file); + QString get_character_path(QString p_char, QString p_file); + QString get_sounds_path(QString p_file); + QString get_music_path(QString p_song); + QString get_background_path(QString p_file); + QString get_default_background_path(QString p_file); + QString get_evidence_path(QString p_file); + QString get_case_sensitive_path(QString p_file); - ////// Functions for reading and writing files ////// - // Implementations file_functions.cpp + ////// Functions for reading and writing files ////// + // Implementations file_functions.cpp - // Instead of reinventing the wheel, we'll use a QSettings class. - QSettings *configini; + // Instead of reinventing the wheel, we'll use a QSettings class. + QSettings *configini; - //Reads the theme from config.ini and loads it into the current_theme variable - QString read_theme(); + //Reads the theme from config.ini and loads it into the current_theme variable + QString read_theme(); - //Returns the value of ooc_name in config.ini - QString get_ooc_name(); + //Returns the value of ooc_name in config.ini + QString get_ooc_name(); - //Returns the blip rate from config.ini (once per X symbols) - int read_blip_rate(); + //Returns the blip rate from config.ini (once per X symbols) + int read_blip_rate(); - //Returns true if blank blips is enabled in config.ini and false otherwise - bool get_blank_blip(); + //Returns true if blank blips is enabled in config.ini and false otherwise + bool get_blank_blip(); - //Returns true if looping sound effects are enabled in the config.ini - bool get_looping_sfx(); + //Returns true if looping sound effects are enabled in the config.ini + bool get_looping_sfx(); - //Returns true if stop music on objection is enabled in the config.ini - bool objection_stop_music(); + //Returns true if stop music on objection is enabled in the config.ini + bool objection_stop_music(); - //Returns the value of default_music in config.ini - int get_default_music(); + //Returns the value of default_music in config.ini + int get_default_music(); - //Returns the value of default_sfx in config.ini - int get_default_sfx(); + //Returns the value of default_sfx in config.ini + int get_default_sfx(); - //Returns the value of default_blip in config.ini - int get_default_blip(); + //Returns the value of default_blip in config.ini + int get_default_blip(); - // Returns the value of whether Discord should be enabled on startup - // from the config.ini. - bool is_discord_enabled(); + // Returns the value of whether Discord should be enabled on startup + // from the config.ini. + bool is_discord_enabled(); - // Returns the value of whether shaking should be enabled. - // from the config.ini. - bool is_shake_enabled(); + // Returns the value of whether shaking should be enabled. + // from the config.ini. + bool is_shake_enabled(); - // Returns the value of whether effects should be enabled. - // from the config.ini. - bool is_effects_enabled(); + // Returns the value of whether effects should be enabled. + // from the config.ini. + bool is_effects_enabled(); - // Returns the value of whether frame-specific effects defined in char.ini should be sent/received over the network. - // from the config.ini. - bool is_frame_network_enabled(); + // Returns the value of whether frame-specific effects defined in char.ini should be sent/received over the network. + // from the config.ini. + bool is_frame_network_enabled(); - // Returns the value of whether colored ic log should be a thing. - // from the config.ini. - bool is_colorlog_enabled(); + // Returns the value of whether colored ic log should be a thing. + // from the config.ini. + bool is_colorlog_enabled(); - // Returns the value of whether sticky sounds should be a thing. - // from the config.ini. - bool is_stickysounds_enabled(); + // Returns the value of whether sticky sounds should be a thing. + // from the config.ini. + bool is_stickysounds_enabled(); - // Returns the value of whether sticky effects should be a thing. - // from the config.ini. - bool is_stickyeffects_enabled(); + // Returns the value of whether sticky effects should be a thing. + // from the config.ini. + bool is_stickyeffects_enabled(); - // Returns the value of whether sticky preanims should be a thing. - // from the config.ini. - bool is_stickypres_enabled(); + // Returns the value of whether sticky preanims should be a thing. + // from the config.ini. + bool is_stickypres_enabled(); - // Returns the value of the maximum amount of lines the IC chatlog - // may contain, from config.ini. - int get_max_log_size(); + // Returns the value of the maximum amount of lines the IC chatlog + // may contain, from config.ini. + int get_max_log_size(); - // Returns whether the log should go upwards (new behaviour) - // or downwards (vanilla behaviour). - bool get_log_goes_downwards(); + // Returns whether the log should go upwards (new behaviour) + // or downwards (vanilla behaviour). + bool get_log_goes_downwards(); - // Returns the username the user may have set in config.ini. - QString get_default_username(); + // Returns the username the user may have set in config.ini. + QString get_default_username(); - // Returns the audio device used for the client. - QString get_audio_output_device(); - #ifdef QTAUDIO - QAudioDeviceInfo QtAudioDevice; - #endif + // Returns the audio device used for the client. + QString get_audio_output_device(); +#ifdef QTAUDIO + QAudioDeviceInfo QtAudioDevice; +#endif - // Returns whether the user would like to have custom shownames on by default. - bool get_showname_enabled_by_default(); + // Returns whether the user would like to have custom shownames on by default. + bool get_showname_enabled_by_default(); - //Returns the list of words in callwords.ini - QStringList get_call_words(); + //Returns the list of words in callwords.ini + QStringList get_call_words(); - //returns all of the file's lines in a QStringList - QStringList get_list_file(QString p_file); + //returns all of the file's lines in a QStringList + QStringList get_list_file(QString p_file); - //Process a file and return its text as a QString - QString read_file(QString filename); + //Process a file and return its text as a QString + QString read_file(QString filename); - //Write text to file. make_dir would auto-create the directory if it doesn't exist. - bool write_to_file(QString p_text, QString p_file, bool make_dir = false); + //Write text to file. make_dir would auto-create the directory if it doesn't exist. + bool write_to_file(QString p_text, QString p_file, bool make_dir = false); - //Append text to the end of the file. make_dir would auto-create the directory if it doesn't exist. - bool append_to_file(QString p_text, QString p_file, bool make_dir = false); + //Append text to the end of the file. make_dir would auto-create the directory if it doesn't exist. + bool append_to_file(QString p_text, QString p_file, bool make_dir = false); - //Appends the argument string to serverlist.txt - void write_to_serverlist_txt(QString p_line); + //Appends the argument string to serverlist.txt + void write_to_serverlist_txt(QString p_line); - //Returns the contents of serverlist.txt - QVector read_serverlist_txt(); + //Returns the contents of serverlist.txt + QVector read_serverlist_txt(); - //Returns the value of p_identifier in the design.ini file in p_design_path - QString read_design_ini(QString p_identifier, QString p_design_path); + //Returns the value of p_identifier in the design.ini file in p_design_path + QString read_design_ini(QString p_identifier, QString p_design_path); - //Returns the coordinates of widget with p_identifier from p_file - QPoint get_button_spacing(QString p_identifier, QString p_file); + //Returns the coordinates of widget with p_identifier from p_file + QPoint get_button_spacing(QString p_identifier, QString p_file); - //Returns the dimensions of widget with specified identifier from p_file - pos_size_type get_element_dimensions(QString p_identifier, QString p_file, QString p_char=""); + //Returns the dimensions of widget with specified identifier from p_file + pos_size_type get_element_dimensions(QString p_identifier, QString p_file, QString p_char = ""); - //Returns the value to you - QString get_design_element(QString p_identifier, QString p_file, QString p_char=""); + //Returns the value to you + QString get_design_element(QString p_identifier, QString p_file, QString p_char = ""); - //Returns the name of the font with p_identifier from p_file - QString get_font_name(QString p_identifier, QString p_file); + //Returns the name of the font with p_identifier from p_file + QString get_font_name(QString p_identifier, QString p_file); - //Returns the value of font_size with p_identifier from p_file - int get_font_size(QString p_identifier, QString p_file); + //Returns the value of font_size with p_identifier from p_file + int get_font_size(QString p_identifier, QString p_file); - //Returns the color with p_identifier from p_file - QColor get_color(QString p_identifier, QString p_file); + //Returns the color with p_identifier from p_file + QColor get_color(QString p_identifier, QString p_file); - // Returns the markdown symbol used for specified p_identifier such as colors - QString get_chat_markdown(QString p_identifier, QString p_file); + // Returns the markdown symbol used for specified p_identifier such as colors + QString get_chat_markdown(QString p_identifier, QString p_file); - // Returns the color from the misc folder. - QColor get_chat_color(QString p_identifier, QString p_chat); + // Returns the color from the misc folder. + QColor get_chat_color(QString p_identifier, QString p_chat); - //Returns the sfx with p_identifier from sounds.ini in the current theme path - QString get_sfx(QString p_identifier); + //Returns the sfx with p_identifier from sounds.ini in the current theme path + QString get_sfx(QString p_identifier); - //Figure out if we can opus this or if we should fall back to wav - QString get_sfx_suffix(QString sound_to_check); + //Figure out if we can opus this or if we should fall back to wav + QString get_sfx_suffix(QString sound_to_check); - // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to PNG. - QString get_image_suffix(QString path_to_check); + // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to PNG. + QString get_image_suffix(QString path_to_check); - // If this image is static and non-animated, return the supported static image formats. Currently only PNG. - QString get_static_image_suffix(QString path_to_check); + // If this image is static and non-animated, return the supported static image formats. Currently only PNG. + QString get_static_image_suffix(QString path_to_check); - //Returns the value of p_search_line within target_tag and terminator_tag - QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); + //Returns the value of p_search_line within target_tag and terminator_tag + QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); - //Returns a QStringList of all key=value definitions on a given tag. - QStringList read_ini_tags(QString p_file, QString target_tag = ""); + //Returns a QStringList of all key=value definitions on a given tag. + QStringList read_ini_tags(QString p_file, QString target_tag = ""); - //Sets the char.ini p_search_line key under tag target_tag to value. - void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); + //Sets the char.ini p_search_line key under tag target_tag to value. + void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); - //Returns the text between target_tag and terminator_tag in p_file - QString get_stylesheet(QString p_file); + //Returns the text between target_tag and terminator_tag in p_file + QString get_stylesheet(QString p_file); - //Returns the text between target_tag and terminator_tag in p_file - QString get_tagged_stylesheet(QString target_tag, QString p_file); + //Returns the text between target_tag and terminator_tag in p_file + QString get_tagged_stylesheet(QString target_tag, QString p_file); - //Returns the side of the p_char character from that characters ini file - QString get_char_side(QString p_char); + //Returns the side of the p_char character from that characters ini file + QString get_char_side(QString p_char); - //Returns the showname from the ini of p_char - QString get_showname(QString p_char); + //Returns the showname from the ini of p_char + QString get_showname(QString p_char); - //Returns the value of chat image from the specific p_char's ini file - QString get_chat(QString p_char); + //Returns the value of chat image from the specific p_char's ini file + QString get_chat(QString p_char); - //Returns the value of chat font from the specific p_char's ini file - QString get_chat_font(QString p_char); + //Returns the value of chat font from the specific p_char's ini file + QString get_chat_font(QString p_char); - //Returns the value of chat font size from the specific p_char's ini file - int get_chat_size(QString p_char); + //Returns the value of chat font size from the specific p_char's ini file + int get_chat_size(QString p_char); - //Returns the value of shouts from the specified p_char's ini file - QString get_char_shouts(QString p_char); + //Returns the value of shouts from the specified p_char's ini file + QString get_char_shouts(QString p_char); - //Returns the preanim duration of p_char's p_emote - int get_preanim_duration(QString p_char, QString p_emote); + //Returns the preanim duration of p_char's p_emote + int get_preanim_duration(QString p_char, QString p_emote); - //Same as above, but only returns if it has a % in front(refer to Preanims section in the manual) - int get_ao2_preanim_duration(QString p_char, QString p_emote); + //Same as above, but only returns if it has a % in front(refer to Preanims section in the manual) + int get_ao2_preanim_duration(QString p_char, QString p_emote); - //Not in use - int get_text_delay(QString p_char, QString p_emote); + //Not in use + int get_text_delay(QString p_char, QString p_emote); - //Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string - QStringList get_theme_effects(); + //Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string + QStringList get_theme_effects(); - //Get the theme's effects folder, read it and return the list of filenames in a string - QStringList get_effects(QString p_char); + //Get the theme's effects folder, read it and return the list of filenames in a string + QStringList get_effects(QString p_char); - //t - QString get_effect(QString effect, QString p_char, QString p_folder); + //t + QString get_effect(QString effect, QString p_char, QString p_folder); - //Return the effect sound associated with the fx_name in the misc/effects//sounds.ini, or theme/effects/sounds.ini. - QString get_effect_sound(QString fx_name, QString p_char); + //Return the effect sound associated with the fx_name in the misc/effects//sounds.ini, or theme/effects/sounds.ini. + QString get_effect_sound(QString fx_name, QString p_char); - // Returns the custom realisation used by the character. - QString get_custom_realization(QString p_char); + // Returns the custom realisation used by the character. + QString get_custom_realization(QString p_char); - //Returns the name of p_char - QString get_char_name(QString p_char); + //Returns the name of p_char + QString get_char_name(QString p_char); - //Returns the total amount of emotes of p_char - int get_emote_number(QString p_char); + //Returns the total amount of emotes of p_char + int get_emote_number(QString p_char); - //Returns the emote comment of p_char's p_emote - QString get_emote_comment(QString p_char, int p_emote); + //Returns the emote comment of p_char's p_emote + QString get_emote_comment(QString p_char, int p_emote); - //Returns the base name of p_char's p_emote - QString get_emote(QString p_char, int p_emote); + //Returns the base name of p_char's p_emote + QString get_emote(QString p_char, int p_emote); - //Returns the preanimation name of p_char's p_emote - QString get_pre_emote(QString p_char, int p_emote); + //Returns the preanimation name of p_char's p_emote + QString get_pre_emote(QString p_char, int p_emote); - //Returns the sfx of p_char's p_emote - QString get_sfx_name(QString p_char, int p_emote); + //Returns the sfx of p_char's p_emote + QString get_sfx_name(QString p_char, int p_emote); - //Returns the blipsound of p_char's p_emote - QString get_emote_blip(QString p_char, int p_emote); + //Returns the blipsound of p_char's p_emote + QString get_emote_blip(QString p_char, int p_emote); - //Returns if the sfx is defined as looping in char.ini - QString get_sfx_looping(QString p_char, QString p_sfx); + //Returns if the sfx is defined as looping in char.ini + QString get_sfx_looping(QString p_char, QString p_sfx); - //Returns if an emote has a frame specific SFX for it - QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); + //Returns if an emote has a frame specific SFX for it + QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); - //Returns if an emote has a frame specific SFX for it - QString get_flash_frame(QString p_char, QString p_emote, int n_frame); + //Returns if an emote has a frame specific SFX for it + QString get_flash_frame(QString p_char, QString p_emote, int n_frame); - //Returns if an emote has a frame specific SFX for it - QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); + //Returns if an emote has a frame specific SFX for it + QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); - //Not in use - int get_sfx_delay(QString p_char, int p_emote); + //Not in use + int get_sfx_delay(QString p_char, int p_emote); - //Returns the modifier for p_char's p_emote - int get_emote_mod(QString p_char, int p_emote); + //Returns the modifier for p_char's p_emote + int get_emote_mod(QString p_char, int p_emote); - //Returns the desk modifier for p_char's p_emote - int get_desk_mod(QString p_char, int p_emote); + //Returns the desk modifier for p_char's p_emote + int get_desk_mod(QString p_char, int p_emote); - //Returns p_char's gender - QString get_gender(QString p_char); + //Returns p_char's gender + QString get_gender(QString p_char); - // ====== - // These are all casing-related settings. - // ====== + // ====== + // These are all casing-related settings. + // ====== - // Returns if the user has casing alerts enabled. - bool get_casing_enabled(); + // Returns if the user has casing alerts enabled. + bool get_casing_enabled(); - // Returns if the user wants to get alerts for the defence role. - bool get_casing_defence_enabled(); + // Returns if the user wants to get alerts for the defence role. + bool get_casing_defence_enabled(); - // Same for prosecution. - bool get_casing_prosecution_enabled(); + // Same for prosecution. + bool get_casing_prosecution_enabled(); - // Same for judge. - bool get_casing_judge_enabled(); + // Same for judge. + bool get_casing_judge_enabled(); - // Same for juror. - bool get_casing_juror_enabled(); + // Same for juror. + bool get_casing_juror_enabled(); - // Same for steno. - bool get_casing_steno_enabled(); + // Same for steno. + bool get_casing_steno_enabled(); - // Same for CM. - bool get_casing_cm_enabled(); + // Same for CM. + bool get_casing_cm_enabled(); - // Get the message for the CM for casing alerts. - QString get_casing_can_host_cases(); + // Get the message for the CM for casing alerts. + QString get_casing_can_host_cases(); - //The file name of the log file in base/logs. - QString log_filename; + //The file name of the log file in base/logs. + QString log_filename; private: - const int RELEASE = 2; - const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 3; + const int RELEASE = 2; + const int MAJOR_VERSION = 8; + const int MINOR_VERSION = 3; - QString current_theme = "default"; + QString current_theme = "default"; - QVector server_list; - QVector favorite_list; + QVector server_list; + QVector favorite_list; private slots: - void ms_connect_finished(bool connected, bool will_retry); + void ms_connect_finished(bool connected, bool will_retry); public slots: - void server_disconnected(); - void loading_cancelled(); + void server_disconnected(); + void loading_cancelled(); }; #endif // AOAPPLICATION_H diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index a848e806..db6dfce6 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -10,38 +10,36 @@ #include "aoapplication.h" +#include +#include #include #include -#include -#include - -class AOBlipPlayer -{ +class AOBlipPlayer { public: - AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); + AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(qreal p_volume); + void set_blips(QString p_sfx); + void blip_tick(); + void set_volume(qreal p_volume); - int m_cycle = 0; + int m_cycle = 0; private: - const int max_blip_ms = 60; + const int max_blip_ms = 60; - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume; - QElapsedTimer delay; + QWidget *m_parent; + AOApplication *ao_app; + qreal m_volume; + QElapsedTimer delay; - void set_volume_internal(qreal p_volume); + void set_volume_internal(qreal p_volume); - #if defined(BASSAUDIO) - HSTREAM m_stream_list[5]; - #elif defined(QTAUDIO) - QSoundEffect m_blips; - #endif +#if defined(BASSAUDIO) + HSTREAM m_stream_list[5]; +#elif defined(QTAUDIO) + QSoundEffect m_blips; +#endif }; #endif // AOBLIPPLAYER_H diff --git a/include/aobutton.h b/include/aobutton.h index 4b7209ae..598d2c0d 100644 --- a/include/aobutton.h +++ b/include/aobutton.h @@ -3,20 +3,19 @@ #include "aoapplication.h" -#include #include +#include -class AOButton : public QPushButton -{ - Q_OBJECT +class AOButton : public QPushButton { + Q_OBJECT public: - AOButton(QWidget *parent, AOApplication *p_ao_app); - ~AOButton(); + AOButton(QWidget *parent, AOApplication *p_ao_app); + ~AOButton(); - AOApplication *ao_app; + AOApplication *ao_app; - void set_image(QString p_image); + void set_image(QString p_image); }; #endif // AOBUTTON_H diff --git a/include/aocaseannouncerdialog.h b/include/aocaseannouncerdialog.h index a238c3f2..930fa414 100644 --- a/include/aocaseannouncerdialog.h +++ b/include/aocaseannouncerdialog.h @@ -4,42 +4,41 @@ #include "aoapplication.h" #include "courtroom.h" -#include #include -#include -#include #include +#include +#include #include #include +#include -class AOCaseAnnouncerDialog : public QDialog -{ - Q_OBJECT +class AOCaseAnnouncerDialog : public QDialog { + Q_OBJECT public: - explicit AOCaseAnnouncerDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr, Courtroom *p_court = nullptr); + explicit AOCaseAnnouncerDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr, Courtroom *p_court = nullptr); private: - AOApplication *ao_app; - Courtroom *court; + AOApplication *ao_app; + Courtroom *court; - QDialogButtonBox *ui_announcer_buttons; + QDialogButtonBox *ui_announcer_buttons; - QVBoxLayout *ui_vbox_layout; - QFormLayout *ui_form_layout; + QVBoxLayout *ui_vbox_layout; + QFormLayout *ui_form_layout; - QLabel *ui_case_title_label; - QLineEdit *ui_case_title_textbox; + QLabel *ui_case_title_label; + QLineEdit *ui_case_title_textbox; - QCheckBox *ui_defense_needed; - QCheckBox *ui_prosecutor_needed; - QCheckBox *ui_judge_needed; - QCheckBox *ui_juror_needed; - QCheckBox *ui_steno_needed; + QCheckBox *ui_defense_needed; + QCheckBox *ui_prosecutor_needed; + QCheckBox *ui_judge_needed; + QCheckBox *ui_juror_needed; + QCheckBox *ui_steno_needed; public slots: - void ok_pressed(); - void cancel_pressed(); + void ok_pressed(); + void cancel_pressed(); }; #endif // AOCASEANNOUNCERDIALOG_H diff --git a/include/aocharbutton.h b/include/aocharbutton.h index f372cdf8..a5367924 100644 --- a/include/aocharbutton.h +++ b/include/aocharbutton.h @@ -4,41 +4,40 @@ #include "aoapplication.h" #include "aoimage.h" +#include #include #include #include -#include -class AOCharButton : public QPushButton -{ - Q_OBJECT +class AOCharButton : public QPushButton { + Q_OBJECT public: - AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken); + AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken); - AOApplication *ao_app; + AOApplication *ao_app; - void refresh(); - void reset(); - void set_taken(bool is_taken); - void set_passworded(); + void refresh(); + void reset(); + void set_taken(bool is_taken); + void set_passworded(); - void apply_taken_image(); + void apply_taken_image(); - void set_image(QString p_character); + void set_image(QString p_character); private: - bool taken; + bool taken; - QWidget *m_parent; + QWidget *m_parent; - AOImage *ui_taken; - AOImage *ui_passworded; - AOImage *ui_selector; + AOImage *ui_taken; + AOImage *ui_passworded; + AOImage *ui_selector; protected: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); }; #endif // AOCHARBUTTON_H diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 15fa7cf4..2a185dd2 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -1,120 +1,118 @@ #ifndef AOCHARMOVIE_H #define AOCHARMOVIE_H +#include +#include #include #include #include -#include -#include -#include class AOApplication; -class AOCharMovie : public QLabel -{ - Q_OBJECT +class AOCharMovie : public QLabel { + Q_OBJECT public: - AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); + AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); - //Play a hat.gif - style preanimation - void play_pre(QString p_char, QString p_emote, int duration); + //Play a hat.gif - style preanimation + void play_pre(QString p_char, QString p_emote, int duration); - //Play a (b)normal.gif - style animation (talking) - void play_talking(QString p_char, QString p_emote); + //Play a (b)normal.gif - style animation (talking) + void play_talking(QString p_char, QString p_emote); - //Play an (a)normal.gif - style animation (not talking) - void play_idle(QString p_char, QString p_emote); + //Play an (a)normal.gif - style animation (not talking) + void play_idle(QString p_char, QString p_emote); - //Stop the movie, clearing the image - void stop(); + //Stop the movie, clearing the image + void stop(); - //Set the m_flipped variable to true/false - void set_flipped(bool p_flipped) {m_flipped = p_flipped;} + //Set the m_flipped variable to true/false + void set_flipped(bool p_flipped) { m_flipped = p_flipped; } - //Set the movie's playback speed (between 10% and 1000%) - void set_speed(int modifier) {speed = qMax(10, qMin(modifier, 1000));} + //Set the movie's playback speed (between 10% and 1000%) + void set_speed(int modifier) { speed = qMax(10, qMin(modifier, 1000)); } - //Move the label itself around - void move(int ax, int ay); + //Move the label itself around + void move(int ax, int ay); - //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of - void combo_resize(int w, int h); + //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of + void combo_resize(int w, int h); - //Return the frame delay adjusted for speed - int get_frame_delay(int delay); + //Return the frame delay adjusted for speed + int get_frame_delay(int delay); - QStringList network_strings; + QStringList network_strings; - QString m_char; - QString m_emote; + QString m_char; + QString m_emote; private: - AOApplication *ao_app; + AOApplication *ao_app; - QVector movie_frames; - QVector movie_delays; + QVector movie_frames; + QVector movie_delays; - //Effects such as sfx, screenshakes and realization flashes are stored in here. - //QString entry format: "sfx^[sfx_name]", "shake", "flash". - //The program uses the QVector index as reference. - QVector> movie_effects; + //Effects such as sfx, screenshakes and realization flashes are stored in here. + //QString entry format: "sfx^[sfx_name]", "shake", "flash". + //The program uses the QVector index as reference. + QVector> movie_effects; - QTimer *preanim_timer; - QTimer *ticker; - QString last_path; - QImageReader *m_reader = new QImageReader(); + QTimer *preanim_timer; + QTimer *ticker; + QString last_path; + QImageReader *m_reader = new QImageReader(); - QElapsedTimer actual_time; + QElapsedTimer actual_time; - //Usually used to turn seconds into milliseconds such as for [Time] tag in char.ini - const int time_mod = 60; + //Usually used to turn seconds into milliseconds such as for [Time] tag in char.ini + const int time_mod = 60; - // These are the X and Y values before they are fixed based on the sprite's width. - int x = 0; - int y = 0; - // These are the width and height values before they are fixed based on the sprite's width. - int f_w = 0; - int f_h = 0; + // These are the X and Y values before they are fixed based on the sprite's width. + int x = 0; + int y = 0; + // These are the width and height values before they are fixed based on the sprite's width. + int f_w = 0; + int f_h = 0; - int frame = 0; - int max_frames = 0; + int frame = 0; + int max_frames = 0; - int speed = 100; + int speed = 100; - bool m_flipped = false; - bool play_once = true; + bool m_flipped = false; + bool play_once = true; - //Set the movie's image to provided paths, preparing for playback. - void load_image(QString p_char, QString p_emote, QString emote_prefix); + //Set the movie's image to provided paths, preparing for playback. + void load_image(QString p_char, QString p_emote, QString emote_prefix); - //Start playback of the movie (if animated). - void play(); + //Start playback of the movie (if animated). + void play(); - //Play a frame-specific effect, if there's any defined for that specific frame. - void play_frame_effect(int frame); + //Play a frame-specific effect, if there's any defined for that specific frame. + void play_frame_effect(int frame); - //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage - QPixmap get_pixmap(QImage image); + //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage + QPixmap get_pixmap(QImage image); - //Set the movie's frame to provided pixmap - void set_frame(QPixmap f_pixmap); + //Set the movie's frame to provided pixmap + void set_frame(QPixmap f_pixmap); - //Initialize the frame-specific effects from the char.ini - void load_effects(); + //Initialize the frame-specific effects from the char.ini + void load_effects(); - //Initialize the frame-specific effects from the provided network_strings, this is only initialized if network_strings has size more than 0. - void load_network_effects(); + //Initialize the frame-specific effects from the provided network_strings, this is only initialized if network_strings has size more than 0. + void load_network_effects(); signals: - void done(); - void shake(); - void flash(); - void play_sfx(QString sfx); + void done(); + void shake(); + void flash(); + void play_sfx(QString sfx); private slots: - void preanim_done(); - void movie_ticker(); + void preanim_done(); + void movie_ticker(); }; #endif // AOCHARMOVIE_H diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index a13688bb..8674bb08 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -3,33 +3,32 @@ #include "aoapplication.h" -#include #include +#include -class AOEmoteButton : public QPushButton -{ - Q_OBJECT +class AOEmoteButton : public QPushButton { + Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); - void set_image(QString p_image, QString p_emote_comment); - void set_char_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); - void set_id(int p_id) {m_id = p_id;} - int get_id() {return m_id;} + void set_id(int p_id) { m_id = p_id; } + int get_id() { return m_id; } private: - QWidget *parent; - AOApplication *ao_app; + QWidget *parent; + AOApplication *ao_app; - int m_id = 0; + int m_id = 0; signals: - void emote_clicked(int p_id); + void emote_clicked(int p_id); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEMOTEBUTTON_H diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h index 53fa11ff..2ac6860b 100644 --- a/include/aoevidencebutton.h +++ b/include/aoevidencebutton.h @@ -4,48 +4,47 @@ #include "aoapplication.h" #include "aoimage.h" +#include #include #include -#include -class AOEvidenceButton : public QPushButton -{ - Q_OBJECT +class AOEvidenceButton : public QPushButton { + Q_OBJECT public: - AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); - void set_image(QString p_image); - void set_theme_image(QString p_image); - void set_id(int p_id) {m_id = p_id;} + void set_image(QString p_image); + void set_theme_image(QString p_image); + void set_id(int p_id) { m_id = p_id; } - void set_selected(bool p_selected); + void set_selected(bool p_selected); private: - AOApplication *ao_app; - QWidget *m_parent; + AOApplication *ao_app; + QWidget *m_parent; - AOImage *ui_selected; - AOImage *ui_selector; + AOImage *ui_selected; + AOImage *ui_selector; - int m_id = 0; + int m_id = 0; protected: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); - /* + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); + /* void dragLeaveEvent(QMouseEvent *e); void dragEnterEvent(QMouseEvent *e); */ signals: - void evidence_clicked(int p_id); - void evidence_double_clicked(int p_id); - void on_hover(int p_id, bool p_state); + void evidence_clicked(int p_id); + void evidence_double_clicked(int p_id); + void on_hover(int p_id, bool p_state); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEVIDENCEBUTTON_H diff --git a/include/aoevidencedisplay.h b/include/aoevidencedisplay.h index 93455c09..0315ffcf 100644 --- a/include/aoevidencedisplay.h +++ b/include/aoevidencedisplay.h @@ -2,32 +2,31 @@ #define AOEVIDENCEDISPLAY_H #include "aoapplication.h" -#include "aosfxplayer.h" #include "aomovie.h" +#include "aosfxplayer.h" -#include #include +#include -class AOEvidenceDisplay : public QLabel -{ - Q_OBJECT +class AOEvidenceDisplay : public QLabel { + Q_OBJECT public: - AOEvidenceDisplay(QWidget *p_parent, AOApplication *p_ao_app); + AOEvidenceDisplay(QWidget *p_parent, AOApplication *p_ao_app); - void show_evidence(QString p_evidence_image, bool is_left_side, int p_volume); - QLabel* get_evidence_icon(); - void reset(); - void combo_resize(int w, int h); + void show_evidence(QString p_evidence_image, bool is_left_side, int p_volume); + QLabel *get_evidence_icon(); + void reset(); + void combo_resize(int w, int h); private: - AOApplication *ao_app; - AOMovie *evidence_movie; - QLabel *evidence_icon; - AOSfxPlayer *sfx_player; + AOApplication *ao_app; + AOMovie *evidence_movie; + QLabel *evidence_icon; + AOSfxPlayer *sfx_player; private slots: - void show_done(); + void show_done(); }; #endif // AOEVIDENCEDISPLAY_H diff --git a/include/aoimage.h b/include/aoimage.h index 25c8e068..a6960de6 100644 --- a/include/aoimage.h +++ b/include/aoimage.h @@ -5,21 +5,20 @@ #include "aoapplication.h" -#include #include +#include -class AOImage : public QLabel -{ +class AOImage : public QLabel { public: - AOImage(QWidget *parent, AOApplication *p_ao_app); - ~AOImage(); + AOImage(QWidget *parent, AOApplication *p_ao_app); + ~AOImage(); - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; - bool set_image(QString p_image); - bool set_chatbox(QString p_path); - void set_size_and_pos(QString identifier); + bool set_image(QString p_image); + bool set_chatbox(QString p_path); + void set_size_and_pos(QString identifier); }; #endif // AOIMAGE_H diff --git a/include/aolineedit.h b/include/aolineedit.h index 09521729..06206a95 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -4,24 +4,23 @@ #include #include -class AOLineEdit : public QLineEdit -{ - Q_OBJECT +class AOLineEdit : public QLineEdit { + Q_OBJECT public: - AOLineEdit(QWidget *parent); + AOLineEdit(QWidget *parent); - void preserve_selection(bool toggle) {p_selection = toggle;} + void preserve_selection(bool toggle) { p_selection = toggle; } private: - bool p_selection = false; + bool p_selection = false; protected: - void mouseDoubleClickEvent(QMouseEvent *e); - void focusOutEvent(QFocusEvent *ev); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: - void double_clicked(); + void double_clicked(); }; #endif // AOLINEEDIT_H diff --git a/include/aomovie.h b/include/aomovie.h index ec286199..8d604423 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -7,30 +7,29 @@ class Courtroom; class AOApplication; -class AOMovie : public QLabel -{ - Q_OBJECT +class AOMovie : public QLabel { + Q_OBJECT public: - AOMovie(QWidget *p_parent, AOApplication *p_ao_app); + AOMovie(QWidget *p_parent, AOApplication *p_ao_app); - void set_play_once(bool p_play_once); - void play(QString p_image, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); - void combo_resize(int w, int h); - void stop(); + void set_play_once(bool p_play_once); + void play(QString p_image, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); + void combo_resize(int w, int h); + void stop(); private: - QMovie *m_movie; - AOApplication *ao_app; - QTimer *timer; - bool play_once = true; + QMovie *m_movie; + AOApplication *ao_app; + QTimer *timer; + bool play_once = true; signals: - void done(); + void done(); private slots: - void frame_change(int n_frame); - void timer_done(); + void frame_change(int n_frame); + void timer_done(); }; #endif // AOMOVIE_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 1a535828..d28a3ed6 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -10,73 +10,70 @@ #endif #include "aoapplication.h" +#include #include #include -#include #if defined(BASSAUDIO) -class AOMusicPlayer -{ +class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - virtual ~AOMusicPlayer(); - void set_volume(int p_value, int channel=-1); - void set_looping(bool toggle, int channel=0); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + virtual ~AOMusicPlayer(); + void set_volume(int p_value, int channel = -1); + void set_looping(bool toggle, int channel = 0); - const int m_channelmax = 4; + const int m_channelmax = 4; - //These have to be public for the stupid sync thing - QWORD loop_start = 0; - QWORD loop_end = 0; + //These have to be public for the stupid sync thing + QWORD loop_start = 0; + QWORD loop_end = 0; public slots: - void play(QString p_song, int channel=0, bool loop=false, int effect_flags=0); - void stop(int channel=0); + void play(QString p_song, int channel = 0, bool loop = false, int effect_flags = 0); + void stop(int channel = 0); private: - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; - bool m_looping = false; - int m_volume[4] = {0, 0, 0, 0}; + bool m_looping = false; + int m_volume[4] = {0, 0, 0, 0}; - // Channel 0 = music - // Channel 1 = ambience - // Channel 2 = extra - // Channel 3 = extra - HSTREAM m_stream_list[4]; - HSYNC loop_sync[4]; + // Channel 0 = music + // Channel 1 = ambience + // Channel 2 = extra + // Channel 3 = extra + HSTREAM m_stream_list[4]; + HSYNC loop_sync[4]; }; #elif defined(QTAUDIO) -class AOMusicPlayer -{ +class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); - void play(QString p_song); - void set_volume(int p_value); + void play(QString p_song); + void set_volume(int p_value); private: - QMediaPlayer m_player; - QWidget *m_parent; - AOApplication *ao_app; + QMediaPlayer m_player; + QWidget *m_parent; + AOApplication *ao_app; - int m_volume = 0; + int m_volume = 0; }; #else -class AOMusicPlayer -{ +class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); - void play(QString p_song); - void set_volume(int p_value); + void play(QString p_song); + void set_volume(int p_value); private: - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; }; #endif diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 4a63ca35..f9c369d2 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -21,17 +21,16 @@ #include #include #include +#include #include #include #include #include -#include #include #include -class AOOptionsDialog: public QDialog -{ +class AOOptionsDialog : public QDialog { Q_OBJECT public: explicit AOOptionsDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr); diff --git a/include/aopacket.h b/include/aopacket.h index 21f6e0f4..4133fd56 100644 --- a/include/aopacket.h +++ b/include/aopacket.h @@ -1,32 +1,31 @@ #ifndef AOPACKET_H #define AOPACKET_H +#include #include #include -#include -class AOPacket -{ +class AOPacket { public: - AOPacket(QString p_packet_string); - AOPacket(QString header, QStringList &p_contents); - ~AOPacket(); + AOPacket(QString p_packet_string); + AOPacket(QString header, QStringList &p_contents); + ~AOPacket(); - QString get_header() {return m_header;} - QStringList &get_contents() {return m_contents;} - QString to_string(); + QString get_header() { return m_header; } + QStringList &get_contents() { return m_contents; } + QString to_string(); - void encrypt_header(unsigned int p_key); - void decrypt_header(unsigned int p_key); + void encrypt_header(unsigned int p_key); + void decrypt_header(unsigned int p_key); - void net_encode(); - void net_decode(); + void net_encode(); + void net_decode(); private: - bool encrypted = false; + bool encrypted = false; - QString m_header; - QStringList m_contents; + QString m_header; + QStringList m_contents; }; #endif // AOPACKET_H diff --git a/include/aoscene.h b/include/aoscene.h index 46d8c3b8..3093b0fb 100644 --- a/include/aoscene.h +++ b/include/aoscene.h @@ -1,39 +1,39 @@ #ifndef AOSCENE_H #define AOSCENE_H -#include #include +#include #include class Courtroom; class AOApplication; -class AOScene : public QLabel -{ - Q_OBJECT +class AOScene : public QLabel { + Q_OBJECT public: - explicit AOScene(QWidget *parent, AOApplication *p_ao_app); + explicit AOScene(QWidget *parent, AOApplication *p_ao_app); + + void set_image(QString p_image); + void set_legacy_desk(QString p_image); - void set_image(QString p_image); - void set_legacy_desk(QString p_image); + //Move the label itself around + void move(int ax, int ay); - //Move the label itself around - void move(int ax, int ay); + //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of + void combo_resize(int w, int h); - //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of - void combo_resize(int w, int h); private: - QWidget *m_parent; - QMovie *m_movie; - AOApplication *ao_app; - QString last_image; - - // These are the X and Y values before they are fixed based on the sprite's width. - int x = 0; - int y = 0; - // These are the width and height values before they are fixed based on the sprite's width. - int f_w = 0; - int f_h = 0; + QWidget *m_parent; + QMovie *m_movie; + AOApplication *ao_app; + QString last_image; + + // These are the X and Y values before they are fixed based on the sprite's width. + int x = 0; + int y = 0; + // These are the width and height values before they are fixed based on the sprite's width. + int f_w = 0; + int f_h = 0; }; #endif // AOSCENE_H diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 3ae8bdf1..4488aa6a 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -10,36 +10,36 @@ #include "aoapplication.h" +#include #include #include -#include -class AOSfxPlayer -{ +class AOSfxPlayer { public: - AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); - - void clear(); - void loop_clear(); - void play(QString p_sfx, QString p_char = "", QString shout = "", int channel=-1); - void stop(int channel=-1); - void set_volume(qreal p_volume); - void set_looping(bool toggle, int channel=-1); - int m_channel = 0; + AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); + + void clear(); + void loop_clear(); + void play(QString p_sfx, QString p_char = "", QString shout = "", int channel = -1); + void stop(int channel = -1); + void set_volume(qreal p_volume); + void set_looping(bool toggle, int channel = -1); + int m_channel = 0; + private: - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume = 0; - - bool m_looping = true; - void set_volume_internal(qreal p_volume); - - #if defined(BASSAUDIO) - const int m_channelmax = 5; - HSTREAM m_stream_list[5]; - #elif defined(QTAUDIO) - QSoundEffect m_sfx; - #endif + QWidget *m_parent; + AOApplication *ao_app; + qreal m_volume = 0; + + bool m_looping = true; + void set_volume_internal(qreal p_volume); + +#if defined(BASSAUDIO) + const int m_channelmax = 5; + HSTREAM m_stream_list[5]; +#elif defined(QTAUDIO) + QSoundEffect m_sfx; +#endif }; #endif // AOSFXPLAYER_H diff --git a/include/aotextarea.h b/include/aotextarea.h index 643a8e34..8bf5199b 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -1,25 +1,24 @@ #ifndef AOTEXTAREA_H #define AOTEXTAREA_H -#include +#include +#include #include +#include #include -#include -#include -class AOTextArea : public QTextBrowser -{ +class AOTextArea : public QTextBrowser { public: - AOTextArea(QWidget *p_parent = nullptr); + AOTextArea(QWidget *p_parent = nullptr); - void append_linked(QString p_message); - void append_chatmessage(QString p_name, QString p_message, QString p_colur); - void append_error(QString p_message); + void append_linked(QString p_message); + void append_chatmessage(QString p_name, QString p_message, QString p_colur); + void append_error(QString p_message); private: - const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); + const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); - void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down); + void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down); }; #endif // AOTEXTAREA_H diff --git a/include/aotextedit.h b/include/aotextedit.h index 85909c6e..eb2c356d 100644 --- a/include/aotextedit.h +++ b/include/aotextedit.h @@ -3,21 +3,19 @@ #include -class AOTextEdit : public QPlainTextEdit -{ - Q_OBJECT +class AOTextEdit : public QPlainTextEdit { + Q_OBJECT public: - AOTextEdit(QWidget *parent); + AOTextEdit(QWidget *parent); protected: - void mouseDoubleClickEvent(QMouseEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); signals: - void double_clicked(); + void double_clicked(); private slots: - void on_enter_pressed(); - + void on_enter_pressed(); }; #endif // AOTEXTEDIT_H diff --git a/include/bass.h b/include/bass.h index 388d4068..4180a371 100644 --- a/include/bass.h +++ b/include/bass.h @@ -27,19 +27,19 @@ typedef int BOOL; #define FALSE 0 #endif #define LOBYTE(a) (BYTE)(a) -#define HIBYTE(a) (BYTE)((a)>>8) +#define HIBYTE(a) (BYTE)((a) >> 8) #define LOWORD(a) (WORD)(a) -#define HIWORD(a) (WORD)((a)>>16) -#define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8)) -#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16)) +#define HIWORD(a) (WORD)((a) >> 16) +#define MAKEWORD(a, b) (WORD)(((a)&0xff) | ((b) << 8)) +#define MAKELONG(a, b) (DWORD)(((a)&0xffff) | ((b) << 16)) #endif #ifdef __cplusplus extern "C" { #endif -#define BASSVERSION 0x204 // API version -#define BASSVERSIONTEXT "2.4" +#define BASSVERSION 0x204 // API version +#define BASSVERSIONTEXT "2.4" #ifndef BASSDEF #define BASSDEF(f) WINAPI f @@ -47,397 +47,396 @@ extern "C" { #define NOBASSOVERLOADS #endif -typedef DWORD HMUSIC; // MOD music handle -typedef DWORD HSAMPLE; // sample handle -typedef DWORD HCHANNEL; // playing sample's channel handle -typedef DWORD HSTREAM; // sample stream handle -typedef DWORD HRECORD; // recording handle -typedef DWORD HSYNC; // synchronizer handle -typedef DWORD HDSP; // DSP handle -typedef DWORD HFX; // DX8 effect handle -typedef DWORD HPLUGIN; // Plugin handle +typedef DWORD HMUSIC; // MOD music handle +typedef DWORD HSAMPLE; // sample handle +typedef DWORD HCHANNEL; // playing sample's channel handle +typedef DWORD HSTREAM; // sample stream handle +typedef DWORD HRECORD; // recording handle +typedef DWORD HSYNC; // synchronizer handle +typedef DWORD HDSP; // DSP handle +typedef DWORD HFX; // DX8 effect handle +typedef DWORD HPLUGIN; // Plugin handle // Error codes returned by BASS_ErrorGetCode -#define BASS_OK 0 // all is OK -#define BASS_ERROR_MEM 1 // memory error -#define BASS_ERROR_FILEOPEN 2 // can't open the file -#define BASS_ERROR_DRIVER 3 // can't find a free/valid driver -#define BASS_ERROR_BUFLOST 4 // the sample buffer was lost -#define BASS_ERROR_HANDLE 5 // invalid handle -#define BASS_ERROR_FORMAT 6 // unsupported sample format -#define BASS_ERROR_POSITION 7 // invalid position -#define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called -#define BASS_ERROR_START 9 // BASS_Start has not been successfully called -#define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available -#define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever -#define BASS_ERROR_NOCHAN 18 // can't get a free channel -#define BASS_ERROR_ILLTYPE 19 // an illegal type was specified -#define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified -#define BASS_ERROR_NO3D 21 // no 3D support -#define BASS_ERROR_NOEAX 22 // no EAX support -#define BASS_ERROR_DEVICE 23 // illegal device number -#define BASS_ERROR_NOPLAY 24 // not playing -#define BASS_ERROR_FREQ 25 // illegal sample rate -#define BASS_ERROR_NOTFILE 27 // the stream is not a file stream -#define BASS_ERROR_NOHW 29 // no hardware voices available -#define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data -#define BASS_ERROR_NONET 32 // no internet connection could be opened -#define BASS_ERROR_CREATE 33 // couldn't create the file -#define BASS_ERROR_NOFX 34 // effects are not available -#define BASS_ERROR_NOTAVAIL 37 // requested data/action is not available -#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel" -#define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed -#define BASS_ERROR_TIMEOUT 40 // connection timedout -#define BASS_ERROR_FILEFORM 41 // unsupported file format -#define BASS_ERROR_SPEAKER 42 // unavailable speaker -#define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons) -#define BASS_ERROR_CODEC 44 // codec is not available/supported -#define BASS_ERROR_ENDED 45 // the channel/file has ended -#define BASS_ERROR_BUSY 46 // the device is busy -#define BASS_ERROR_UNKNOWN -1 // some other mystery problem +#define BASS_OK 0 // all is OK +#define BASS_ERROR_MEM 1 // memory error +#define BASS_ERROR_FILEOPEN 2 // can't open the file +#define BASS_ERROR_DRIVER 3 // can't find a free/valid driver +#define BASS_ERROR_BUFLOST 4 // the sample buffer was lost +#define BASS_ERROR_HANDLE 5 // invalid handle +#define BASS_ERROR_FORMAT 6 // unsupported sample format +#define BASS_ERROR_POSITION 7 // invalid position +#define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called +#define BASS_ERROR_START 9 // BASS_Start has not been successfully called +#define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available +#define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever +#define BASS_ERROR_NOCHAN 18 // can't get a free channel +#define BASS_ERROR_ILLTYPE 19 // an illegal type was specified +#define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified +#define BASS_ERROR_NO3D 21 // no 3D support +#define BASS_ERROR_NOEAX 22 // no EAX support +#define BASS_ERROR_DEVICE 23 // illegal device number +#define BASS_ERROR_NOPLAY 24 // not playing +#define BASS_ERROR_FREQ 25 // illegal sample rate +#define BASS_ERROR_NOTFILE 27 // the stream is not a file stream +#define BASS_ERROR_NOHW 29 // no hardware voices available +#define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data +#define BASS_ERROR_NONET 32 // no internet connection could be opened +#define BASS_ERROR_CREATE 33 // couldn't create the file +#define BASS_ERROR_NOFX 34 // effects are not available +#define BASS_ERROR_NOTAVAIL 37 // requested data/action is not available +#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel" +#define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed +#define BASS_ERROR_TIMEOUT 40 // connection timedout +#define BASS_ERROR_FILEFORM 41 // unsupported file format +#define BASS_ERROR_SPEAKER 42 // unavailable speaker +#define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons) +#define BASS_ERROR_CODEC 44 // codec is not available/supported +#define BASS_ERROR_ENDED 45 // the channel/file has ended +#define BASS_ERROR_BUSY 46 // the device is busy +#define BASS_ERROR_UNKNOWN -1 // some other mystery problem // BASS_SetConfig options -#define BASS_CONFIG_BUFFER 0 -#define BASS_CONFIG_UPDATEPERIOD 1 -#define BASS_CONFIG_GVOL_SAMPLE 4 -#define BASS_CONFIG_GVOL_STREAM 5 -#define BASS_CONFIG_GVOL_MUSIC 6 -#define BASS_CONFIG_CURVE_VOL 7 -#define BASS_CONFIG_CURVE_PAN 8 -#define BASS_CONFIG_FLOATDSP 9 -#define BASS_CONFIG_3DALGORITHM 10 -#define BASS_CONFIG_NET_TIMEOUT 11 -#define BASS_CONFIG_NET_BUFFER 12 -#define BASS_CONFIG_PAUSE_NOPLAY 13 -#define BASS_CONFIG_NET_PREBUF 15 -#define BASS_CONFIG_NET_PASSIVE 18 -#define BASS_CONFIG_REC_BUFFER 19 -#define BASS_CONFIG_NET_PLAYLIST 21 -#define BASS_CONFIG_MUSIC_VIRTUAL 22 -#define BASS_CONFIG_VERIFY 23 -#define BASS_CONFIG_UPDATETHREADS 24 -#define BASS_CONFIG_DEV_BUFFER 27 -#define BASS_CONFIG_REC_LOOPBACK 28 -#define BASS_CONFIG_VISTA_TRUEPOS 30 -#define BASS_CONFIG_IOS_MIXAUDIO 34 -#define BASS_CONFIG_DEV_DEFAULT 36 -#define BASS_CONFIG_NET_READTIMEOUT 37 -#define BASS_CONFIG_VISTA_SPEAKERS 38 -#define BASS_CONFIG_IOS_SPEAKER 39 -#define BASS_CONFIG_MF_DISABLE 40 -#define BASS_CONFIG_HANDLES 41 -#define BASS_CONFIG_UNICODE 42 -#define BASS_CONFIG_SRC 43 -#define BASS_CONFIG_SRC_SAMPLE 44 -#define BASS_CONFIG_ASYNCFILE_BUFFER 45 -#define BASS_CONFIG_OGG_PRESCAN 47 -#define BASS_CONFIG_MF_VIDEO 48 -#define BASS_CONFIG_AIRPLAY 49 -#define BASS_CONFIG_DEV_NONSTOP 50 -#define BASS_CONFIG_IOS_NOCATEGORY 51 -#define BASS_CONFIG_VERIFY_NET 52 -#define BASS_CONFIG_DEV_PERIOD 53 -#define BASS_CONFIG_FLOAT 54 -#define BASS_CONFIG_NET_SEEK 56 -#define BASS_CONFIG_AM_DISABLE 58 -#define BASS_CONFIG_NET_PLAYLIST_DEPTH 59 -#define BASS_CONFIG_NET_PREBUF_WAIT 60 -#define BASS_CONFIG_WASAPI_PERSIST 65 -#define BASS_CONFIG_REC_WASAPI 66 +#define BASS_CONFIG_BUFFER 0 +#define BASS_CONFIG_UPDATEPERIOD 1 +#define BASS_CONFIG_GVOL_SAMPLE 4 +#define BASS_CONFIG_GVOL_STREAM 5 +#define BASS_CONFIG_GVOL_MUSIC 6 +#define BASS_CONFIG_CURVE_VOL 7 +#define BASS_CONFIG_CURVE_PAN 8 +#define BASS_CONFIG_FLOATDSP 9 +#define BASS_CONFIG_3DALGORITHM 10 +#define BASS_CONFIG_NET_TIMEOUT 11 +#define BASS_CONFIG_NET_BUFFER 12 +#define BASS_CONFIG_PAUSE_NOPLAY 13 +#define BASS_CONFIG_NET_PREBUF 15 +#define BASS_CONFIG_NET_PASSIVE 18 +#define BASS_CONFIG_REC_BUFFER 19 +#define BASS_CONFIG_NET_PLAYLIST 21 +#define BASS_CONFIG_MUSIC_VIRTUAL 22 +#define BASS_CONFIG_VERIFY 23 +#define BASS_CONFIG_UPDATETHREADS 24 +#define BASS_CONFIG_DEV_BUFFER 27 +#define BASS_CONFIG_REC_LOOPBACK 28 +#define BASS_CONFIG_VISTA_TRUEPOS 30 +#define BASS_CONFIG_IOS_MIXAUDIO 34 +#define BASS_CONFIG_DEV_DEFAULT 36 +#define BASS_CONFIG_NET_READTIMEOUT 37 +#define BASS_CONFIG_VISTA_SPEAKERS 38 +#define BASS_CONFIG_IOS_SPEAKER 39 +#define BASS_CONFIG_MF_DISABLE 40 +#define BASS_CONFIG_HANDLES 41 +#define BASS_CONFIG_UNICODE 42 +#define BASS_CONFIG_SRC 43 +#define BASS_CONFIG_SRC_SAMPLE 44 +#define BASS_CONFIG_ASYNCFILE_BUFFER 45 +#define BASS_CONFIG_OGG_PRESCAN 47 +#define BASS_CONFIG_MF_VIDEO 48 +#define BASS_CONFIG_AIRPLAY 49 +#define BASS_CONFIG_DEV_NONSTOP 50 +#define BASS_CONFIG_IOS_NOCATEGORY 51 +#define BASS_CONFIG_VERIFY_NET 52 +#define BASS_CONFIG_DEV_PERIOD 53 +#define BASS_CONFIG_FLOAT 54 +#define BASS_CONFIG_NET_SEEK 56 +#define BASS_CONFIG_AM_DISABLE 58 +#define BASS_CONFIG_NET_PLAYLIST_DEPTH 59 +#define BASS_CONFIG_NET_PREBUF_WAIT 60 +#define BASS_CONFIG_WASAPI_PERSIST 65 +#define BASS_CONFIG_REC_WASAPI 66 // BASS_SetConfigPtr options -#define BASS_CONFIG_NET_AGENT 16 -#define BASS_CONFIG_NET_PROXY 17 -#define BASS_CONFIG_IOS_NOTIFY 46 -#define BASS_CONFIG_LIBSSL 64 +#define BASS_CONFIG_NET_AGENT 16 +#define BASS_CONFIG_NET_PROXY 17 +#define BASS_CONFIG_IOS_NOTIFY 46 +#define BASS_CONFIG_LIBSSL 64 // BASS_Init flags -#define BASS_DEVICE_8BITS 1 // 8 bit -#define BASS_DEVICE_MONO 2 // mono -#define BASS_DEVICE_3D 4 // enable 3D functionality -#define BASS_DEVICE_16BITS 8 // limit output to 16 bit -#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) -#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel -#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment -#define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement -#define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin -#define BASS_DEVICE_FREQ 0x4000 // set device sample rate -#define BASS_DEVICE_STEREO 0x8000 // limit output to stereo -#define BASS_DEVICE_HOG 0x10000 // hog/exclusive mode -#define BASS_DEVICE_AUDIOTRACK 0x20000 // use AudioTrack output -#define BASS_DEVICE_DSOUND 0x40000 // use DirectSound output +#define BASS_DEVICE_8BITS 1 // 8 bit +#define BASS_DEVICE_MONO 2 // mono +#define BASS_DEVICE_3D 4 // enable 3D functionality +#define BASS_DEVICE_16BITS 8 // limit output to 16 bit +#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) +#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel +#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment +#define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement +#define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin +#define BASS_DEVICE_FREQ 0x4000 // set device sample rate +#define BASS_DEVICE_STEREO 0x8000 // limit output to stereo +#define BASS_DEVICE_HOG 0x10000 // hog/exclusive mode +#define BASS_DEVICE_AUDIOTRACK 0x20000 // use AudioTrack output +#define BASS_DEVICE_DSOUND 0x40000 // use DirectSound output // DirectSound interfaces (for use with BASS_GetDSoundObject) -#define BASS_OBJECT_DS 1 // IDirectSound -#define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener +#define BASS_OBJECT_DS 1 // IDirectSound +#define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener // Device info structure typedef struct { -#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) - const wchar_t *name; // description - const wchar_t *driver; // driver +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // description + const wchar_t *driver; // driver #else - const char *name; // description - const char *driver; // driver + const char *name; // description + const char *driver; // driver #endif - DWORD flags; + DWORD flags; } BASS_DEVICEINFO; // BASS_DEVICEINFO flags -#define BASS_DEVICE_ENABLED 1 -#define BASS_DEVICE_DEFAULT 2 -#define BASS_DEVICE_INIT 4 -#define BASS_DEVICE_LOOPBACK 8 - -#define BASS_DEVICE_TYPE_MASK 0xff000000 -#define BASS_DEVICE_TYPE_NETWORK 0x01000000 -#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000 -#define BASS_DEVICE_TYPE_LINE 0x03000000 -#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000 -#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000 -#define BASS_DEVICE_TYPE_HEADSET 0x06000000 -#define BASS_DEVICE_TYPE_HANDSET 0x07000000 -#define BASS_DEVICE_TYPE_DIGITAL 0x08000000 -#define BASS_DEVICE_TYPE_SPDIF 0x09000000 -#define BASS_DEVICE_TYPE_HDMI 0x0a000000 -#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000 - -// BASS_GetDeviceInfo flags -#define BASS_DEVICES_AIRPLAY 0x1000000 - +#define BASS_DEVICE_ENABLED 1 +#define BASS_DEVICE_DEFAULT 2 +#define BASS_DEVICE_INIT 4 +#define BASS_DEVICE_LOOPBACK 8 + +#define BASS_DEVICE_TYPE_MASK 0xff000000 +#define BASS_DEVICE_TYPE_NETWORK 0x01000000 +#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000 +#define BASS_DEVICE_TYPE_LINE 0x03000000 +#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000 +#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000 +#define BASS_DEVICE_TYPE_HEADSET 0x06000000 +#define BASS_DEVICE_TYPE_HANDSET 0x07000000 +#define BASS_DEVICE_TYPE_DIGITAL 0x08000000 +#define BASS_DEVICE_TYPE_SPDIF 0x09000000 +#define BASS_DEVICE_TYPE_HDMI 0x0a000000 +#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000 + +// BASS_GetDeviceInfo flags +#define BASS_DEVICES_AIRPLAY 0x1000000 + typedef struct { - DWORD flags; // device capabilities (DSCAPS_xxx flags) - DWORD hwsize; // size of total device hardware memory - DWORD hwfree; // size of free device hardware memory - DWORD freesam; // number of free sample slots in the hardware - DWORD free3d; // number of free 3D sample slots in the hardware - DWORD minrate; // min sample rate supported by the hardware - DWORD maxrate; // max sample rate supported by the hardware - BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) - DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) - DWORD dsver; // DirectSound version - DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) - DWORD initflags; // BASS_Init "flags" parameter - DWORD speakers; // number of speakers available - DWORD freq; // current output rate + DWORD flags; // device capabilities (DSCAPS_xxx flags) + DWORD hwsize; // size of total device hardware memory + DWORD hwfree; // size of free device hardware memory + DWORD freesam; // number of free sample slots in the hardware + DWORD free3d; // number of free 3D sample slots in the hardware + DWORD minrate; // min sample rate supported by the hardware + DWORD maxrate; // max sample rate supported by the hardware + BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + DWORD dsver; // DirectSound version + DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + DWORD initflags; // BASS_Init "flags" parameter + DWORD speakers; // number of speakers available + DWORD freq; // current output rate } BASS_INFO; // BASS_INFO flags (from DSOUND.H) -#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate -#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support -#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft -#define DSCAPS_SECONDARYMONO 0x00000100 // mono -#define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo -#define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit -#define DSCAPS_SECONDARY16BIT 0x00000800 // 16 bit +#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate +#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support +#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft +#define DSCAPS_SECONDARYMONO 0x00000100 // mono +#define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo +#define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit +#define DSCAPS_SECONDARY16BIT 0x00000800 // 16 bit // Recording device info structure typedef struct { - DWORD flags; // device capabilities (DSCCAPS_xxx flags) - DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) - DWORD inputs; // number of inputs - BOOL singlein; // TRUE = only 1 input can be set at a time - DWORD freq; // current input rate + DWORD flags; // device capabilities (DSCCAPS_xxx flags) + DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) + DWORD inputs; // number of inputs + BOOL singlein; // TRUE = only 1 input can be set at a time + DWORD freq; // current input rate } BASS_RECORDINFO; // BASS_RECORDINFO flags (from DSOUND.H) -#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support -#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) #ifndef WAVE_FORMAT_1M08 -#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */ -#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */ -#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */ -#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */ -#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */ -#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */ -#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */ -#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */ -#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */ -#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */ -#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */ -#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */ #endif // Sample info structure typedef struct { - DWORD freq; // default playback rate - float volume; // default volume (0-1) - float pan; // default pan (-1=left, 0=middle, 1=right) - DWORD flags; // BASS_SAMPLE_xxx flags - DWORD length; // length (in bytes) - DWORD max; // maximum simultaneous playbacks - DWORD origres; // original resolution - DWORD chans; // number of channels - DWORD mingap; // minimum gap (ms) between creating channels - DWORD mode3d; // BASS_3DMODE_xxx mode - float mindist; // minimum distance - float maxdist; // maximum distance - DWORD iangle; // angle of inside projection cone - DWORD oangle; // angle of outside projection cone - float outvol; // delta-volume outside the projection cone - DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) - DWORD priority; // priority (0=lowest, 0xffffffff=highest) + DWORD freq; // default playback rate + float volume; // default volume (0-1) + float pan; // default pan (-1=left, 0=middle, 1=right) + DWORD flags; // BASS_SAMPLE_xxx flags + DWORD length; // length (in bytes) + DWORD max; // maximum simultaneous playbacks + DWORD origres; // original resolution + DWORD chans; // number of channels + DWORD mingap; // minimum gap (ms) between creating channels + DWORD mode3d; // BASS_3DMODE_xxx mode + float mindist; // minimum distance + float maxdist; // maximum distance + DWORD iangle; // angle of inside projection cone + DWORD oangle; // angle of outside projection cone + float outvol; // delta-volume outside the projection cone + DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) + DWORD priority; // priority (0=lowest, 0xffffffff=highest) } BASS_SAMPLE; -#define BASS_SAMPLE_8BITS 1 // 8 bit -#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point -#define BASS_SAMPLE_MONO 2 // mono -#define BASS_SAMPLE_LOOP 4 // looped -#define BASS_SAMPLE_3D 8 // 3D functionality -#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing -#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) -#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management -#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects -#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume -#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing -#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only) - -#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) -#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends -#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams -#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks -#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) -#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC - -#define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info -#define BASS_MP3_SETPOS BASS_STREAM_PRESCAN - -#define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT -#define BASS_MUSIC_MONO BASS_SAMPLE_MONO -#define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP -#define BASS_MUSIC_3D BASS_SAMPLE_3D -#define BASS_MUSIC_FX BASS_SAMPLE_FX -#define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE -#define BASS_MUSIC_DECODE BASS_STREAM_DECODE -#define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length -#define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN -#define BASS_MUSIC_RAMP 0x200 // normal ramping -#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping -#define BASS_MUSIC_SURROUND 0x800 // surround sound -#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) -#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files -#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does -#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does -#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing -#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing -#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position -#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position -#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect -#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples +#define BASS_SAMPLE_8BITS 1 // 8 bit +#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point +#define BASS_SAMPLE_MONO 2 // mono +#define BASS_SAMPLE_LOOP 4 // looped +#define BASS_SAMPLE_3D 8 // 3D functionality +#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing +#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) +#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management +#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects +#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume +#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing +#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only) + +#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) +#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends +#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams +#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks +#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) +#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC + +#define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info +#define BASS_MP3_SETPOS BASS_STREAM_PRESCAN + +#define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT +#define BASS_MUSIC_MONO BASS_SAMPLE_MONO +#define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP +#define BASS_MUSIC_3D BASS_SAMPLE_3D +#define BASS_MUSIC_FX BASS_SAMPLE_FX +#define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE +#define BASS_MUSIC_DECODE BASS_STREAM_DECODE +#define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length +#define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN +#define BASS_MUSIC_RAMP 0x200 // normal ramping +#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping +#define BASS_MUSIC_SURROUND 0x800 // surround sound +#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) +#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files +#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does +#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does +#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing +#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing +#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position +#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position +#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect +#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples // Speaker assignment flags -#define BASS_SPEAKER_FRONT 0x1000000 // front speakers -#define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers -#define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1) -#define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1) -#define BASS_SPEAKER_N(n) ((n)<<24) // n'th pair of speakers (max 15) -#define BASS_SPEAKER_LEFT 0x10000000 // modifier: left -#define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right -#define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT -#define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT -#define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT -#define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT -#define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT -#define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT -#define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT -#define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT - -#define BASS_ASYNCFILE 0x40000000 -#define BASS_UNICODE 0x80000000 - -#define BASS_RECORD_PAUSE 0x8000 // start recording paused -#define BASS_RECORD_ECHOCANCEL 0x2000 -#define BASS_RECORD_AGC 0x4000 +#define BASS_SPEAKER_FRONT 0x1000000 // front speakers +#define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers +#define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1) +#define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1) +#define BASS_SPEAKER_N(n) ((n) << 24) // n'th pair of speakers (max 15) +#define BASS_SPEAKER_LEFT 0x10000000 // modifier: left +#define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right +#define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT | BASS_SPEAKER_LEFT +#define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT | BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR | BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR | BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE | BASS_SPEAKER_LEFT +#define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE | BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2 | BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2 | BASS_SPEAKER_RIGHT + +#define BASS_ASYNCFILE 0x40000000 +#define BASS_UNICODE 0x80000000 + +#define BASS_RECORD_PAUSE 0x8000 // start recording paused +#define BASS_RECORD_ECHOCANCEL 0x2000 +#define BASS_RECORD_AGC 0x4000 // DX7 voice allocation & management flags -#define BASS_VAM_HARDWARE 1 -#define BASS_VAM_SOFTWARE 2 -#define BASS_VAM_TERM_TIME 4 -#define BASS_VAM_TERM_DIST 8 -#define BASS_VAM_TERM_PRIO 16 +#define BASS_VAM_HARDWARE 1 +#define BASS_VAM_SOFTWARE 2 +#define BASS_VAM_TERM_TIME 4 +#define BASS_VAM_TERM_DIST 8 +#define BASS_VAM_TERM_PRIO 16 // Channel info structure typedef struct { - DWORD freq; // default playback rate - DWORD chans; // channels - DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags - DWORD ctype; // type of channel - DWORD origres; // original resolution - HPLUGIN plugin; // plugin - HSAMPLE sample; // sample - const char *filename; // filename + DWORD freq; // default playback rate + DWORD chans; // channels + DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + DWORD ctype; // type of channel + DWORD origres; // original resolution + HPLUGIN plugin; // plugin + HSAMPLE sample; // sample + const char *filename; // filename } BASS_CHANNELINFO; -#define BASS_ORIGRES_FLOAT 0x10000 +#define BASS_ORIGRES_FLOAT 0x10000 // BASS_CHANNELINFO types -#define BASS_CTYPE_SAMPLE 1 -#define BASS_CTYPE_RECORD 2 -#define BASS_CTYPE_STREAM 0x10000 -#define BASS_CTYPE_STREAM_OGG 0x10002 -#define BASS_CTYPE_STREAM_MP1 0x10003 -#define BASS_CTYPE_STREAM_MP2 0x10004 -#define BASS_CTYPE_STREAM_MP3 0x10005 -#define BASS_CTYPE_STREAM_AIFF 0x10006 -#define BASS_CTYPE_STREAM_CA 0x10007 -#define BASS_CTYPE_STREAM_MF 0x10008 -#define BASS_CTYPE_STREAM_AM 0x10009 -#define BASS_CTYPE_STREAM_DUMMY 0x18000 -#define BASS_CTYPE_STREAM_DEVICE 0x18001 -#define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec -#define BASS_CTYPE_STREAM_WAV_PCM 0x50001 -#define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003 -#define BASS_CTYPE_MUSIC_MOD 0x20000 -#define BASS_CTYPE_MUSIC_MTM 0x20001 -#define BASS_CTYPE_MUSIC_S3M 0x20002 -#define BASS_CTYPE_MUSIC_XM 0x20003 -#define BASS_CTYPE_MUSIC_IT 0x20004 -#define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag +#define BASS_CTYPE_SAMPLE 1 +#define BASS_CTYPE_RECORD 2 +#define BASS_CTYPE_STREAM 0x10000 +#define BASS_CTYPE_STREAM_OGG 0x10002 +#define BASS_CTYPE_STREAM_MP1 0x10003 +#define BASS_CTYPE_STREAM_MP2 0x10004 +#define BASS_CTYPE_STREAM_MP3 0x10005 +#define BASS_CTYPE_STREAM_AIFF 0x10006 +#define BASS_CTYPE_STREAM_CA 0x10007 +#define BASS_CTYPE_STREAM_MF 0x10008 +#define BASS_CTYPE_STREAM_AM 0x10009 +#define BASS_CTYPE_STREAM_DUMMY 0x18000 +#define BASS_CTYPE_STREAM_DEVICE 0x18001 +#define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec +#define BASS_CTYPE_STREAM_WAV_PCM 0x50001 +#define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003 +#define BASS_CTYPE_MUSIC_MOD 0x20000 +#define BASS_CTYPE_MUSIC_MTM 0x20001 +#define BASS_CTYPE_MUSIC_S3M 0x20002 +#define BASS_CTYPE_MUSIC_XM 0x20003 +#define BASS_CTYPE_MUSIC_IT 0x20004 +#define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag typedef struct { - DWORD ctype; // channel type -#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) - const wchar_t *name; // format description - const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) + DWORD ctype; // channel type +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // format description + const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) #else - const char *name; // format description - const char *exts; // file extension filter (*.ext1;*.ext2;etc...) + const char *name; // format description + const char *exts; // file extension filter (*.ext1;*.ext2;etc...) #endif } BASS_PLUGINFORM; typedef struct { - DWORD version; // version (same form as BASS_GetVersion) - DWORD formatc; // number of formats - const BASS_PLUGINFORM *formats; // the array of formats + DWORD version; // version (same form as BASS_GetVersion) + DWORD formatc; // number of formats + const BASS_PLUGINFORM *formats; // the array of formats } BASS_PLUGININFO; // 3D vector (for 3D positions/velocities/orientations) typedef struct BASS_3DVECTOR { #ifdef __cplusplus - BASS_3DVECTOR() {}; - BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}; + BASS_3DVECTOR(){}; + BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z){}; #endif - float x; // +=right, -=left - float y; // +=up, -=down - float z; // +=front, -=behind + float x; // +=right, -=left + float y; // +=up, -=down + float z; // +=front, -=behind } BASS_3DVECTOR; // 3D channel modes -#define BASS_3DMODE_NORMAL 0 // normal 3D processing -#define BASS_3DMODE_RELATIVE 1 // position is relative to the listener -#define BASS_3DMODE_OFF 2 // no 3D processing +#define BASS_3DMODE_NORMAL 0 // normal 3D processing +#define BASS_3DMODE_RELATIVE 1 // position is relative to the listener +#define BASS_3DMODE_OFF 2 // no 3D processing // software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) -#define BASS_3DALG_DEFAULT 0 -#define BASS_3DALG_OFF 1 -#define BASS_3DALG_FULL 2 -#define BASS_3DALG_LIGHT 3 +#define BASS_3DALG_DEFAULT 0 +#define BASS_3DALG_OFF 1 +#define BASS_3DALG_FULL 2 +#define BASS_3DALG_LIGHT 3 // EAX environments, use with BASS_SetEAXParameters -enum -{ +enum { EAX_ENVIRONMENT_GENERIC, EAX_ENVIRONMENT_PADDEDCELL, EAX_ENVIRONMENT_ROOM, @@ -465,38 +464,38 @@ enum EAX_ENVIRONMENT_DIZZY, EAX_ENVIRONMENT_PSYCHOTIC, - EAX_ENVIRONMENT_COUNT // total number of environments + EAX_ENVIRONMENT_COUNT // total number of environments }; // EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx) -#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F -#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F -#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F -#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F -#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F -#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F -#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F -#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F -#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F -#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F -#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F -#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F -#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F -#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F -#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F -#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F -#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F -#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F -#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F -#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F -#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F -#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F -#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F -#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F -#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F -#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F - -typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user); +#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC, 0.5F, 1.493F, 0.5F +#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL, 0.25F, 0.1F, 0.0F +#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM, 0.417F, 0.4F, 0.666F +#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM, 0.653F, 1.499F, 0.166F +#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM, 0.208F, 0.478F, 0.0F +#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM, 0.5F, 2.309F, 0.888F +#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM, 0.403F, 4.279F, 0.5F +#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL, 0.5F, 3.961F, 0.5F +#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE, 0.5F, 2.886F, 1.304F +#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA, 0.361F, 7.284F, 0.332F +#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR, 0.5F, 10.0F, 0.3F +#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153F, 0.259F, 2.0F +#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY, 0.361F, 1.493F, 0.0F +#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR, 0.444F, 2.697F, 0.638F +#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY, 0.25F, 1.752F, 0.776F +#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST, 0.111F, 3.145F, 0.472F +#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY, 0.111F, 2.767F, 0.224F +#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS, 0.194F, 7.841F, 0.472F +#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY, 1.0F, 1.499F, 0.5F +#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN, 0.097F, 2.767F, 0.224F +#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT, 0.208F, 1.652F, 1.5F +#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE, 0.652F, 2.886F, 0.25F +#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER, 1.0F, 1.499F, 0.0F +#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED, 0.875F, 8.392F, 1.388F +#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY, 0.139F, 17.234F, 0.666F +#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC, 0.486F, 7.563F, 0.806F + +typedef DWORD(CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user); /* User stream callback function. NOTE: A stream function should obviously be as quick as possible, other streams (and MOD musics) can't be mixed until it's finished. handle : The stream that needs writing @@ -505,73 +504,73 @@ length : Number of bytes to write user : The 'user' parameter value given when calling BASS_StreamCreate RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */ -#define BASS_STREAMPROC_END 0x80000000 // end of user stream flag +#define BASS_STREAMPROC_END 0x80000000 // end of user stream flag // special STREAMPROCs -#define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream -#define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream -#define STREAMPROC_DEVICE (STREAMPROC*)-2 // device mix stream -#define STREAMPROC_DEVICE_3D (STREAMPROC*)-3 // device 3D mix stream +#define STREAMPROC_DUMMY (STREAMPROC *)0 // "dummy" stream +#define STREAMPROC_PUSH (STREAMPROC *)-1 // push stream +#define STREAMPROC_DEVICE (STREAMPROC *)-2 // device mix stream +#define STREAMPROC_DEVICE_3D (STREAMPROC *)-3 // device 3D mix stream // BASS_StreamCreateFileUser file systems -#define STREAMFILE_NOBUFFER 0 -#define STREAMFILE_BUFFER 1 -#define STREAMFILE_BUFFERPUSH 2 +#define STREAMFILE_NOBUFFER 0 +#define STREAMFILE_BUFFER 1 +#define STREAMFILE_BUFFERPUSH 2 // User file stream callback functions -typedef void (CALLBACK FILECLOSEPROC)(void *user); -typedef QWORD (CALLBACK FILELENPROC)(void *user); -typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user); -typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user); +typedef void(CALLBACK FILECLOSEPROC)(void *user); +typedef QWORD(CALLBACK FILELENPROC)(void *user); +typedef DWORD(CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user); +typedef BOOL(CALLBACK FILESEEKPROC)(QWORD offset, void *user); typedef struct { - FILECLOSEPROC *close; - FILELENPROC *length; - FILEREADPROC *read; - FILESEEKPROC *seek; + FILECLOSEPROC *close; + FILELENPROC *length; + FILEREADPROC *read; + FILESEEKPROC *seek; } BASS_FILEPROCS; // BASS_StreamPutFileData options -#define BASS_FILEDATA_END 0 // end & close the file +#define BASS_FILEDATA_END 0 // end & close the file // BASS_StreamGetFilePosition modes -#define BASS_FILEPOS_CURRENT 0 -#define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT -#define BASS_FILEPOS_DOWNLOAD 1 -#define BASS_FILEPOS_END 2 -#define BASS_FILEPOS_START 3 -#define BASS_FILEPOS_CONNECTED 4 -#define BASS_FILEPOS_BUFFER 5 -#define BASS_FILEPOS_SOCKET 6 -#define BASS_FILEPOS_ASYNCBUF 7 -#define BASS_FILEPOS_SIZE 8 -#define BASS_FILEPOS_BUFFERING 9 - -typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); +#define BASS_FILEPOS_CURRENT 0 +#define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT +#define BASS_FILEPOS_DOWNLOAD 1 +#define BASS_FILEPOS_END 2 +#define BASS_FILEPOS_START 3 +#define BASS_FILEPOS_CONNECTED 4 +#define BASS_FILEPOS_BUFFER 5 +#define BASS_FILEPOS_SOCKET 6 +#define BASS_FILEPOS_ASYNCBUF 7 +#define BASS_FILEPOS_SIZE 8 +#define BASS_FILEPOS_BUFFERING 9 + +typedef void(CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); /* Internet stream download callback function. buffer : Buffer containing the downloaded data... NULL=end of download length : Number of bytes in the buffer user : The 'user' parameter value given when calling BASS_StreamCreateURL */ // BASS_ChannelSetSync types -#define BASS_SYNC_POS 0 -#define BASS_SYNC_END 2 -#define BASS_SYNC_META 4 -#define BASS_SYNC_SLIDE 5 -#define BASS_SYNC_STALL 6 -#define BASS_SYNC_DOWNLOAD 7 -#define BASS_SYNC_FREE 8 -#define BASS_SYNC_SETPOS 11 -#define BASS_SYNC_MUSICPOS 10 -#define BASS_SYNC_MUSICINST 1 -#define BASS_SYNC_MUSICFX 3 -#define BASS_SYNC_OGG_CHANGE 12 -#define BASS_SYNC_DEV_FAIL 14 -#define BASS_SYNC_DEV_FORMAT 15 -#define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime -#define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously - -typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user); +#define BASS_SYNC_POS 0 +#define BASS_SYNC_END 2 +#define BASS_SYNC_META 4 +#define BASS_SYNC_SLIDE 5 +#define BASS_SYNC_STALL 6 +#define BASS_SYNC_DOWNLOAD 7 +#define BASS_SYNC_FREE 8 +#define BASS_SYNC_SETPOS 11 +#define BASS_SYNC_MUSICPOS 10 +#define BASS_SYNC_MUSICINST 1 +#define BASS_SYNC_MUSICFX 3 +#define BASS_SYNC_OGG_CHANGE 12 +#define BASS_SYNC_DEV_FAIL 14 +#define BASS_SYNC_DEV_FORMAT 15 +#define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime +#define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously + +typedef void(CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user); /* Sync callback function. NOTE: a sync callback function should be very quick as other syncs can't be processed until it has finished. If the sync is a "mixtime" sync, then other streams and MOD musics can't be mixed until @@ -581,7 +580,7 @@ channel: Channel that the sync occured in data : Additional data associated with the sync's occurance user : The 'user' parameter given when calling BASS_ChannelSetSync */ -typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user); +typedef void(CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user); /* DSP callback function. NOTE: A DSP function should obviously be as quick as possible... other DSP functions, streams and MOD musics can not be processed until it's finished. @@ -591,7 +590,7 @@ buffer : Buffer to apply the DSP to length : Number of bytes in the buffer user : The 'user' parameter given when calling BASS_ChannelSetDSP */ -typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user); +typedef BOOL(CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user); /* Recording callback function. handle : The recording handle buffer : Buffer containing the recorded sample data @@ -600,396 +599,395 @@ user : The 'user' parameter value given when calling BASS_RecordStart RETURN : TRUE = continue recording, FALSE = stop */ // BASS_ChannelIsActive return values -#define BASS_ACTIVE_STOPPED 0 -#define BASS_ACTIVE_PLAYING 1 -#define BASS_ACTIVE_STALLED 2 -#define BASS_ACTIVE_PAUSED 3 -#define BASS_ACTIVE_PAUSED_DEVICE 4 +#define BASS_ACTIVE_STOPPED 0 +#define BASS_ACTIVE_PLAYING 1 +#define BASS_ACTIVE_STALLED 2 +#define BASS_ACTIVE_PAUSED 3 +#define BASS_ACTIVE_PAUSED_DEVICE 4 // Channel attributes -#define BASS_ATTRIB_FREQ 1 -#define BASS_ATTRIB_VOL 2 -#define BASS_ATTRIB_PAN 3 -#define BASS_ATTRIB_EAXMIX 4 -#define BASS_ATTRIB_NOBUFFER 5 -#define BASS_ATTRIB_VBR 6 -#define BASS_ATTRIB_CPU 7 -#define BASS_ATTRIB_SRC 8 -#define BASS_ATTRIB_NET_RESUME 9 -#define BASS_ATTRIB_SCANINFO 10 -#define BASS_ATTRIB_NORAMP 11 -#define BASS_ATTRIB_BITRATE 12 -#define BASS_ATTRIB_BUFFER 13 -#define BASS_ATTRIB_MUSIC_AMPLIFY 0x100 -#define BASS_ATTRIB_MUSIC_PANSEP 0x101 -#define BASS_ATTRIB_MUSIC_PSCALER 0x102 -#define BASS_ATTRIB_MUSIC_BPM 0x103 -#define BASS_ATTRIB_MUSIC_SPEED 0x104 +#define BASS_ATTRIB_FREQ 1 +#define BASS_ATTRIB_VOL 2 +#define BASS_ATTRIB_PAN 3 +#define BASS_ATTRIB_EAXMIX 4 +#define BASS_ATTRIB_NOBUFFER 5 +#define BASS_ATTRIB_VBR 6 +#define BASS_ATTRIB_CPU 7 +#define BASS_ATTRIB_SRC 8 +#define BASS_ATTRIB_NET_RESUME 9 +#define BASS_ATTRIB_SCANINFO 10 +#define BASS_ATTRIB_NORAMP 11 +#define BASS_ATTRIB_BITRATE 12 +#define BASS_ATTRIB_BUFFER 13 +#define BASS_ATTRIB_MUSIC_AMPLIFY 0x100 +#define BASS_ATTRIB_MUSIC_PANSEP 0x101 +#define BASS_ATTRIB_MUSIC_PSCALER 0x102 +#define BASS_ATTRIB_MUSIC_BPM 0x103 +#define BASS_ATTRIB_MUSIC_SPEED 0x104 #define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105 -#define BASS_ATTRIB_MUSIC_ACTIVE 0x106 -#define BASS_ATTRIB_MUSIC_VOL_CHAN 0x200 // + channel # -#define BASS_ATTRIB_MUSIC_VOL_INST 0x300 // + instrument # +#define BASS_ATTRIB_MUSIC_ACTIVE 0x106 +#define BASS_ATTRIB_MUSIC_VOL_CHAN 0x200 // + channel # +#define BASS_ATTRIB_MUSIC_VOL_INST 0x300 // + instrument # // BASS_ChannelSlideAttribute flags -#define BASS_SLIDE_LOG 0x1000000 +#define BASS_SLIDE_LOG 0x1000000 // BASS_ChannelGetData flags -#define BASS_DATA_AVAILABLE 0 // query how much data is buffered -#define BASS_DATA_FIXED 0x20000000 // flag: return 8.24 fixed-point data -#define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data -#define BASS_DATA_FFT256 0x80000000 // 256 sample FFT -#define BASS_DATA_FFT512 0x80000001 // 512 FFT -#define BASS_DATA_FFT1024 0x80000002 // 1024 FFT -#define BASS_DATA_FFT2048 0x80000003 // 2048 FFT -#define BASS_DATA_FFT4096 0x80000004 // 4096 FFT -#define BASS_DATA_FFT8192 0x80000005 // 8192 FFT -#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT -#define BASS_DATA_FFT32768 0x80000007 // 32768 FFT -#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined -#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window -#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias -#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data -#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value +#define BASS_DATA_AVAILABLE 0 // query how much data is buffered +#define BASS_DATA_FIXED 0x20000000 // flag: return 8.24 fixed-point data +#define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data +#define BASS_DATA_FFT256 0x80000000 // 256 sample FFT +#define BASS_DATA_FFT512 0x80000001 // 512 FFT +#define BASS_DATA_FFT1024 0x80000002 // 1024 FFT +#define BASS_DATA_FFT2048 0x80000003 // 2048 FFT +#define BASS_DATA_FFT4096 0x80000004 // 4096 FFT +#define BASS_DATA_FFT8192 0x80000005 // 8192 FFT +#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT +#define BASS_DATA_FFT32768 0x80000007 // 32768 FFT +#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined +#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window +#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias +#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data +#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value // BASS_ChannelGetLevelEx flags -#define BASS_LEVEL_MONO 1 -#define BASS_LEVEL_STEREO 2 -#define BASS_LEVEL_RMS 4 -#define BASS_LEVEL_VOLPAN 8 +#define BASS_LEVEL_MONO 1 +#define BASS_LEVEL_STEREO 2 +#define BASS_LEVEL_RMS 4 +#define BASS_LEVEL_VOLPAN 8 // BASS_ChannelGetTags types : what's returned -#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure -#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block -#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings -#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings -#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings -#define BASS_TAG_META 5 // ICY metadata : ANSI string -#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings -#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings -#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings -#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string -#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string -#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure -#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings -#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure -#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string -#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string -#define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings -#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure -#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure -#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string -#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure -#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure -#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure -#define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string -#define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string -#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers -#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string -#define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string -#define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string - +#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure +#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block +#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings +#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings +#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings +#define BASS_TAG_META 5 // ICY metadata : ANSI string +#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings +#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings +#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings +#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string +#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string +#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure +#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings +#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure +#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string +#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string +#define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings +#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure +#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure +#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string +#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure +#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure +#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure +#define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string +#define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string +#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers +#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string +#define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string +#define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string + // ID3v1 tag structure typedef struct { - char id[3]; - char title[30]; - char artist[30]; - char album[30]; - char year[4]; - char comment[30]; - BYTE genre; + char id[3]; + char title[30]; + char artist[30]; + char album[30]; + char year[4]; + char comment[30]; + BYTE genre; } TAG_ID3; - + // Binary APE tag structure -typedef struct { - const char *key; - const void *data; - DWORD length; -} TAG_APE_BINARY; - -// BWF "bext" tag structure +typedef struct { + const char *key; + const void *data; + DWORD length; +} TAG_APE_BINARY; + +// BWF "bext" tag structure #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable:4200) +#pragma warning(disable : 4200) #endif -#pragma pack(push,1) +#pragma pack(push, 1) typedef struct { - char Description[256]; // description - char Originator[32]; // name of the originator - char OriginatorReference[32]; // reference of the originator - char OriginationDate[10]; // date of creation (yyyy-mm-dd) - char OriginationTime[8]; // time of creation (hh-mm-ss) - QWORD TimeReference; // first sample count since midnight (little-endian) - WORD Version; // BWF version (little-endian) - BYTE UMID[64]; // SMPTE UMID - BYTE Reserved[190]; -#if defined(__GNUC__) && __GNUC__<3 - char CodingHistory[0]; // history -#elif 1 // change to 0 if compiler fails the following line - char CodingHistory[]; // history + char Description[256]; // description + char Originator[32]; // name of the originator + char OriginatorReference[32]; // reference of the originator + char OriginationDate[10]; // date of creation (yyyy-mm-dd) + char OriginationTime[8]; // time of creation (hh-mm-ss) + QWORD TimeReference; // first sample count since midnight (little-endian) + WORD Version; // BWF version (little-endian) + BYTE UMID[64]; // SMPTE UMID + BYTE Reserved[190]; +#if defined(__GNUC__) && __GNUC__ < 3 + char CodingHistory[0]; // history +#elif 1 // change to 0 if compiler fails the following line + char CodingHistory[]; // history #else - char CodingHistory[1]; // history + char CodingHistory[1]; // history #endif } TAG_BEXT; -#pragma pack(pop) - -// BWF "cart" tag structures -typedef struct -{ - DWORD dwUsage; // FOURCC timer usage ID - DWORD dwValue; // timer value in samples from head -} TAG_CART_TIMER; - -typedef struct -{ - char Version[4]; // version of the data structure - char Title[64]; // title of cart audio sequence - char Artist[64]; // artist or creator name - char CutID[64]; // cut number identification - char ClientID[64]; // client identification - char Category[64]; // category ID, PSA, NEWS, etc - char Classification[64]; // classification or auxiliary key - char OutCue[64]; // out cue text - char StartDate[10]; // yyyy-mm-dd - char StartTime[8]; // hh:mm:ss - char EndDate[10]; // yyyy-mm-dd - char EndTime[8]; // hh:mm:ss - char ProducerAppID[64]; // name of vendor or application - char ProducerAppVersion[64]; // version of producer application - char UserDef[64]; // user defined text - DWORD dwLevelReference; // sample value for 0 dB reference - TAG_CART_TIMER PostTimer[8]; // 8 time markers after head - char Reserved[276]; - char URL[1024]; // uniform resource locator -#if defined(__GNUC__) && __GNUC__<3 - char TagText[0]; // free form text for scripts or tags -#elif 1 // change to 0 if compiler fails the following line - char TagText[]; // free form text for scripts or tags -#else - char TagText[1]; // free form text for scripts or tags -#endif -} TAG_CART; - -// RIFF "cue " tag structures -typedef struct -{ - DWORD dwName; - DWORD dwPosition; - DWORD fccChunk; - DWORD dwChunkStart; - DWORD dwBlockStart; - DWORD dwSampleOffset; -} TAG_CUE_POINT; - -typedef struct -{ - DWORD dwCuePoints; -#if defined(__GNUC__) && __GNUC__<3 - TAG_CUE_POINT CuePoints[0]; -#elif 1 // change to 0 if compiler fails the following line - TAG_CUE_POINT CuePoints[]; -#else - TAG_CUE_POINT CuePoints[1]; -#endif -} TAG_CUE; - -// RIFF "smpl" tag structures -typedef struct -{ - DWORD dwIdentifier; - DWORD dwType; - DWORD dwStart; - DWORD dwEnd; - DWORD dwFraction; - DWORD dwPlayCount; -} TAG_SMPL_LOOP; - -typedef struct -{ - DWORD dwManufacturer; - DWORD dwProduct; - DWORD dwSamplePeriod; - DWORD dwMIDIUnityNote; - DWORD dwMIDIPitchFraction; - DWORD dwSMPTEFormat; - DWORD dwSMPTEOffset; - DWORD cSampleLoops; - DWORD cbSamplerData; -#if defined(__GNUC__) && __GNUC__<3 - TAG_SMPL_LOOP SampleLoops[0]; -#elif 1 // change to 0 if compiler fails the following line - TAG_SMPL_LOOP SampleLoops[]; -#else - TAG_SMPL_LOOP SampleLoops[1]; -#endif -} TAG_SMPL; -#ifdef _MSC_VER -#pragma warning(pop) -#endif - +#pragma pack(pop) + +// BWF "cart" tag structures +typedef struct +{ + DWORD dwUsage; // FOURCC timer usage ID + DWORD dwValue; // timer value in samples from head +} TAG_CART_TIMER; + +typedef struct +{ + char Version[4]; // version of the data structure + char Title[64]; // title of cart audio sequence + char Artist[64]; // artist or creator name + char CutID[64]; // cut number identification + char ClientID[64]; // client identification + char Category[64]; // category ID, PSA, NEWS, etc + char Classification[64]; // classification or auxiliary key + char OutCue[64]; // out cue text + char StartDate[10]; // yyyy-mm-dd + char StartTime[8]; // hh:mm:ss + char EndDate[10]; // yyyy-mm-dd + char EndTime[8]; // hh:mm:ss + char ProducerAppID[64]; // name of vendor or application + char ProducerAppVersion[64]; // version of producer application + char UserDef[64]; // user defined text + DWORD dwLevelReference; // sample value for 0 dB reference + TAG_CART_TIMER PostTimer[8]; // 8 time markers after head + char Reserved[276]; + char URL[1024]; // uniform resource locator +#if defined(__GNUC__) && __GNUC__ < 3 + char TagText[0]; // free form text for scripts or tags +#elif 1 // change to 0 if compiler fails the following line + char TagText[]; // free form text for scripts or tags +#else + char TagText[1]; // free form text for scripts or tags +#endif +} TAG_CART; + +// RIFF "cue " tag structures +typedef struct +{ + DWORD dwName; + DWORD dwPosition; + DWORD fccChunk; + DWORD dwChunkStart; + DWORD dwBlockStart; + DWORD dwSampleOffset; +} TAG_CUE_POINT; + +typedef struct +{ + DWORD dwCuePoints; +#if defined(__GNUC__) && __GNUC__ < 3 + TAG_CUE_POINT CuePoints[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_CUE_POINT CuePoints[]; +#else + TAG_CUE_POINT CuePoints[1]; +#endif +} TAG_CUE; + +// RIFF "smpl" tag structures +typedef struct +{ + DWORD dwIdentifier; + DWORD dwType; + DWORD dwStart; + DWORD dwEnd; + DWORD dwFraction; + DWORD dwPlayCount; +} TAG_SMPL_LOOP; + +typedef struct +{ + DWORD dwManufacturer; + DWORD dwProduct; + DWORD dwSamplePeriod; + DWORD dwMIDIUnityNote; + DWORD dwMIDIPitchFraction; + DWORD dwSMPTEFormat; + DWORD dwSMPTEOffset; + DWORD cSampleLoops; + DWORD cbSamplerData; +#if defined(__GNUC__) && __GNUC__ < 3 + TAG_SMPL_LOOP SampleLoops[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_SMPL_LOOP SampleLoops[]; +#else + TAG_SMPL_LOOP SampleLoops[1]; +#endif +} TAG_SMPL; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + // CoreAudio codec info structure typedef struct { - DWORD ftype; // file format - DWORD atype; // audio format - const char *name; // description + DWORD ftype; // file format + DWORD atype; // audio format + const char *name; // description } TAG_CA_CODEC; -#ifndef _WAVEFORMATEX_ -#define _WAVEFORMATEX_ -#pragma pack(push,1) -typedef struct tWAVEFORMATEX -{ - WORD wFormatTag; - WORD nChannels; - DWORD nSamplesPerSec; - DWORD nAvgBytesPerSec; - WORD nBlockAlign; - WORD wBitsPerSample; - WORD cbSize; -} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; -typedef const WAVEFORMATEX *LPCWAVEFORMATEX; -#pragma pack(pop) -#endif - +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ +#pragma pack(push, 1) +typedef struct tWAVEFORMATEX { + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; +} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#pragma pack(pop) +#endif + // BASS_ChannelGetLength/GetPosition/SetPosition modes -#define BASS_POS_BYTE 0 // byte position -#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) -#define BASS_POS_OGG 3 // OGG bitstream number -#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers -#define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position -#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position -#define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position -#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking -#define BASS_POS_SCAN 0x40000000 // flag: scan to the position +#define BASS_POS_BYTE 0 // byte position +#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) +#define BASS_POS_OGG 3 // OGG bitstream number +#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers +#define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position +#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position +#define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position +#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking +#define BASS_POS_SCAN 0x40000000 // flag: scan to the position // BASS_ChannelSetDevice/GetDevice option -#define BASS_NODEVICE 0x20000 +#define BASS_NODEVICE 0x20000 // BASS_RecordSetInput flags -#define BASS_INPUT_OFF 0x10000 -#define BASS_INPUT_ON 0x20000 - -#define BASS_INPUT_TYPE_MASK 0xff000000 -#define BASS_INPUT_TYPE_UNDEF 0x00000000 -#define BASS_INPUT_TYPE_DIGITAL 0x01000000 -#define BASS_INPUT_TYPE_LINE 0x02000000 -#define BASS_INPUT_TYPE_MIC 0x03000000 -#define BASS_INPUT_TYPE_SYNTH 0x04000000 -#define BASS_INPUT_TYPE_CD 0x05000000 -#define BASS_INPUT_TYPE_PHONE 0x06000000 -#define BASS_INPUT_TYPE_SPEAKER 0x07000000 -#define BASS_INPUT_TYPE_WAVE 0x08000000 -#define BASS_INPUT_TYPE_AUX 0x09000000 -#define BASS_INPUT_TYPE_ANALOG 0x0a000000 +#define BASS_INPUT_OFF 0x10000 +#define BASS_INPUT_ON 0x20000 + +#define BASS_INPUT_TYPE_MASK 0xff000000 +#define BASS_INPUT_TYPE_UNDEF 0x00000000 +#define BASS_INPUT_TYPE_DIGITAL 0x01000000 +#define BASS_INPUT_TYPE_LINE 0x02000000 +#define BASS_INPUT_TYPE_MIC 0x03000000 +#define BASS_INPUT_TYPE_SYNTH 0x04000000 +#define BASS_INPUT_TYPE_CD 0x05000000 +#define BASS_INPUT_TYPE_PHONE 0x06000000 +#define BASS_INPUT_TYPE_SPEAKER 0x07000000 +#define BASS_INPUT_TYPE_WAVE 0x08000000 +#define BASS_INPUT_TYPE_AUX 0x09000000 +#define BASS_INPUT_TYPE_ANALOG 0x0a000000 // BASS_ChannelSetFX effect types -#define BASS_FX_DX8_CHORUS 0 -#define BASS_FX_DX8_COMPRESSOR 1 -#define BASS_FX_DX8_DISTORTION 2 -#define BASS_FX_DX8_ECHO 3 -#define BASS_FX_DX8_FLANGER 4 -#define BASS_FX_DX8_GARGLE 5 -#define BASS_FX_DX8_I3DL2REVERB 6 -#define BASS_FX_DX8_PARAMEQ 7 -#define BASS_FX_DX8_REVERB 8 -#define BASS_FX_VOLUME 9 +#define BASS_FX_DX8_CHORUS 0 +#define BASS_FX_DX8_COMPRESSOR 1 +#define BASS_FX_DX8_DISTORTION 2 +#define BASS_FX_DX8_ECHO 3 +#define BASS_FX_DX8_FLANGER 4 +#define BASS_FX_DX8_GARGLE 5 +#define BASS_FX_DX8_I3DL2REVERB 6 +#define BASS_FX_DX8_PARAMEQ 7 +#define BASS_FX_DX8_REVERB 8 +#define BASS_FX_VOLUME 9 typedef struct { - float fWetDryMix; - float fDepth; - float fFeedback; - float fFrequency; - DWORD lWaveform; // 0=triangle, 1=sine - float fDelay; - DWORD lPhase; // BASS_DX8_PHASE_xxx + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx } BASS_DX8_CHORUS; typedef struct { - float fGain; - float fAttack; - float fRelease; - float fThreshold; - float fRatio; - float fPredelay; + float fGain; + float fAttack; + float fRelease; + float fThreshold; + float fRatio; + float fPredelay; } BASS_DX8_COMPRESSOR; typedef struct { - float fGain; - float fEdge; - float fPostEQCenterFrequency; - float fPostEQBandwidth; - float fPreLowpassCutoff; + float fGain; + float fEdge; + float fPostEQCenterFrequency; + float fPostEQBandwidth; + float fPreLowpassCutoff; } BASS_DX8_DISTORTION; typedef struct { - float fWetDryMix; - float fFeedback; - float fLeftDelay; - float fRightDelay; - BOOL lPanDelay; + float fWetDryMix; + float fFeedback; + float fLeftDelay; + float fRightDelay; + BOOL lPanDelay; } BASS_DX8_ECHO; typedef struct { - float fWetDryMix; - float fDepth; - float fFeedback; - float fFrequency; - DWORD lWaveform; // 0=triangle, 1=sine - float fDelay; - DWORD lPhase; // BASS_DX8_PHASE_xxx + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx } BASS_DX8_FLANGER; typedef struct { - DWORD dwRateHz; // Rate of modulation in hz - DWORD dwWaveShape; // 0=triangle, 1=square + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // 0=triangle, 1=square } BASS_DX8_GARGLE; typedef struct { - int lRoom; // [-10000, 0] default: -1000 mB - int lRoomHF; // [-10000, 0] default: 0 mB - float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 - float flDecayTime; // [0.1, 20.0] default: 1.49s - float flDecayHFRatio; // [0.1, 2.0] default: 0.83 - int lReflections; // [-10000, 1000] default: -2602 mB - float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s - int lReverb; // [-10000, 2000] default: 200 mB - float flReverbDelay; // [0.0, 0.1] default: 0.011 s - float flDiffusion; // [0.0, 100.0] default: 100.0 % - float flDensity; // [0.0, 100.0] default: 100.0 % - float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz + int lRoom; // [-10000, 0] default: -1000 mB + int lRoomHF; // [-10000, 0] default: 0 mB + float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + float flDecayTime; // [0.1, 20.0] default: 1.49s + float flDecayHFRatio; // [0.1, 2.0] default: 0.83 + int lReflections; // [-10000, 1000] default: -2602 mB + float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + int lReverb; // [-10000, 2000] default: 200 mB + float flReverbDelay; // [0.0, 0.1] default: 0.011 s + float flDiffusion; // [0.0, 100.0] default: 100.0 % + float flDensity; // [0.0, 100.0] default: 100.0 % + float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz } BASS_DX8_I3DL2REVERB; typedef struct { - float fCenter; - float fBandwidth; - float fGain; + float fCenter; + float fBandwidth; + float fGain; } BASS_DX8_PARAMEQ; typedef struct { - float fInGain; // [-96.0,0.0] default: 0.0 dB - float fReverbMix; // [-96.0,0.0] default: 0.0 db - float fReverbTime; // [0.001,3000.0] default: 1000.0 ms - float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 + float fInGain; // [-96.0,0.0] default: 0.0 dB + float fReverbMix; // [-96.0,0.0] default: 0.0 db + float fReverbTime; // [0.001,3000.0] default: 1000.0 ms + float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 } BASS_DX8_REVERB; -#define BASS_DX8_PHASE_NEG_180 0 -#define BASS_DX8_PHASE_NEG_90 1 -#define BASS_DX8_PHASE_ZERO 2 -#define BASS_DX8_PHASE_90 3 -#define BASS_DX8_PHASE_180 4 - +#define BASS_DX8_PHASE_NEG_180 0 +#define BASS_DX8_PHASE_NEG_90 1 +#define BASS_DX8_PHASE_ZERO 2 +#define BASS_DX8_PHASE_90 3 +#define BASS_DX8_PHASE_180 4 + typedef struct { - float fTarget; - float fCurrent; - float fTime; - DWORD lCurve; + float fTarget; + float fCurrent; + float fTime; + DWORD lCurve; } BASS_FX_VOLUME_PARAM; - -typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status); -/* iOS notification callback function. -status : The notification (BASS_IOSNOTIFY_xxx) */ - -#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started -#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended + +typedef void(CALLBACK IOSNOTIFYPROC)(DWORD status); +/* iOS notification callback function. +status : The notification (BASS_IOSNOTIFY_xxx) */ + +#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started +#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value); DWORD BASSDEF(BASS_GetConfig)(DWORD option); @@ -998,7 +996,7 @@ void *BASSDEF(BASS_GetConfigPtr)(DWORD option); DWORD BASSDEF(BASS_GetVersion)(); int BASSDEF(BASS_ErrorGetCode)(); BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid); #else BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid); @@ -1006,7 +1004,7 @@ BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *ds BOOL BASSDEF(BASS_SetDevice)(DWORD device); DWORD BASSDEF(BASS_GetDevice)(); BOOL BASSDEF(BASS_Free)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) void *BASSDEF(BASS_GetDSoundObject)(DWORD object); #endif BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); @@ -1028,7 +1026,7 @@ BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top); BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top); void BASSDEF(BASS_Apply3D)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp); BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp); #endif @@ -1094,7 +1092,7 @@ QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode); BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode); QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode); DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle); -BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); +BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length); HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user); BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync); @@ -1109,41 +1107,41 @@ BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params); BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params); BOOL BASSDEF(BASS_FXReset)(HFX handle); BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); - + #ifdef __cplusplus } - -#if defined(_WIN32) && !defined(NOBASSOVERLOADS) -static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) -{ - return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); -} - -static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) -{ - return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); -} - -static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) -{ - return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE); -} - -static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) -{ - return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); -} - -static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) -{ - return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); -} - -static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value) -{ - return BASS_SetConfigPtr(option|BASS_UNICODE, (const void*)value); -} -#endif + +#if defined(_WIN32) && !defined(NOBASSOVERLOADS) +static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +{ + return BASS_PluginLoad((const char *)file, flags | BASS_UNICODE); +} + +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +{ + return BASS_MusicLoad(mem, (const void *)file, offset, length, flags | BASS_UNICODE, freq); +} + +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +{ + return BASS_SampleLoad(mem, (const void *)file, offset, length, max, flags | BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_StreamCreateFile(mem, (const void *)file, offset, length, flags | BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_StreamCreateURL((const char *)url, offset, flags | BASS_UNICODE, proc, user); +} + +static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value) +{ + return BASS_SetConfigPtr(option | BASS_UNICODE, (const void *)value); +} +#endif #endif #endif diff --git a/include/bassopus.h b/include/bassopus.h index 4e48124f..757ff70c 100644 --- a/include/bassopus.h +++ b/include/bassopus.h @@ -10,7 +10,7 @@ #include "bass.h" -#if BASSVERSION!=0x204 +#if BASSVERSION != 0x204 #error conflicting BASS and BASSOPUS versions #endif @@ -23,11 +23,11 @@ extern "C" { #endif // BASS_CHANNELINFO type -#define BASS_CTYPE_STREAM_OPUS 0x11200 +#define BASS_CTYPE_STREAM_OPUS 0x11200 // Additional attributes -#define BASS_ATTRIB_OPUS_ORIGFREQ 0x13000 -#define BASS_ATTRIB_OPUS_GAIN 0x13001 +#define BASS_ATTRIB_OPUS_ORIGFREQ 0x13000 +#define BASS_ATTRIB_OPUS_GAIN 0x13001 HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); @@ -39,12 +39,12 @@ HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFileUser)(DWORD system, DWORD flags, c #if defined(_WIN32) && !defined(NOBASSOVERLOADS) static inline HSTREAM BASS_OPUS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) { - return BASS_OPUS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); + return BASS_OPUS_StreamCreateFile(mem, (const void *)file, offset, length, flags | BASS_UNICODE); } static inline HSTREAM BASS_OPUS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) { - return BASS_OPUS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); + return BASS_OPUS_StreamCreateURL((const char *)url, offset, flags | BASS_UNICODE, proc, user); } #endif #endif diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h index 303c2351..c2d32b24 100644 --- a/include/chatlogpiece.h +++ b/include/chatlogpiece.h @@ -1,31 +1,30 @@ #ifndef CHATLOGPIECE_H #define CHATLOGPIECE_H -#include #include +#include -class chatlogpiece -{ +class chatlogpiece { public: - chatlogpiece(); - chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song); - chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song, QDateTime p_datetime); + chatlogpiece(); + chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song); + chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song, QDateTime p_datetime); - QString get_name(); - QString get_showname(); - QString get_message(); - bool is_song(); - QDateTime get_datetime(); - QString get_datetime_as_string(); + QString get_name(); + QString get_showname(); + QString get_message(); + bool is_song(); + QDateTime get_datetime(); + QString get_datetime_as_string(); - QString get_full(); + QString get_full(); private: - QString name; - QString showname; - QString message; - QDateTime datetime; - bool p_is_song; + QString name; + QString showname; + QString message; + QDateTime datetime; + bool p_is_song; }; #endif // CHATLOGPIECE_H diff --git a/include/courtroom.h b/include/courtroom.h index c1bd0a64..c3c6b87e 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -1,792 +1,785 @@ #ifndef COURTROOM_H #define COURTROOM_H -#include "aoimage.h" +#include "aoapplication.h" +#include "aoblipplayer.h" #include "aobutton.h" #include "aocharbutton.h" +#include "aocharmovie.h" #include "aoemotebutton.h" -#include "aopacket.h" -#include "aoscene.h" +#include "aoevidencebutton.h" +#include "aoevidencedisplay.h" +#include "aoimage.h" +#include "aolineedit.h" #include "aomovie.h" -#include "aocharmovie.h" #include "aomusicplayer.h" #include "aooptionsdialog.h" +#include "aopacket.h" +#include "aoscene.h" #include "aosfxplayer.h" -#include "aoblipplayer.h" -#include "aoevidencebutton.h" #include "aotextarea.h" -#include "aolineedit.h" #include "aotextedit.h" -#include "aoevidencedisplay.h" -#include "datatypes.h" -#include "aoapplication.h" -#include "lobby.h" -#include "hardware_functions.h" -#include "file_functions.h" +#include "chatlogpiece.h" #include "datatypes.h" #include "debug_functions.h" -#include "chatlogpiece.h" +#include "file_functions.h" +#include "hardware_functions.h" +#include "lobby.h" #include "scrolltext.h" -#include -#include -#include -#include -#include -#include #include -#include -#include -#include #include +#include +#include +#include +#include +#include #include -#include +#include +#include #include +#include +#include +#include -#include -#include -#include #include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include //#include #include class AOApplication; -class Courtroom : public QMainWindow -{ - Q_OBJECT +class Courtroom : public QMainWindow { + Q_OBJECT public: - explicit Courtroom(AOApplication *p_ao_app); - - void append_char(char_type p_char){char_list.append(p_char);} - void append_evidence(evi_type p_evi){evidence_list.append(p_evi);} - void append_music(QString f_music){music_list.append(f_music);} - void append_area(QString f_area){area_list.append(f_area);} - void clear_music(){music_list.clear();} - void clear_areas(){area_list.clear();} - - void fix_last_area() - { - if (area_list.size() > 0) - { - QString malplaced = area_list.last(); - area_list.removeLast(); - append_music(malplaced); - } - } - - void arup_append(int players, QString status, QString cm, QString locked) - { - arup_players.append(players); - arup_statuses.append(status); - arup_cms.append(cm); - arup_locks.append(locked); - } - - void arup_modify(int type, int place, QString value) - { - if (type == 0) - { - if (arup_players.size() > place) - arup_players[place] = value.toInt(); - } - else if (type == 1) + explicit Courtroom(AOApplication *p_ao_app); + + void append_char(char_type p_char) { char_list.append(p_char); } + void append_evidence(evi_type p_evi) { evidence_list.append(p_evi); } + void append_music(QString f_music) { music_list.append(f_music); } + void append_area(QString f_area) { area_list.append(f_area); } + void clear_music() { music_list.clear(); } + void clear_areas() { area_list.clear(); } + + void fix_last_area() { - if (arup_statuses.size() > place) - arup_statuses[place] = value; + if (area_list.size() > 0) { + QString malplaced = area_list.last(); + area_list.removeLast(); + append_music(malplaced); + } } - else if (type == 2) + + void arup_append(int players, QString status, QString cm, QString locked) { - if (arup_cms.size() > place) - arup_cms[place] = value; + arup_players.append(players); + arup_statuses.append(status); + arup_cms.append(cm); + arup_locks.append(locked); } - else if (type == 3) + + void arup_modify(int type, int place, QString value) { - if (arup_locks.size() > place) - arup_locks[place] = value; + if (type == 0) { + if (arup_players.size() > place) + arup_players[place] = value.toInt(); + } + else if (type == 1) { + if (arup_statuses.size() > place) + arup_statuses[place] = value; + } + else if (type == 2) { + if (arup_cms.size() > place) + arup_cms[place] = value; + } + else if (type == 3) { + if (arup_locks.size() > place) + arup_locks[place] = value; + } + list_areas(); } - list_areas(); - } - void character_loading_finished(); + void character_loading_finished(); - //sets position of widgets based on theme ini files - void set_widgets(); + //sets position of widgets based on theme ini files + void set_widgets(); - //sets font size based on theme ini files - void set_font(QWidget *widget, QString class_name, QString p_identifier); + //sets font size based on theme ini files + void set_font(QWidget *widget, QString class_name, QString p_identifier); - //Get the properly constructed font - QFont get_qfont(QString font_name, int f_pointsize, bool antialias=true); + //Get the properly constructed font + QFont get_qfont(QString font_name, int f_pointsize, bool antialias = true); - //actual operation of setting the font on a widget - void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); + //actual operation of setting the font on a widget + void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); - //helper function that calls above function on the relevant widgets - void set_fonts(); + //helper function that calls above function on the relevant widgets + void set_fonts(); - //sets dropdown menu stylesheet - void set_dropdown(QWidget *widget); + //sets dropdown menu stylesheet + void set_dropdown(QWidget *widget); - //helper funciton that call above function on the relevant widgets - void set_dropdowns(); + //helper funciton that call above function on the relevant widgets + void set_dropdowns(); - void set_window_title(QString p_title); + void set_window_title(QString p_title); - //reads theme inis and sets size and pos based on the identifier - void set_size_and_pos(QWidget *p_widget, QString p_identifier); + //reads theme inis and sets size and pos based on the identifier + void set_size_and_pos(QWidget *p_widget, QString p_identifier); - //reads theme inis and returns the size and pos as defined by it - QPoint get_theme_pos(QString p_identifier); + //reads theme inis and returns the size and pos as defined by it + QPoint get_theme_pos(QString p_identifier); - //sets status as taken on character with cid n_char and places proper shading on charselect - void set_taken(int n_char, bool p_taken); + //sets status as taken on character with cid n_char and places proper shading on charselect + void set_taken(int n_char, bool p_taken); - //sets the current background to argument. also does some checks to see if it's a legacy bg - void set_background(QString p_background, bool display=false); + //sets the current background to argument. also does some checks to see if it's a legacy bg + void set_background(QString p_background, bool display = false); - //sets the local character pos/side to use. - void set_side(QString p_side); + //sets the local character pos/side to use. + void set_side(QString p_side); - //sets the pos dropdown - void set_pos_dropdown(QStringList pos_dropdowns); + //sets the pos dropdown + void set_pos_dropdown(QStringList pos_dropdowns); - //sets the evidence list member variable to argument - void set_evidence_list(QVector &p_evi_list); + //sets the evidence list member variable to argument + void set_evidence_list(QVector &p_evi_list); - //called when a DONE#% from the server was received - void done_received(); + //called when a DONE#% from the server was received + void done_received(); - //sets the local mute list based on characters available on the server - void set_mute_list(); + //sets the local mute list based on characters available on the server + void set_mute_list(); - // Sets the local pair list based on the characters available on the server. - void set_pair_list(); + // Sets the local pair list based on the characters available on the server. + void set_pair_list(); - //sets desk and bg based on pos in chatmessage - void set_scene(QString f_desk_mod, QString f_side); + //sets desk and bg based on pos in chatmessage + void set_scene(QString f_desk_mod, QString f_side); - //takes in serverD-formatted IP list as prints a converted version to server OOC - //admittedly poorly named - void set_ip_list(QString p_list); + //takes in serverD-formatted IP list as prints a converted version to server OOC + //admittedly poorly named + void set_ip_list(QString p_list); - //disables chat if current cid matches second argument - //enables if p_muted is false - void set_mute(bool p_muted, int p_cid); + //disables chat if current cid matches second argument + //enables if p_muted is false + void set_mute(bool p_muted, int p_cid); - //send a message that the player is banned and quits the server - void set_ban(int p_cid); + //send a message that the player is banned and quits the server + void set_ban(int p_cid); - //cid = character id, returns the cid of the currently selected character - int get_cid() {return m_cid;} - QString get_current_char() {return current_char;} - QString get_current_background() {return current_background;} + //cid = character id, returns the cid of the currently selected character + int get_cid() { return m_cid; } + QString get_current_char() { return current_char; } + QString get_current_background() { return current_background; } - //updates character to p_cid and updates necessary ui elements - void update_character(int p_cid); + //updates character to p_cid and updates necessary ui elements + void update_character(int p_cid); - //properly sets up some varibles: resets user state - void enter_courtroom(); + //properly sets up some varibles: resets user state + void enter_courtroom(); - //helper function that populates ui_music_list with the contents of music_list - void list_music(); - void list_areas(); + //helper function that populates ui_music_list with the contents of music_list + void list_music(); + void list_areas(); - //these are for OOC chat - void append_ms_chatmessage(QString f_name, QString f_message); - void append_server_chatmessage(QString p_name, QString p_message, QString p_color); + //these are for OOC chat + void append_ms_chatmessage(QString f_name, QString f_message); + void append_server_chatmessage(QString p_name, QString p_message, QString p_color); - //these functions handle chatmessages sequentially. - //The process itself is very convoluted and merits separate documentation - //But the general idea is objection animation->pre animation->talking->idle - void handle_chatmessage(QStringList *p_contents); - void handle_chatmessage_2(); - void handle_chatmessage_3(); + //these functions handle chatmessages sequentially. + //The process itself is very convoluted and merits separate documentation + //But the general idea is objection animation->pre animation->talking->idle + void handle_chatmessage(QStringList *p_contents); + void handle_chatmessage_2(); + void handle_chatmessage_3(); - //This function filters out the common CC inline text trickery, for appending to - //the IC chatlog. - QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); + //This function filters out the common CC inline text trickery, for appending to + //the IC chatlog. + QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); - //adds text to the IC chatlog. p_name first as bold then p_text then a newlin - //this function keeps the chatlog scrolled to the top unless there's text selected - // or the user isn't already scrolled to the top - void append_ic_text(QString p_text, QString p_name = "", QString action = ""); + //adds text to the IC chatlog. p_name first as bold then p_text then a newlin + //this function keeps the chatlog scrolled to the top unless there's text selected + // or the user isn't already scrolled to the top + void append_ic_text(QString p_text, QString p_name = "", QString action = ""); - //prints who played the song to IC chat and plays said song(if found on local filesystem) - //takes in a list where the first element is the song name and the second is the char id of who played it - void handle_song(QStringList *p_contents); + //prints who played the song to IC chat and plays said song(if found on local filesystem) + //takes in a list where the first element is the song name and the second is the char id of who played it + void handle_song(QStringList *p_contents); - void play_preanim(bool noninterrupting); + void play_preanim(bool noninterrupting); - //plays the witness testimony or cross examination animation based on argument - void handle_wtce(QString p_wtce, int variant); + //plays the witness testimony or cross examination animation based on argument + void handle_wtce(QString p_wtce, int variant); - //sets the hp bar of defense(p_bar 1) or pro(p_bar 2) - //state is an number between 0 and 10 inclusive - void set_hp_bar(int p_bar, int p_state); + //sets the hp bar of defense(p_bar 1) or pro(p_bar 2) + //state is an number between 0 and 10 inclusive + void set_hp_bar(int p_bar, int p_state); - //Toggles the judge buttons, whether they should appear or not. - void toggle_judge_buttons(bool is_on); + //Toggles the judge buttons, whether they should appear or not. + void toggle_judge_buttons(bool is_on); - void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); - void check_connection_received(); + void check_connection_received(); - ~Courtroom(); + ~Courtroom(); private: - AOApplication *ao_app; + AOApplication *ao_app; - int m_courtroom_width = 714; - int m_courtroom_height = 668; + int m_courtroom_width = 714; + int m_courtroom_height = 668; - int m_viewport_x = 0; - int m_viewport_y = 0; + int m_viewport_x = 0; + int m_viewport_y = 0; - int m_viewport_width = 256; - int m_viewport_height = 192; + int m_viewport_width = 256; + int m_viewport_height = 192; - bool first_message_sent = false; - int maximumMessages = 0; + bool first_message_sent = false; + int maximumMessages = 0; - QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; + QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; - bool next_character_is_not_special = false; // If true, write the - // next character as it is. + bool next_character_is_not_special = false; // If true, write the + // next character as it is. - bool message_is_centered = false; + bool message_is_centered = false; - int current_display_speed = 3; - int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; + int current_display_speed = 3; + int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; - // The character ID of the character this user wants to appear alongside with. - int other_charid = -1; + // The character ID of the character this user wants to appear alongside with. + int other_charid = -1; - // The offset this user has given if they want to appear alongside someone. - int char_offset = 0; + // The offset this user has given if they want to appear alongside someone. + int char_offset = 0; - // 0 = in front, 1 = behind - int pair_order = 0; + // 0 = in front, 1 = behind + int pair_order = 0; - QVector char_list; - QVector evidence_list; - QVector music_list; - QVector area_list; + QVector char_list; + QVector evidence_list; + QVector music_list; + QVector area_list; - QVector arup_players; - QVector arup_statuses; - QVector arup_cms; - QVector arup_locks; + QVector arup_players; + QVector arup_statuses; + QVector arup_cms; + QVector arup_locks; - QVector ic_chatlog_history; + QVector ic_chatlog_history; - //triggers ping_server() every 60 seconds - QTimer *keepalive_timer; + //triggers ping_server() every 60 seconds + QTimer *keepalive_timer; - //determines how fast messages tick onto screen - QTimer *chat_tick_timer; - //int chat_tick_interval = 60; - //which tick position(character in chat message) we are at - int tick_pos = 0; - //the actual document tick pos we gotta worry about for making the text scroll better - int real_tick_pos = 0; - //used to determine how often blips sound - int blip_ticker = 0; - int blip_rate = 1; - int rainbow_counter = 0; - bool rainbow_appended = false; - bool blank_blip = false; + //determines how fast messages tick onto screen + QTimer *chat_tick_timer; + //int chat_tick_interval = 60; + //which tick position(character in chat message) we are at + int tick_pos = 0; + //the actual document tick pos we gotta worry about for making the text scroll better + int real_tick_pos = 0; + //used to determine how often blips sound + int blip_ticker = 0; + int blip_rate = 1; + int rainbow_counter = 0; + bool rainbow_appended = false; + bool blank_blip = false; - //Whether or not is this message additive to the previous one - bool is_additive = false; + //Whether or not is this message additive to the previous one + bool is_additive = false; - // Used for getting the current maximum blocks allowed in the IC chatlog. - int log_maximum_blocks = 0; + // Used for getting the current maximum blocks allowed in the IC chatlog. + int log_maximum_blocks = 0; - // True, if the log should go downwards. - bool log_goes_downwards = false; + // True, if the log should go downwards. + bool log_goes_downwards = false; - //delay before chat messages starts ticking - QTimer *text_delay_timer; + //delay before chat messages starts ticking + QTimer *text_delay_timer; - //delay before sfx plays - QTimer *sfx_delay_timer; + //delay before sfx plays + QTimer *sfx_delay_timer; - //every time point in char.inis times this equals the final time - const int time_mod = 40; + //every time point in char.inis times this equals the final time + const int time_mod = 40; - //the amount of time non-animated objection/hold it/takethat images stay onscreen for in ms - const int shout_stay_time = 724; + //the amount of time non-animated objection/hold it/takethat images stay onscreen for in ms + const int shout_stay_time = 724; - //the amount of time non-animated guilty/not guilty images stay onscreen for in ms - const int verdict_stay_time = 3000; + //the amount of time non-animated guilty/not guilty images stay onscreen for in ms + const int verdict_stay_time = 3000; - //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms - const int wtce_stay_time = 1500; + //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms + const int wtce_stay_time = 1500; - //characters we consider punctuation - const QString punctuation_chars = ".,?!:;"; + //characters we consider punctuation + const QString punctuation_chars = ".,?!:;"; - //amount by which we multiply the delay when we parse punctuation chars - const int punctuation_modifier = 3; + //amount by which we multiply the delay when we parse punctuation chars + const int punctuation_modifier = 3; - static const int chatmessage_size = 30; - QString m_chatmessage[chatmessage_size]; - bool chatmessage_is_empty = false; + static const int chatmessage_size = 30; + QString m_chatmessage[chatmessage_size]; + bool chatmessage_is_empty = false; - QString previous_ic_message = ""; - QString additive_previous = ""; + QString previous_ic_message = ""; + QString additive_previous = ""; - //char id, muted or not - QMap mute_map; + //char id, muted or not + QMap mute_map; - //QVector muted_cids; + //QVector muted_cids; - bool is_muted = false; + bool is_muted = false; - //state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = noniterrupting preanim - int anim_state = 3; + //state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = noniterrupting preanim + int anim_state = 3; - //whether or not current color is a talking one - bool color_is_talking = true; + //whether or not current color is a talking one + bool color_is_talking = true; - //state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done - int text_state = 2; + //state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done + int text_state = 2; - //character id, which index of the char_list the player is - int m_cid = -1; - //cid and this may differ in cases of ini-editing - QString current_char = ""; + //character id, which index of the char_list the player is + int m_cid = -1; + //cid and this may differ in cases of ini-editing + QString current_char = ""; - int objection_state = 0; - int realization_state = 0; - int screenshake_state = 0; - int text_color = 0; + int objection_state = 0; + int realization_state = 0; + int screenshake_state = 0; + int text_color = 0; - //How many unique user colors are possible - static const int max_colors = 12; + //How many unique user colors are possible + static const int max_colors = 12; - //Text Color-related optimization: - //Current color list indexes to real color references - QVector color_row_to_number; + //Text Color-related optimization: + //Current color list indexes to real color references + QVector color_row_to_number; - //List of associated RGB colors for this color index - QVector color_rgb_list; + //List of associated RGB colors for this color index + QVector color_rgb_list; - //List of markdown start characters, their index is tied to the color index - QStringList color_markdown_start_list; + //List of markdown start characters, their index is tied to the color index + QStringList color_markdown_start_list; - //List of markdown end characters, their index is tied to the color index - QStringList color_markdown_end_list; + //List of markdown end characters, their index is tied to the color index + QStringList color_markdown_end_list; - //Whether or not we're supposed to remove this char during parsing - QVector color_markdown_remove_list; + //Whether or not we're supposed to remove this char during parsing + QVector color_markdown_remove_list; - //Whether or not this color allows us to play the talking animation - QVector color_markdown_talking_list; - //Text Color-related optimization END + //Whether or not this color allows us to play the talking animation + QVector color_markdown_talking_list; + //Text Color-related optimization END - //List of all currently available pos - QStringList pos_dropdown_list; + //List of all currently available pos + QStringList pos_dropdown_list; - bool is_presenting_evidence = false; + bool is_presenting_evidence = false; - QString effect = ""; + QString effect = ""; - //Music effect flags we want to send to server when we play music - int music_flags = 0; + //Music effect flags we want to send to server when we play music + int music_flags = 0; - int defense_bar_state = 0; - int prosecution_bar_state = 0; + int defense_bar_state = 0; + int prosecution_bar_state = 0; - int current_char_page = 0; - int char_columns = 10; - int char_rows = 9; - int max_chars_on_page = 90; + int current_char_page = 0; + int char_columns = 10; + int char_rows = 9; + int max_chars_on_page = 90; - const int button_width = 60; - const int button_height = 60; + const int button_width = 60; + const int button_height = 60; - int current_emote_page = 0; - int current_emote = 0; - int emote_columns = 5; - int emote_rows = 2; - int max_emotes_on_page = 10; + int current_emote_page = 0; + int current_emote = 0; + int emote_columns = 5; + int emote_rows = 2; + int max_emotes_on_page = 10; - QVector local_evidence_list; - QVector private_evidence_list; - QVector global_evidence_list; + QVector local_evidence_list; + QVector private_evidence_list; + QVector global_evidence_list; - //false = use private_evidence_list - bool current_evidence_global = true; + //false = use private_evidence_list + bool current_evidence_global = true; - int current_evidence_page = 0; - int current_evidence = 0; - int evidence_columns = 6; - int evidence_rows = 3; - int max_evidence_on_page = 18; + int current_evidence_page = 0; + int current_evidence = 0; + int evidence_columns = 6; + int evidence_rows = 3; + int max_evidence_on_page = 18; - //is set to true if the bg folder contains defensedesk.png, prosecutiondesk.png and stand.png - bool is_ao2_bg = false; + //is set to true if the bg folder contains defensedesk.png, prosecutiondesk.png and stand.png + bool is_ao2_bg = false; - //whether the ooc chat is server or master chat, true is server - bool server_ooc = true; + //whether the ooc chat is server or master chat, true is server + bool server_ooc = true; - QString current_background = "default"; - QString current_side = ""; + QString current_background = "default"; + QString current_side = ""; - AOMusicPlayer *music_player; - AOSfxPlayer *sfx_player; - AOSfxPlayer *objection_player; - AOBlipPlayer *blip_player; + AOMusicPlayer *music_player; + AOSfxPlayer *sfx_player; + AOSfxPlayer *objection_player; + AOBlipPlayer *blip_player; - AOSfxPlayer *modcall_player; + AOSfxPlayer *modcall_player; - AOImage *ui_background; + AOImage *ui_background; - QWidget *ui_viewport; - AOScene *ui_vp_background; - AOMovie *ui_vp_speedlines; - AOCharMovie *ui_vp_player_char; - AOCharMovie *ui_vp_sideplayer_char; - AOScene *ui_vp_desk; - AOScene *ui_vp_legacy_desk; - AOEvidenceDisplay *ui_vp_evidence_display; - AOImage *ui_vp_chatbox; - QLabel *ui_vp_showname; - AOMovie *ui_vp_chat_arrow; - QTextEdit *ui_vp_message; - AOMovie *ui_vp_effect; - AOMovie *ui_vp_testimony; - AOMovie *ui_vp_wtce; - AOMovie *ui_vp_objection; + QWidget *ui_viewport; + AOScene *ui_vp_background; + AOMovie *ui_vp_speedlines; + AOCharMovie *ui_vp_player_char; + AOCharMovie *ui_vp_sideplayer_char; + AOScene *ui_vp_desk; + AOScene *ui_vp_legacy_desk; + AOEvidenceDisplay *ui_vp_evidence_display; + AOImage *ui_vp_chatbox; + QLabel *ui_vp_showname; + AOMovie *ui_vp_chat_arrow; + QTextEdit *ui_vp_message; + AOMovie *ui_vp_effect; + AOMovie *ui_vp_testimony; + AOMovie *ui_vp_wtce; + AOMovie *ui_vp_objection; - QTextEdit *ui_ic_chatlog; + QTextEdit *ui_ic_chatlog; - AOTextArea *ui_ms_chatlog; - AOTextArea *ui_server_chatlog; + AOTextArea *ui_ms_chatlog; + AOTextArea *ui_server_chatlog; - QListWidget *ui_mute_list; - QTreeWidget *ui_area_list; - QTreeWidget *ui_music_list; + QListWidget *ui_mute_list; + QTreeWidget *ui_area_list; + QTreeWidget *ui_music_list; - ScrollText *ui_music_name; - AOMovie *ui_music_display; + ScrollText *ui_music_name; + AOMovie *ui_music_display; - AOButton *ui_pair_button; - QListWidget *ui_pair_list; - QSpinBox *ui_pair_offset_spinbox; + AOButton *ui_pair_button; + QListWidget *ui_pair_list; + QSpinBox *ui_pair_offset_spinbox; - QComboBox *ui_pair_order_dropdown; + QComboBox *ui_pair_order_dropdown; - AOLineEdit *ui_ic_chat_message; - QLineEdit *ui_ic_chat_name; + AOLineEdit *ui_ic_chat_message; + QLineEdit *ui_ic_chat_name; - QLineEdit *ui_ooc_chat_message; - QLineEdit *ui_ooc_chat_name; + QLineEdit *ui_ooc_chat_message; + QLineEdit *ui_ooc_chat_name; - //QLineEdit *ui_area_password; - QLineEdit *ui_music_search; + //QLineEdit *ui_area_password; + QLineEdit *ui_music_search; - QWidget *ui_emotes; - QVector ui_emote_list; - AOButton *ui_emote_left; - AOButton *ui_emote_right; + QWidget *ui_emotes; + QVector ui_emote_list; + AOButton *ui_emote_left; + AOButton *ui_emote_right; - QComboBox *ui_emote_dropdown; - QComboBox *ui_pos_dropdown; + QComboBox *ui_emote_dropdown; + QComboBox *ui_pos_dropdown; - QComboBox *ui_iniswap_dropdown; - AOButton *ui_iniswap_remove; + QComboBox *ui_iniswap_dropdown; + AOButton *ui_iniswap_remove; - QComboBox *ui_sfx_dropdown; - AOButton *ui_sfx_remove; + QComboBox *ui_sfx_dropdown; + AOButton *ui_sfx_remove; - QComboBox *ui_effects_dropdown; + QComboBox *ui_effects_dropdown; - AOImage *ui_defense_bar; - AOImage *ui_prosecution_bar; + AOImage *ui_defense_bar; + AOImage *ui_prosecution_bar; - QLabel *ui_music_label; - QLabel *ui_sfx_label; - QLabel *ui_blip_label; + QLabel *ui_music_label; + QLabel *ui_sfx_label; + QLabel *ui_blip_label; - AOButton *ui_hold_it; - AOButton *ui_objection; - AOButton *ui_take_that; + AOButton *ui_hold_it; + AOButton *ui_objection; + AOButton *ui_take_that; - AOButton *ui_ooc_toggle; + AOButton *ui_ooc_toggle; - AOButton *ui_witness_testimony; - AOButton *ui_cross_examination; - AOButton *ui_guilty; - AOButton *ui_not_guilty; + AOButton *ui_witness_testimony; + AOButton *ui_cross_examination; + AOButton *ui_guilty; + AOButton *ui_not_guilty; - AOButton *ui_change_character; - AOButton *ui_reload_theme; - AOButton *ui_call_mod; - AOButton *ui_settings; - AOButton *ui_announce_casing; - AOButton *ui_switch_area_music; + AOButton *ui_change_character; + AOButton *ui_reload_theme; + AOButton *ui_call_mod; + AOButton *ui_settings; + AOButton *ui_announce_casing; + AOButton *ui_switch_area_music; - QCheckBox *ui_pre; - QCheckBox *ui_flip; - QCheckBox *ui_additive; - QCheckBox *ui_guard; - QCheckBox *ui_casing; + QCheckBox *ui_pre; + QCheckBox *ui_flip; + QCheckBox *ui_additive; + QCheckBox *ui_guard; + QCheckBox *ui_casing; - QCheckBox *ui_pre_non_interrupt; - QCheckBox *ui_showname_enable; + QCheckBox *ui_pre_non_interrupt; + QCheckBox *ui_showname_enable; - AOButton *ui_custom_objection; - AOButton *ui_realization; - AOButton *ui_screenshake; - AOButton *ui_mute; - - AOButton *ui_defense_plus; - AOButton *ui_defense_minus; - - AOButton *ui_prosecution_plus; - AOButton *ui_prosecution_minus; + AOButton *ui_custom_objection; + AOButton *ui_realization; + AOButton *ui_screenshake; + AOButton *ui_mute; + + AOButton *ui_defense_plus; + AOButton *ui_defense_minus; + + AOButton *ui_prosecution_plus; + AOButton *ui_prosecution_minus; - QComboBox *ui_text_color; + QComboBox *ui_text_color; - QSlider *ui_music_slider; - QSlider *ui_sfx_slider; - QSlider *ui_blip_slider; + QSlider *ui_music_slider; + QSlider *ui_sfx_slider; + QSlider *ui_blip_slider; - AOImage *ui_muted; + AOImage *ui_muted; - AOButton *ui_evidence_button; - AOImage *ui_evidence; - AOLineEdit *ui_evidence_name; - QWidget *ui_evidence_buttons; - QVector ui_evidence_list; - AOButton *ui_evidence_left; - AOButton *ui_evidence_right; - AOButton *ui_evidence_present; - AOImage *ui_evidence_overlay; - AOButton *ui_evidence_delete; - AOLineEdit *ui_evidence_image_name; - AOButton *ui_evidence_image_button; - AOButton *ui_evidence_x; - AOButton *ui_evidence_ok; - AOButton *ui_evidence_switch; - AOButton *ui_evidence_transfer; - AOButton *ui_evidence_save; - AOButton *ui_evidence_load; - AOTextEdit *ui_evidence_description; + AOButton *ui_evidence_button; + AOImage *ui_evidence; + AOLineEdit *ui_evidence_name; + QWidget *ui_evidence_buttons; + QVector ui_evidence_list; + AOButton *ui_evidence_left; + AOButton *ui_evidence_right; + AOButton *ui_evidence_present; + AOImage *ui_evidence_overlay; + AOButton *ui_evidence_delete; + AOLineEdit *ui_evidence_image_name; + AOButton *ui_evidence_image_button; + AOButton *ui_evidence_x; + AOButton *ui_evidence_ok; + AOButton *ui_evidence_switch; + AOButton *ui_evidence_transfer; + AOButton *ui_evidence_save; + AOButton *ui_evidence_load; + AOTextEdit *ui_evidence_description; - AOImage *ui_char_select_background; + AOImage *ui_char_select_background; - //abstract widget to hold char buttons - QWidget *ui_char_buttons; + //abstract widget to hold char buttons + QWidget *ui_char_buttons; - QVector ui_char_button_list; - QVector ui_char_button_list_filtered; - AOImage *ui_selector; + QVector ui_char_button_list; + QVector ui_char_button_list_filtered; + AOImage *ui_selector; - AOButton *ui_back_to_lobby; + AOButton *ui_back_to_lobby; - QLineEdit *ui_char_password; + QLineEdit *ui_char_password; - AOButton *ui_char_select_left; - AOButton *ui_char_select_right; + AOButton *ui_char_select_left; + AOButton *ui_char_select_right; - AOButton *ui_spectator; + AOButton *ui_spectator; - QLineEdit *ui_char_search; - QCheckBox *ui_char_passworded; - QCheckBox *ui_char_taken; + QLineEdit *ui_char_search; + QCheckBox *ui_char_passworded; + QCheckBox *ui_char_taken; - void construct_char_select(); - void set_char_select(); - void set_char_select_page(); - void char_clicked(int n_char); - void put_button_in_place(int starting, int chars_on_this_page); - void filter_character_list(); - - void initialize_emotes(); - void refresh_emotes(); - void set_emote_page(); - void set_emote_dropdown(); - - void initialize_evidence(); - void refresh_evidence(); - void set_evidence_page(); + void construct_char_select(); + void set_char_select(); + void set_char_select_page(); + void char_clicked(int n_char); + void put_button_in_place(int starting, int chars_on_this_page); + void filter_character_list(); + + void initialize_emotes(); + void refresh_emotes(); + void set_emote_page(); + void set_emote_dropdown(); + + void initialize_evidence(); + void refresh_evidence(); + void set_evidence_page(); public slots: - void objection_done(); - void preanim_done(); - void do_screenshake(); - void do_flash(); - void do_effect(QString fx_path, QString fx_sound, QString p_char, QString p_folder); - void play_char_sfx(QString sfx_name); + void objection_done(); + void preanim_done(); + void do_screenshake(); + void do_flash(); + void do_effect(QString fx_path, QString fx_sound, QString p_char, QString p_folder); + void play_char_sfx(QString sfx_name); - void mod_called(QString p_ip); + void mod_called(QString p_ip); - void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); + void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); private slots: - void start_chat_ticking(); - void play_sfx(); + void start_chat_ticking(); + void play_sfx(); - void chat_tick(); + void chat_tick(); - void on_mute_list_clicked(QModelIndex p_index); - void on_pair_list_clicked(QModelIndex p_index); + void on_mute_list_clicked(QModelIndex p_index); + void on_pair_list_clicked(QModelIndex p_index); - void on_chat_return_pressed(); + void on_chat_return_pressed(); - void on_ooc_return_pressed(); + void on_ooc_return_pressed(); - void on_music_search_edited(QString p_text); - void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); - void on_music_list_context_menu_requested(const QPoint &pos); - void music_fade_out(bool toggle); - void music_fade_in(bool toggle); - void music_synchronize(bool toggle); - void music_list_expand_all(); - void music_list_collapse_all(); - void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); + void on_music_search_edited(QString p_text); + void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); + void on_music_list_context_menu_requested(const QPoint &pos); + void music_fade_out(bool toggle); + void music_fade_in(bool toggle); + void music_synchronize(bool toggle); + void music_list_expand_all(); + void music_list_collapse_all(); + void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); - void select_emote(int p_id); + void select_emote(int p_id); - void on_emote_clicked(int p_id); + void on_emote_clicked(int p_id); - void on_emote_left_clicked(); - void on_emote_right_clicked(); + void on_emote_left_clicked(); + void on_emote_right_clicked(); - void on_emote_dropdown_changed(int p_index); - void on_pos_dropdown_changed(int p_index); + void on_emote_dropdown_changed(int p_index); + void on_pos_dropdown_changed(int p_index); - void on_iniswap_dropdown_changed(int p_index); - void set_iniswap_dropdown(); - void on_iniswap_context_menu_requested(const QPoint &pos); - void on_iniswap_edit_requested(); - void on_iniswap_remove_clicked(); + void on_iniswap_dropdown_changed(int p_index); + void set_iniswap_dropdown(); + void on_iniswap_context_menu_requested(const QPoint &pos); + void on_iniswap_edit_requested(); + void on_iniswap_remove_clicked(); - void on_sfx_dropdown_changed(int p_index); - void set_sfx_dropdown(); - void on_sfx_context_menu_requested(const QPoint &pos); - void on_sfx_edit_requested(); - void on_sfx_remove_clicked(); + void on_sfx_dropdown_changed(int p_index); + void set_sfx_dropdown(); + void on_sfx_context_menu_requested(const QPoint &pos); + void on_sfx_edit_requested(); + void on_sfx_remove_clicked(); - void set_effects_dropdown(); - void on_effects_context_menu_requested(const QPoint &pos); - void on_effects_edit_requested(); - void on_character_effects_edit_requested(); - void on_effects_dropdown_changed(int p_index); - bool effects_dropdown_find_and_set(QString effect); + void set_effects_dropdown(); + void on_effects_context_menu_requested(const QPoint &pos); + void on_effects_edit_requested(); + void on_character_effects_edit_requested(); + void on_effects_dropdown_changed(int p_index); + bool effects_dropdown_find_and_set(QString effect); - QString get_char_sfx(); - int get_char_sfx_delay(); + QString get_char_sfx(); + int get_char_sfx_delay(); - void on_evidence_name_edited(); - void on_evidence_image_name_edited(); - void on_evidence_image_button_clicked(); - void on_evidence_clicked(int p_id); - void on_evidence_double_clicked(int p_id); + void on_evidence_name_edited(); + void on_evidence_image_name_edited(); + void on_evidence_image_button_clicked(); + void on_evidence_clicked(int p_id); + void on_evidence_double_clicked(int p_id); - void on_evidence_hover(int p_id, bool p_state); + void on_evidence_hover(int p_id, bool p_state); - void on_evidence_left_clicked(); - void on_evidence_right_clicked(); - void on_evidence_present_clicked(); + void on_evidence_left_clicked(); + void on_evidence_right_clicked(); + void on_evidence_present_clicked(); - void on_hold_it_clicked(); - void on_objection_clicked(); - void on_take_that_clicked(); - void on_custom_objection_clicked(); + void on_hold_it_clicked(); + void on_objection_clicked(); + void on_take_that_clicked(); + void on_custom_objection_clicked(); - void on_realization_clicked(); - void on_screenshake_clicked(); + void on_realization_clicked(); + void on_screenshake_clicked(); - void on_mute_clicked(); - void on_pair_clicked(); - void on_pair_order_dropdown_changed(int p_index); + void on_mute_clicked(); + void on_pair_clicked(); + void on_pair_order_dropdown_changed(int p_index); - void on_defense_minus_clicked(); - void on_defense_plus_clicked(); - void on_prosecution_minus_clicked(); - void on_prosecution_plus_clicked(); + void on_defense_minus_clicked(); + void on_defense_plus_clicked(); + void on_prosecution_minus_clicked(); + void on_prosecution_plus_clicked(); - void on_text_color_changed(int p_color); - void set_text_color_dropdown(); + void on_text_color_changed(int p_color); + void set_text_color_dropdown(); - void on_music_slider_moved(int p_value); - void on_sfx_slider_moved(int p_value); - void on_blip_slider_moved(int p_value); + void on_music_slider_moved(int p_value); + void on_sfx_slider_moved(int p_value); + void on_blip_slider_moved(int p_value); - void on_log_limit_changed(int value); - void on_pair_offset_changed(int value); + void on_log_limit_changed(int value); + void on_pair_offset_changed(int value); - void on_ooc_toggle_clicked(); + void on_ooc_toggle_clicked(); - void on_witness_testimony_clicked(); - void on_cross_examination_clicked(); - void on_not_guilty_clicked(); - void on_guilty_clicked(); + void on_witness_testimony_clicked(); + void on_cross_examination_clicked(); + void on_not_guilty_clicked(); + void on_guilty_clicked(); - void on_change_character_clicked(); - void on_reload_theme_clicked(); - void on_call_mod_clicked(); - void on_settings_clicked(); - void on_announce_casing_clicked(); + void on_change_character_clicked(); + void on_reload_theme_clicked(); + void on_call_mod_clicked(); + void on_settings_clicked(); + void on_announce_casing_clicked(); - void on_pre_clicked(); - void on_flip_clicked(); - void on_additive_clicked(); - void on_guard_clicked(); + void on_pre_clicked(); + void on_flip_clicked(); + void on_additive_clicked(); + void on_guard_clicked(); - void on_showname_enable_clicked(); + void on_showname_enable_clicked(); - void on_evidence_name_double_clicked(); - void on_evidence_image_name_double_clicked(); - void on_evidence_button_clicked(); + void on_evidence_name_double_clicked(); + void on_evidence_image_name_double_clicked(); + void on_evidence_button_clicked(); - void on_evidence_delete_clicked(); - void on_evidence_x_clicked(); - void on_evidence_ok_clicked(); - void on_evidence_switch_clicked(); - void on_evidence_transfer_clicked(); + void on_evidence_delete_clicked(); + void on_evidence_x_clicked(); + void on_evidence_ok_clicked(); + void on_evidence_switch_clicked(); + void on_evidence_transfer_clicked(); - void on_evidence_edited(); + void on_evidence_edited(); - void evidence_close(); - void evidence_switch(bool global); - void on_evidence_save_clicked(); - void on_evidence_load_clicked(); - bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); + void evidence_close(); + void evidence_switch(bool global); + void on_evidence_save_clicked(); + void on_evidence_load_clicked(); + bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); - void on_back_to_lobby_clicked(); + void on_back_to_lobby_clicked(); - void on_char_select_left_clicked(); - void on_char_select_right_clicked(); - void on_char_search_changed(); - void on_char_taken_clicked(); - void on_char_passworded_clicked(); + void on_char_select_left_clicked(); + void on_char_select_right_clicked(); + void on_char_search_changed(); + void on_char_taken_clicked(); + void on_char_passworded_clicked(); - void on_spectator_clicked(); + void on_spectator_clicked(); - void on_switch_area_music_clicked(); + void on_switch_area_music_clicked(); - void on_casing_clicked(); + void on_casing_clicked(); - void ping_server(); + void ping_server(); - void load_bass_opus_plugin(); + void load_bass_opus_plugin(); }; #endif // COURTROOM_H diff --git a/include/datatypes.h b/include/datatypes.h index 921f6135..715bb3e0 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -3,118 +3,108 @@ #include -struct server_type -{ - QString name; - QString desc; - QString ip; - int port; +struct server_type { + QString name; + QString desc; + QString ip; + int port; }; -struct emote_type -{ - QString comment; - QString preanim; - QString anim; - int mod; - QString sfx_name; - int sfx_delay; - int sfx_duration; +struct emote_type { + QString comment; + QString preanim; + QString anim; + int mod; + QString sfx_name; + int sfx_delay; + int sfx_duration; }; -struct char_type -{ - QString name; - QString description; - QString evidence_string; - bool taken; +struct char_type { + QString name; + QString description; + QString evidence_string; + bool taken; }; -struct evi_type -{ - QString name; - QString description; - QString image; +struct evi_type { + QString name; + QString description; + QString image; }; -struct chatmessage_type -{ - QString message; - QString character; - QString side; - QString sfx_name; - QString pre_emote; - QString emote; - int emote_modifier; - int objection_modifier; - int realization; - int text_color; - int evidence; - int cid; - int sfx_delay; - int flip; +struct chatmessage_type { + QString message; + QString character; + QString side; + QString sfx_name; + QString pre_emote; + QString emote; + int emote_modifier; + int objection_modifier; + int realization; + int text_color; + int evidence; + int cid; + int sfx_delay; + int flip; }; -struct area_type -{ - QString name; - QString background; - bool passworded; +struct area_type { + QString name; + QString background; + bool passworded; }; -struct pos_type -{ - int x; - int y; +struct pos_type { + int x; + int y; }; -struct pos_size_type -{ - int x = 0; - int y = 0; - int width = 0; - int height = 0; +struct pos_size_type { + int x = 0; + int y = 0; + int width = 0; + int height = 0; }; -enum CHAT_MESSAGE -{ - DESK_MOD = 0, - PRE_EMOTE, - CHAR_NAME, - EMOTE, - MESSAGE, - SIDE, - SFX_NAME, - EMOTE_MOD, - CHAR_ID, - SFX_DELAY, - OBJECTION_MOD, - EVIDENCE_ID, - FLIP, - REALIZATION, - TEXT_COLOR, - SHOWNAME, - OTHER_CHARID, - OTHER_NAME, - OTHER_EMOTE, - SELF_OFFSET, - OTHER_OFFSET, - OTHER_FLIP, - NONINTERRUPTING_PRE, - LOOPING_SFX, - SCREENSHAKE, - FRAME_SCREENSHAKE, - FRAME_REALIZATION, - FRAME_SFX, - ADDITIVE, - EFFECTS +enum CHAT_MESSAGE { + DESK_MOD = 0, + PRE_EMOTE, + CHAR_NAME, + EMOTE, + MESSAGE, + SIDE, + SFX_NAME, + EMOTE_MOD, + CHAR_ID, + SFX_DELAY, + OBJECTION_MOD, + EVIDENCE_ID, + FLIP, + REALIZATION, + TEXT_COLOR, + SHOWNAME, + OTHER_CHARID, + OTHER_NAME, + OTHER_EMOTE, + SELF_OFFSET, + OTHER_OFFSET, + OTHER_FLIP, + NONINTERRUPTING_PRE, + LOOPING_SFX, + SCREENSHAKE, + FRAME_SCREENSHAKE, + FRAME_REALIZATION, + FRAME_SFX, + ADDITIVE, + EFFECTS }; -enum MUSIC_EFFECT -{ - FADE_IN = 1, - FADE_OUT = 2, - SYNC_POS = 4 +enum MUSIC_EFFECT { + FADE_IN = 1, + FADE_OUT = 2, + SYNC_POS = 4 }; #endif // DATATYPES_H diff --git a/include/debug_functions.h b/include/debug_functions.h index 160274cc..383431ab 100644 --- a/include/debug_functions.h +++ b/include/debug_functions.h @@ -1,8 +1,8 @@ #ifndef DEBUG_FUNCTIONS_H #define DEBUG_FUNCTIONS_H -#include #include +#include void call_error(QString message); void call_notice(QString message); diff --git a/include/discord-rpc.h b/include/discord-rpc.h index feb874b2..24885430 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -24,47 +24,47 @@ extern "C" { #endif typedef struct DiscordRichPresence { - const char* state; /* max 128 bytes */ - const char* details; /* max 128 bytes */ + const char *state; /* max 128 bytes */ + const char *details; /* max 128 bytes */ int64_t startTimestamp; int64_t endTimestamp; - const char* largeImageKey; /* max 32 bytes */ - const char* largeImageText; /* max 128 bytes */ - const char* smallImageKey; /* max 32 bytes */ - const char* smallImageText; /* max 128 bytes */ - const char* partyId; /* max 128 bytes */ + const char *largeImageKey; /* max 32 bytes */ + const char *largeImageText; /* max 128 bytes */ + const char *smallImageKey; /* max 32 bytes */ + const char *smallImageText; /* max 128 bytes */ + const char *partyId; /* max 128 bytes */ int partySize; int partyMax; - const char* matchSecret; /* max 128 bytes */ - const char* joinSecret; /* max 128 bytes */ - const char* spectateSecret; /* max 128 bytes */ + const char *matchSecret; /* max 128 bytes */ + const char *joinSecret; /* max 128 bytes */ + const char *spectateSecret; /* max 128 bytes */ int8_t instance; } DiscordRichPresence; typedef struct DiscordJoinRequest { - const char* userId; - const char* username; - const char* discriminator; - const char* avatar; + const char *userId; + const char *username; + const char *discriminator; + const char *avatar; } DiscordJoinRequest; typedef struct DiscordEventHandlers { void (*ready)(void); - void (*disconnected)(int errorCode, const char* message); - void (*errored)(int errorCode, const char* message); - void (*joinGame)(const char* joinSecret); - void (*spectateGame)(const char* spectateSecret); - void (*joinRequest)(const DiscordJoinRequest* request); + void (*disconnected)(int errorCode, const char *message); + void (*errored)(int errorCode, const char *message); + void (*joinGame)(const char *joinSecret); + void (*spectateGame)(const char *spectateSecret); + void (*joinRequest)(const DiscordJoinRequest *request); } DiscordEventHandlers; #define DISCORD_REPLY_NO 0 #define DISCORD_REPLY_YES 1 #define DISCORD_REPLY_IGNORE 2 -DISCORD_EXPORT void Discord_Initialize(const char* applicationId, - DiscordEventHandlers* handlers, +DISCORD_EXPORT void Discord_Initialize(const char *applicationId, + DiscordEventHandlers *handlers, int autoRegister, - const char* optionalSteamId); + const char *optionalSteamId); DISCORD_EXPORT void Discord_Shutdown(void); /* checks for incoming messages, dispatches callbacks */ @@ -75,10 +75,10 @@ DISCORD_EXPORT void Discord_RunCallbacks(void); DISCORD_EXPORT void Discord_UpdateConnection(void); #endif -DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); +DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence *presence); DISCORD_EXPORT void Discord_ClearPresence(void); -DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply); +DISCORD_EXPORT void Discord_Respond(const char *userid, /* DISCORD_REPLY_ */ int reply); #ifdef __cplusplus } /* extern "C" */ diff --git a/include/discord_register.h b/include/discord_register.h index 4c16b68a..71e856a5 100644 --- a/include/discord_register.h +++ b/include/discord_register.h @@ -1,25 +1,25 @@ #pragma once #if defined(DISCORD_DYNAMIC_LIB) -# if defined(_WIN32) -# if defined(DISCORD_BUILDING_SDK) -# define DISCORD_EXPORT __declspec(dllexport) -# else -# define DISCORD_EXPORT __declspec(dllimport) -# endif -# else -# define DISCORD_EXPORT __attribute__((visibility("default"))) -# endif +#if defined(_WIN32) +#if defined(DISCORD_BUILDING_SDK) +#define DISCORD_EXPORT __declspec(dllexport) #else -# define DISCORD_EXPORT +#define DISCORD_EXPORT __declspec(dllimport) +#endif +#else +#define DISCORD_EXPORT __attribute__((visibility("default"))) +#endif +#else +#define DISCORD_EXPORT #endif #ifdef __cplusplus extern "C" { #endif -DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command); -DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, const char* steamId); +DISCORD_EXPORT void Discord_Register(const char *applicationId, const char *command); +DISCORD_EXPORT void Discord_RegisterSteamGame(const char *applicationId, const char *steamId); #ifdef __cplusplus } diff --git a/include/discord_rich_presence.h b/include/discord_rich_presence.h index 4115b516..1949d248 100644 --- a/include/discord_rich_presence.h +++ b/include/discord_rich_presence.h @@ -1,11 +1,11 @@ #ifndef DISCORD_RICH_PRESENCE_H #define DISCORD_RICH_PRESENCE_H +#include +#include #include #include -#include #include -#include #include @@ -16,23 +16,23 @@ namespace AttorneyOnline { -class Discord -{ - Q_DECLARE_TR_FUNCTIONS(Discord) - -private: - const char* APPLICATION_ID = "399779271737868288"; - std::string server_name, server_id; - int64_t timestamp; -public: - Discord(); - ~Discord(); - - void state_lobby(); - void state_server(std::string name, std::string server_id); - void state_character(std::string name); - void state_spectate(); -}; - -} + class Discord { + Q_DECLARE_TR_FUNCTIONS(Discord) + + private: + const char *APPLICATION_ID = "399779271737868288"; + std::string server_name, server_id; + int64_t timestamp; + + public: + Discord(); + ~Discord(); + + void state_lobby(); + void state_server(std::string name, std::string server_id); + void state_character(std::string name); + void state_spectate(); + }; + +} // namespace AttorneyOnline #endif // DISCORD_RICH_PRESENCE_H diff --git a/include/discord_rpc.h b/include/discord_rpc.h index 3e1441e0..737f2f66 100644 --- a/include/discord_rpc.h +++ b/include/discord_rpc.h @@ -24,47 +24,47 @@ extern "C" { #endif typedef struct DiscordRichPresence { - const char* state; /* max 128 bytes */ - const char* details; /* max 128 bytes */ + const char *state; /* max 128 bytes */ + const char *details; /* max 128 bytes */ int64_t startTimestamp; int64_t endTimestamp; - const char* largeImageKey; /* max 32 bytes */ - const char* largeImageText; /* max 128 bytes */ - const char* smallImageKey; /* max 32 bytes */ - const char* smallImageText; /* max 128 bytes */ - const char* partyId; /* max 128 bytes */ + const char *largeImageKey; /* max 32 bytes */ + const char *largeImageText; /* max 128 bytes */ + const char *smallImageKey; /* max 32 bytes */ + const char *smallImageText; /* max 128 bytes */ + const char *partyId; /* max 128 bytes */ int partySize; int partyMax; - const char* matchSecret; /* max 128 bytes */ - const char* joinSecret; /* max 128 bytes */ - const char* spectateSecret; /* max 128 bytes */ + const char *matchSecret; /* max 128 bytes */ + const char *joinSecret; /* max 128 bytes */ + const char *spectateSecret; /* max 128 bytes */ int8_t instance; } DiscordRichPresence; typedef struct DiscordUser { - const char* userId; - const char* username; - const char* discriminator; - const char* avatar; + const char *userId; + const char *username; + const char *discriminator; + const char *avatar; } DiscordUser; typedef struct DiscordEventHandlers { - void (*ready)(const DiscordUser* request); - void (*disconnected)(int errorCode, const char* message); - void (*errored)(int errorCode, const char* message); - void (*joinGame)(const char* joinSecret); - void (*spectateGame)(const char* spectateSecret); - void (*joinRequest)(const DiscordUser* request); + void (*ready)(const DiscordUser *request); + void (*disconnected)(int errorCode, const char *message); + void (*errored)(int errorCode, const char *message); + void (*joinGame)(const char *joinSecret); + void (*spectateGame)(const char *spectateSecret); + void (*joinRequest)(const DiscordUser *request); } DiscordEventHandlers; #define DISCORD_REPLY_NO 0 #define DISCORD_REPLY_YES 1 #define DISCORD_REPLY_IGNORE 2 -DISCORD_EXPORT void Discord_Initialize(const char* applicationId, - DiscordEventHandlers* handlers, +DISCORD_EXPORT void Discord_Initialize(const char *applicationId, + DiscordEventHandlers *handlers, int autoRegister, - const char* optionalSteamId); + const char *optionalSteamId); DISCORD_EXPORT void Discord_Shutdown(void); /* checks for incoming messages, dispatches callbacks */ @@ -75,12 +75,12 @@ DISCORD_EXPORT void Discord_RunCallbacks(void); DISCORD_EXPORT void Discord_UpdateConnection(void); #endif -DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); +DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence *presence); DISCORD_EXPORT void Discord_ClearPresence(void); -DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply); +DISCORD_EXPORT void Discord_Respond(const char *userid, /* DISCORD_REPLY_ */ int reply); -DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers); +DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers *handlers); #ifdef __cplusplus } /* extern "C" */ diff --git a/include/encryption_functions.h b/include/encryption_functions.h index dc67d122..b70e8e65 100644 --- a/include/encryption_functions.h +++ b/include/encryption_functions.h @@ -3,11 +3,11 @@ #include +#include #include -#include -#include #include -#include +#include +#include QString fanta_encrypt(QString p_input, unsigned int key); QString fanta_decrypt(QString p_input, unsigned int key); diff --git a/include/file_functions.h b/include/file_functions.h index 6937ed8a..8bb2e5f6 100644 --- a/include/file_functions.h +++ b/include/file_functions.h @@ -1,8 +1,8 @@ #ifndef FILE_FUNCTIONS_H #define FILE_FUNCTIONS_H -#include #include +#include #include bool file_exists(QString file_path); diff --git a/include/hex_functions.h b/include/hex_functions.h index 285f096a..429bdb14 100644 --- a/include/hex_functions.h +++ b/include/hex_functions.h @@ -1,17 +1,16 @@ #ifndef HEX_OPERATIONS_H #define HEX_OPERATIONS_H +#include #include #include -#include -#include -#include #include +#include #include +#include -namespace omni -{ - std::string int_to_hex(unsigned int input); +namespace omni { + std::string int_to_hex(unsigned int input); } #endif //HEX_OPERATIONS_H diff --git a/include/lobby.h b/include/lobby.h index a969f865..7b978d32 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -1,108 +1,107 @@ #ifndef LOBBY_H #define LOBBY_H -#include "aoimage.h" #include "aobutton.h" +#include "aoimage.h" #include "aopacket.h" #include "aotextarea.h" -#include -#include -#include #include -#include #include +#include +#include +#include #include #include +#include #include #include class AOApplication; -class Lobby : public QMainWindow -{ - Q_OBJECT +class Lobby : public QMainWindow { + Q_OBJECT public: - Lobby(AOApplication *p_ao_app); - - void set_widgets(); - void list_servers(); - void list_favorites(); - void append_chatmessage(QString f_name, QString f_message); - void append_error(QString f_message); - void set_player_count(int players_online, int max_players); - void set_stylesheet(QWidget *widget, QString target_tag); - void set_stylesheets(); - void set_fonts(); - void set_font(QWidget *widget, QString p_identifier); - void set_loading_text(QString p_text); - void show_loading_overlay(){ui_loading_background->show();} - void hide_loading_overlay(){ui_loading_background->hide();} - QString get_chatlog(); - int get_selected_server(); - void enable_connect_button(); - - void set_loading_value(int p_value); - - bool public_servers_selected = true; - - ~Lobby(); + Lobby(AOApplication *p_ao_app); + + void set_widgets(); + void list_servers(); + void list_favorites(); + void append_chatmessage(QString f_name, QString f_message); + void append_error(QString f_message); + void set_player_count(int players_online, int max_players); + void set_stylesheet(QWidget *widget, QString target_tag); + void set_stylesheets(); + void set_fonts(); + void set_font(QWidget *widget, QString p_identifier); + void set_loading_text(QString p_text); + void show_loading_overlay() { ui_loading_background->show(); } + void hide_loading_overlay() { ui_loading_background->hide(); } + QString get_chatlog(); + int get_selected_server(); + void enable_connect_button(); + + void set_loading_value(int p_value); + + bool public_servers_selected = true; + + ~Lobby(); private: - AOApplication *ao_app; + AOApplication *ao_app; - AOImage *ui_background; + AOImage *ui_background; - AOButton *ui_public_servers; - AOButton *ui_favorites; + AOButton *ui_public_servers; + AOButton *ui_favorites; - AOButton *ui_refresh; - AOButton *ui_add_to_fav; - AOButton *ui_connect; + AOButton *ui_refresh; + AOButton *ui_add_to_fav; + AOButton *ui_connect; - QLabel *ui_version; - AOButton *ui_about; + QLabel *ui_version; + AOButton *ui_about; - AOButton *ui_settings; + AOButton *ui_settings; - QTreeWidget *ui_server_list; - QLineEdit *ui_server_search; + QTreeWidget *ui_server_list; + QLineEdit *ui_server_search; - QLabel *ui_player_count; - AOTextArea *ui_description; + QLabel *ui_player_count; + AOTextArea *ui_description; - AOTextArea *ui_chatbox; + AOTextArea *ui_chatbox; - QLineEdit *ui_chatname; - QLineEdit *ui_chatmessage; + QLineEdit *ui_chatname; + QLineEdit *ui_chatmessage; - AOImage *ui_loading_background; - QTextEdit *ui_loading_text; - QProgressBar *ui_progress_bar; - AOButton *ui_cancel; + AOImage *ui_loading_background; + QTextEdit *ui_loading_text; + QProgressBar *ui_progress_bar; + AOButton *ui_cancel; - int last_index; + int last_index; - void set_size_and_pos(QWidget *p_widget, QString p_identifier); + void set_size_and_pos(QWidget *p_widget, QString p_identifier); private slots: - void on_public_servers_clicked(); - void on_favorites_clicked(); - - void on_refresh_pressed(); - void on_refresh_released(); - void on_add_to_fav_pressed(); - void on_add_to_fav_released(); - void on_connect_pressed(); - void on_connect_released(); - void on_about_clicked(); - void on_settings_clicked(); - void on_server_list_clicked(QTreeWidgetItem* p_item, int column); - void on_server_list_doubleclicked(QTreeWidgetItem* p_item, int column); - void on_server_search_edited(QString p_text); - void on_chatfield_return_pressed(); + void on_public_servers_clicked(); + void on_favorites_clicked(); + + void on_refresh_pressed(); + void on_refresh_released(); + void on_add_to_fav_pressed(); + void on_add_to_fav_released(); + void on_connect_pressed(); + void on_connect_released(); + void on_about_clicked(); + void on_settings_clicked(); + void on_server_list_clicked(QTreeWidgetItem *p_item, int column); + void on_server_list_doubleclicked(QTreeWidgetItem *p_item, int column); + void on_server_search_edited(QString p_text); + void on_chatfield_return_pressed(); }; #endif // LOBBY_H diff --git a/include/misc_functions.h b/include/misc_functions.h index 026c6353..5287bee8 100644 --- a/include/misc_functions.h +++ b/include/misc_functions.h @@ -1,8 +1,8 @@ #ifndef MISC_FUNCTIONS_H #define MISC_FUNCTIONS_H -#include #include +#include void delay(int p_milliseconds); diff --git a/include/networkmanager.h b/include/networkmanager.h index 08b10db8..4d9d401d 100644 --- a/include/networkmanager.h +++ b/include/networkmanager.h @@ -14,71 +14,70 @@ #undef MS_FAILOVER_SUPPORTED #endif -#include "aopacket.h" #include "aoapplication.h" +#include "aopacket.h" -#include #include +#include #include #include #include -class NetworkManager : public QObject -{ - Q_OBJECT +class NetworkManager : public QObject { + Q_OBJECT public: - NetworkManager(AOApplication *parent); - ~NetworkManager(); + NetworkManager(AOApplication *parent); + ~NetworkManager(); - AOApplication *ao_app; - QTcpSocket *ms_socket; - QTcpSocket *server_socket; - QDnsLookup *ms_dns; - QTimer *ms_reconnect_timer; + AOApplication *ao_app; + QTcpSocket *ms_socket; + QTcpSocket *server_socket; + QDnsLookup *ms_dns; + QTimer *ms_reconnect_timer; - const QString ms_srv_hostname = "_aoms._tcp.aceattorneyonline.com"; + const QString ms_srv_hostname = "_aoms._tcp.aceattorneyonline.com"; #ifdef LOCAL_MS - QString ms_nosrv_hostname = "localhost"; + QString ms_nosrv_hostname = "localhost"; #else - QString ms_nosrv_hostname = "master.aceattorneyonline.com"; + QString ms_nosrv_hostname = "master.aceattorneyonline.com"; #endif - const quint16 ms_port = 27016; - const int timeout_milliseconds = 2000; + const quint16 ms_port = 27016; + const int timeout_milliseconds = 2000; - // in seconds - const int ms_reconnect_delay = 7; + // in seconds + const int ms_reconnect_delay = 7; - bool ms_partial_packet = false; - QString ms_temp_packet = ""; + bool ms_partial_packet = false; + QString ms_temp_packet = ""; - bool partial_packet = false; - QString temp_packet = ""; + bool partial_packet = false; + QString temp_packet = ""; - unsigned int s_decryptor = 5; + unsigned int s_decryptor = 5; - void connect_to_master(); - void connect_to_master_nosrv(); - void connect_to_server(server_type p_server); + void connect_to_master(); + void connect_to_master_nosrv(); + void connect_to_server(server_type p_server); public slots: - void ship_ms_packet(QString p_packet); - void ship_server_packet(QString p_packet); + void ship_ms_packet(QString p_packet); + void ship_server_packet(QString p_packet); signals: - void ms_connect_finished(bool success, bool will_retry); + void ms_connect_finished(bool success, bool will_retry); private: - void perform_srv_lookup(); + void perform_srv_lookup(); private slots: - void on_srv_lookup(); - void handle_ms_packet(); - void handle_server_packet(); - void on_ms_nosrv_connect_success(); - void on_ms_socket_error(QAbstractSocket::SocketError error); - void retry_ms_connect(); + void on_srv_lookup(); + void handle_ms_packet(); + void handle_server_packet(); + void on_ms_nosrv_connect_success(); + void on_ms_socket_error(QAbstractSocket::SocketError error); + void retry_ms_connect(); }; #endif // NETWORKMANAGER_H diff --git a/include/scrolltext.h b/include/scrolltext.h index cf791c03..1455762f 100644 --- a/include/scrolltext.h +++ b/include/scrolltext.h @@ -1,15 +1,13 @@ #ifndef SCROLLTEXT_H #define SCROLLTEXT_H -#include +#include +#include #include #include -#include -#include - +#include -class ScrollText : public QWidget -{ +class ScrollText : public QWidget { Q_OBJECT Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString separator READ separator WRITE setSeparator) @@ -24,7 +22,6 @@ public slots: QString separator() const; void setSeparator(QString separator); - protected: virtual void paintEvent(QPaintEvent *); virtual void resizeEvent(QResizeEvent *); diff --git a/include/text_file_functions.h b/include/text_file_functions.h index 119f38e2..1da4d925 100644 --- a/include/text_file_functions.h +++ b/include/text_file_functions.h @@ -3,11 +3,11 @@ #include "aoapplication.h" #include "file_functions.h" -#include -#include -#include -#include #include +#include #include +#include +#include +#include #endif // TEXT_FILE_FUNCTIONS_H -- cgit From 88de4cde0433ef5e606f38a2f1e6041f0d24a87e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 02:14:54 +0300 Subject: clang 2 electric boogaloo { BasedOnStyle: LLVM, BreakBeforeBraces: Stroustrup} --- include/aoapplication.h | 561 ++++++++++---------- include/aoblipplayer.h | 26 +- include/aobutton.h | 10 +- include/aocaseannouncerdialog.h | 34 +- include/aocharbutton.h | 33 +- include/aocharmovie.h | 143 +++--- include/aoemotebutton.h | 23 +- include/aoevidencebutton.h | 45 +- include/aoevidencedisplay.h | 22 +- include/aoimage.h | 16 +- include/aolineedit.h | 14 +- include/aomovie.h | 27 +- include/aomusicplayer.h | 69 +-- include/aooptionsdialog.h | 207 ++++---- include/aopacket.h | 26 +- include/aoscene.h | 41 +- include/aosfxplayer.h | 33 +- include/aotextarea.h | 13 +- include/aotextedit.h | 10 +- include/bass.h | 866 +++++++++++++++++-------------- include/bassopus.h | 32 +- include/chatlogpiece.h | 32 +- include/courtroom.h | 1082 ++++++++++++++++++++------------------- include/datatypes.h | 148 +++--- include/discord-rpc.h | 56 +- include/discord_register.h | 6 +- include/discord_rich_presence.h | 34 +- include/discord_rpc.h | 56 +- include/hex_functions.h | 4 +- include/lobby.h | 126 ++--- include/networkmanager.h | 70 +-- include/scrolltext.h | 46 +- 32 files changed, 2030 insertions(+), 1881 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index ff75e4d1..d9e84fa8 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -32,402 +32,415 @@ class Lobby; class Courtroom; class AOApplication : public QApplication { - Q_OBJECT + Q_OBJECT public: - AOApplication(int &argc, char **argv); - ~AOApplication(); + AOApplication(int &argc, char **argv); + ~AOApplication(); - NetworkManager *net_manager; - Lobby *w_lobby; - Courtroom *w_courtroom; - AttorneyOnline::Discord *discord; + NetworkManager *net_manager; + Lobby *w_lobby; + Courtroom *w_courtroom; + AttorneyOnline::Discord *discord; + + bool lobby_constructed = false; + bool courtroom_constructed = false; - bool lobby_constructed = false; - bool courtroom_constructed = false; + void construct_lobby(); + void destruct_lobby(); - void construct_lobby(); - void destruct_lobby(); + void construct_courtroom(); + void destruct_courtroom(); - void construct_courtroom(); - void destruct_courtroom(); + void ms_packet_received(AOPacket *p_packet); + void server_packet_received(AOPacket *p_packet); - void ms_packet_received(AOPacket *p_packet); - void server_packet_received(AOPacket *p_packet); + void send_ms_packet(AOPacket *p_packet); + void send_server_packet(AOPacket *p_packet, bool encoded = true); - void send_ms_packet(AOPacket *p_packet); - void send_server_packet(AOPacket *p_packet, bool encoded = true); + void call_settings_menu(); + void call_announce_menu(Courtroom *court); - void call_settings_menu(); - void call_announce_menu(Courtroom *court); + /////////////////server metadata////////////////// - /////////////////server metadata////////////////// + unsigned int s_decryptor = 5; + bool encryption_needed = true; - unsigned int s_decryptor = 5; - bool encryption_needed = true; + bool yellow_text_enabled = false; + bool prezoom_enabled = false; + bool flipping_enabled = false; + bool custom_objection_enabled = false; + bool improved_loading_enabled = false; + bool desk_mod_enabled = false; + bool evidence_enabled = false; + bool cccc_ic_support_enabled = false; + bool arup_enabled = false; + bool casing_alerts_enabled = false; + bool modcall_reason_enabled = false; + bool looping_sfx_support_enabled = false; + bool additive_enabled = false; + bool effects_enabled = false; - bool yellow_text_enabled = false; - bool prezoom_enabled = false; - bool flipping_enabled = false; - bool custom_objection_enabled = false; - bool improved_loading_enabled = false; - bool desk_mod_enabled = false; - bool evidence_enabled = false; - bool cccc_ic_support_enabled = false; - bool arup_enabled = false; - bool casing_alerts_enabled = false; - bool modcall_reason_enabled = false; - bool looping_sfx_support_enabled = false; - bool additive_enabled = false; - bool effects_enabled = false; + ///////////////loading info/////////////////// - ///////////////loading info/////////////////// + // player number, it's hardly used but might be needed for some old servers + int s_pv = 0; - //player number, it's hardly used but might be needed for some old servers - int s_pv = 0; + QString server_software = ""; - QString server_software = ""; + int char_list_size = 0; + int loaded_chars = 0; + int generated_chars = 0; + int evidence_list_size = 0; + int loaded_evidence = 0; + int music_list_size = 0; + int loaded_music = 0; - int char_list_size = 0; - int loaded_chars = 0; - int generated_chars = 0; - int evidence_list_size = 0; - int loaded_evidence = 0; - int music_list_size = 0; - int loaded_music = 0; + bool courtroom_loaded = false; - bool courtroom_loaded = false; + //////////////////versioning/////////////// - //////////////////versioning/////////////// + int get_release() const { return RELEASE; } + int get_major_version() const { return MAJOR_VERSION; } + int get_minor_version() const { return MINOR_VERSION; } + QString get_version_string(); - int get_release() const { return RELEASE; } - int get_major_version() const { return MAJOR_VERSION; } - int get_minor_version() const { return MINOR_VERSION; } - QString get_version_string(); + /////////////////////////////////////////// - /////////////////////////////////////////// + void set_favorite_list(); + QVector &get_favorite_list() { return favorite_list; } + void add_favorite_server(int p_server); - void set_favorite_list(); - QVector &get_favorite_list() { return favorite_list; } - void add_favorite_server(int p_server); + void set_server_list(); + QVector &get_server_list() { return server_list; } - void set_server_list(); - QVector &get_server_list() { return server_list; } + // reads the theme from config.ini and sets it accordingly + void reload_theme(); - //reads the theme from config.ini and sets it accordingly - void reload_theme(); + // Returns the character the player has currently selected + QString get_current_char(); - //Returns the character the player has currently selected - QString get_current_char(); + // implementation in path_functions.cpp + QString get_base_path(); + QString get_data_path(); + QString get_theme_path(QString p_file); + QString get_default_theme_path(QString p_file); + QString get_custom_theme_path(QString p_theme, QString p_file); + QString get_character_path(QString p_char, QString p_file); + QString get_sounds_path(QString p_file); + QString get_music_path(QString p_song); + QString get_background_path(QString p_file); + QString get_default_background_path(QString p_file); + QString get_evidence_path(QString p_file); + QString get_case_sensitive_path(QString p_file); - //implementation in path_functions.cpp - QString get_base_path(); - QString get_data_path(); - QString get_theme_path(QString p_file); - QString get_default_theme_path(QString p_file); - QString get_custom_theme_path(QString p_theme, QString p_file); - QString get_character_path(QString p_char, QString p_file); - QString get_sounds_path(QString p_file); - QString get_music_path(QString p_song); - QString get_background_path(QString p_file); - QString get_default_background_path(QString p_file); - QString get_evidence_path(QString p_file); - QString get_case_sensitive_path(QString p_file); + ////// Functions for reading and writing files ////// + // Implementations file_functions.cpp - ////// Functions for reading and writing files ////// - // Implementations file_functions.cpp + // Instead of reinventing the wheel, we'll use a QSettings class. + QSettings *configini; - // Instead of reinventing the wheel, we'll use a QSettings class. - QSettings *configini; + // Reads the theme from config.ini and loads it into the current_theme + // variable + QString read_theme(); - //Reads the theme from config.ini and loads it into the current_theme variable - QString read_theme(); + // Returns the value of ooc_name in config.ini + QString get_ooc_name(); - //Returns the value of ooc_name in config.ini - QString get_ooc_name(); + // Returns the blip rate from config.ini (once per X symbols) + int read_blip_rate(); - //Returns the blip rate from config.ini (once per X symbols) - int read_blip_rate(); + // Returns true if blank blips is enabled in config.ini and false otherwise + bool get_blank_blip(); - //Returns true if blank blips is enabled in config.ini and false otherwise - bool get_blank_blip(); + // Returns true if looping sound effects are enabled in the config.ini + bool get_looping_sfx(); - //Returns true if looping sound effects are enabled in the config.ini - bool get_looping_sfx(); + // Returns true if stop music on objection is enabled in the config.ini + bool objection_stop_music(); - //Returns true if stop music on objection is enabled in the config.ini - bool objection_stop_music(); + // Returns the value of default_music in config.ini + int get_default_music(); - //Returns the value of default_music in config.ini - int get_default_music(); + // Returns the value of default_sfx in config.ini + int get_default_sfx(); - //Returns the value of default_sfx in config.ini - int get_default_sfx(); + // Returns the value of default_blip in config.ini + int get_default_blip(); - //Returns the value of default_blip in config.ini - int get_default_blip(); + // Returns the value of whether Discord should be enabled on startup + // from the config.ini. + bool is_discord_enabled(); - // Returns the value of whether Discord should be enabled on startup - // from the config.ini. - bool is_discord_enabled(); + // Returns the value of whether shaking should be enabled. + // from the config.ini. + bool is_shake_enabled(); - // Returns the value of whether shaking should be enabled. - // from the config.ini. - bool is_shake_enabled(); + // Returns the value of whether effects should be enabled. + // from the config.ini. + bool is_effects_enabled(); - // Returns the value of whether effects should be enabled. - // from the config.ini. - bool is_effects_enabled(); + // Returns the value of whether frame-specific effects defined in char.ini + // should be sent/received over the network. from the config.ini. + bool is_frame_network_enabled(); - // Returns the value of whether frame-specific effects defined in char.ini should be sent/received over the network. - // from the config.ini. - bool is_frame_network_enabled(); + // Returns the value of whether colored ic log should be a thing. + // from the config.ini. + bool is_colorlog_enabled(); - // Returns the value of whether colored ic log should be a thing. - // from the config.ini. - bool is_colorlog_enabled(); + // Returns the value of whether sticky sounds should be a thing. + // from the config.ini. + bool is_stickysounds_enabled(); - // Returns the value of whether sticky sounds should be a thing. - // from the config.ini. - bool is_stickysounds_enabled(); + // Returns the value of whether sticky effects should be a thing. + // from the config.ini. + bool is_stickyeffects_enabled(); - // Returns the value of whether sticky effects should be a thing. - // from the config.ini. - bool is_stickyeffects_enabled(); + // Returns the value of whether sticky preanims should be a thing. + // from the config.ini. + bool is_stickypres_enabled(); - // Returns the value of whether sticky preanims should be a thing. - // from the config.ini. - bool is_stickypres_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog + // may contain, from config.ini. + int get_max_log_size(); - // Returns the value of the maximum amount of lines the IC chatlog - // may contain, from config.ini. - int get_max_log_size(); + // Returns whether the log should go upwards (new behaviour) + // or downwards (vanilla behaviour). + bool get_log_goes_downwards(); - // Returns whether the log should go upwards (new behaviour) - // or downwards (vanilla behaviour). - bool get_log_goes_downwards(); + // Returns the username the user may have set in config.ini. + QString get_default_username(); - // Returns the username the user may have set in config.ini. - QString get_default_username(); - - // Returns the audio device used for the client. - QString get_audio_output_device(); + // Returns the audio device used for the client. + QString get_audio_output_device(); #ifdef QTAUDIO - QAudioDeviceInfo QtAudioDevice; + QAudioDeviceInfo QtAudioDevice; #endif - // Returns whether the user would like to have custom shownames on by default. - bool get_showname_enabled_by_default(); + // Returns whether the user would like to have custom shownames on by default. + bool get_showname_enabled_by_default(); - //Returns the list of words in callwords.ini - QStringList get_call_words(); + // Returns the list of words in callwords.ini + QStringList get_call_words(); - //returns all of the file's lines in a QStringList - QStringList get_list_file(QString p_file); + // returns all of the file's lines in a QStringList + QStringList get_list_file(QString p_file); - //Process a file and return its text as a QString - QString read_file(QString filename); + // Process a file and return its text as a QString + QString read_file(QString filename); - //Write text to file. make_dir would auto-create the directory if it doesn't exist. - bool write_to_file(QString p_text, QString p_file, bool make_dir = false); + // Write text to file. make_dir would auto-create the directory if it doesn't + // exist. + bool write_to_file(QString p_text, QString p_file, bool make_dir = false); - //Append text to the end of the file. make_dir would auto-create the directory if it doesn't exist. - bool append_to_file(QString p_text, QString p_file, bool make_dir = false); + // Append text to the end of the file. make_dir would auto-create the + // directory if it doesn't exist. + bool append_to_file(QString p_text, QString p_file, bool make_dir = false); - //Appends the argument string to serverlist.txt - void write_to_serverlist_txt(QString p_line); + // Appends the argument string to serverlist.txt + void write_to_serverlist_txt(QString p_line); - //Returns the contents of serverlist.txt - QVector read_serverlist_txt(); + // Returns the contents of serverlist.txt + QVector read_serverlist_txt(); - //Returns the value of p_identifier in the design.ini file in p_design_path - QString read_design_ini(QString p_identifier, QString p_design_path); + // Returns the value of p_identifier in the design.ini file in p_design_path + QString read_design_ini(QString p_identifier, QString p_design_path); - //Returns the coordinates of widget with p_identifier from p_file - QPoint get_button_spacing(QString p_identifier, QString p_file); + // Returns the coordinates of widget with p_identifier from p_file + QPoint get_button_spacing(QString p_identifier, QString p_file); - //Returns the dimensions of widget with specified identifier from p_file - pos_size_type get_element_dimensions(QString p_identifier, QString p_file, QString p_char = ""); + // Returns the dimensions of widget with specified identifier from p_file + pos_size_type get_element_dimensions(QString p_identifier, QString p_file, + QString p_char = ""); - //Returns the value to you - QString get_design_element(QString p_identifier, QString p_file, QString p_char = ""); + // Returns the value to you + QString get_design_element(QString p_identifier, QString p_file, + QString p_char = ""); - //Returns the name of the font with p_identifier from p_file - QString get_font_name(QString p_identifier, QString p_file); + // Returns the name of the font with p_identifier from p_file + QString get_font_name(QString p_identifier, QString p_file); - //Returns the value of font_size with p_identifier from p_file - int get_font_size(QString p_identifier, QString p_file); + // Returns the value of font_size with p_identifier from p_file + int get_font_size(QString p_identifier, QString p_file); - //Returns the color with p_identifier from p_file - QColor get_color(QString p_identifier, QString p_file); + // Returns the color with p_identifier from p_file + QColor get_color(QString p_identifier, QString p_file); - // Returns the markdown symbol used for specified p_identifier such as colors - QString get_chat_markdown(QString p_identifier, QString p_file); + // Returns the markdown symbol used for specified p_identifier such as colors + QString get_chat_markdown(QString p_identifier, QString p_file); - // Returns the color from the misc folder. - QColor get_chat_color(QString p_identifier, QString p_chat); + // Returns the color from the misc folder. + QColor get_chat_color(QString p_identifier, QString p_chat); - //Returns the sfx with p_identifier from sounds.ini in the current theme path - QString get_sfx(QString p_identifier); + // Returns the sfx with p_identifier from sounds.ini in the current theme path + QString get_sfx(QString p_identifier); - //Figure out if we can opus this or if we should fall back to wav - QString get_sfx_suffix(QString sound_to_check); + // Figure out if we can opus this or if we should fall back to wav + QString get_sfx_suffix(QString sound_to_check); - // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to PNG. - QString get_image_suffix(QString path_to_check); + // Can we use APNG for this? If not, WEBP? If not, GIF? If not, fall back to + // PNG. + QString get_image_suffix(QString path_to_check); - // If this image is static and non-animated, return the supported static image formats. Currently only PNG. - QString get_static_image_suffix(QString path_to_check); + // If this image is static and non-animated, return the supported static image + // formats. Currently only PNG. + QString get_static_image_suffix(QString path_to_check); - //Returns the value of p_search_line within target_tag and terminator_tag - QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); + // Returns the value of p_search_line within target_tag and terminator_tag + QString read_char_ini(QString p_char, QString p_search_line, + QString target_tag); - //Returns a QStringList of all key=value definitions on a given tag. - QStringList read_ini_tags(QString p_file, QString target_tag = ""); + // Returns a QStringList of all key=value definitions on a given tag. + QStringList read_ini_tags(QString p_file, QString target_tag = ""); - //Sets the char.ini p_search_line key under tag target_tag to value. - void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); + // Sets the char.ini p_search_line key under tag target_tag to value. + void set_char_ini(QString p_char, QString value, QString p_search_line, + QString target_tag); - //Returns the text between target_tag and terminator_tag in p_file - QString get_stylesheet(QString p_file); + // Returns the text between target_tag and terminator_tag in p_file + QString get_stylesheet(QString p_file); - //Returns the text between target_tag and terminator_tag in p_file - QString get_tagged_stylesheet(QString target_tag, QString p_file); + // Returns the text between target_tag and terminator_tag in p_file + QString get_tagged_stylesheet(QString target_tag, QString p_file); - //Returns the side of the p_char character from that characters ini file - QString get_char_side(QString p_char); + // Returns the side of the p_char character from that characters ini file + QString get_char_side(QString p_char); - //Returns the showname from the ini of p_char - QString get_showname(QString p_char); + // Returns the showname from the ini of p_char + QString get_showname(QString p_char); - //Returns the value of chat image from the specific p_char's ini file - QString get_chat(QString p_char); + // Returns the value of chat image from the specific p_char's ini file + QString get_chat(QString p_char); - //Returns the value of chat font from the specific p_char's ini file - QString get_chat_font(QString p_char); + // Returns the value of chat font from the specific p_char's ini file + QString get_chat_font(QString p_char); - //Returns the value of chat font size from the specific p_char's ini file - int get_chat_size(QString p_char); + // Returns the value of chat font size from the specific p_char's ini file + int get_chat_size(QString p_char); - //Returns the value of shouts from the specified p_char's ini file - QString get_char_shouts(QString p_char); + // Returns the value of shouts from the specified p_char's ini file + QString get_char_shouts(QString p_char); - //Returns the preanim duration of p_char's p_emote - int get_preanim_duration(QString p_char, QString p_emote); + // Returns the preanim duration of p_char's p_emote + int get_preanim_duration(QString p_char, QString p_emote); - //Same as above, but only returns if it has a % in front(refer to Preanims section in the manual) - int get_ao2_preanim_duration(QString p_char, QString p_emote); + // Same as above, but only returns if it has a % in front(refer to Preanims + // section in the manual) + int get_ao2_preanim_duration(QString p_char, QString p_emote); - //Not in use - int get_text_delay(QString p_char, QString p_emote); + // Not in use + int get_text_delay(QString p_char, QString p_emote); - //Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string - QStringList get_theme_effects(); + // Get the effects folder referenced by the char.ini, read it and return the + // list of filenames in a string + QStringList get_theme_effects(); - //Get the theme's effects folder, read it and return the list of filenames in a string - QStringList get_effects(QString p_char); + // Get the theme's effects folder, read it and return the list of filenames in + // a string + QStringList get_effects(QString p_char); - //t - QString get_effect(QString effect, QString p_char, QString p_folder); + // t + QString get_effect(QString effect, QString p_char, QString p_folder); - //Return the effect sound associated with the fx_name in the misc/effects//sounds.ini, or theme/effects/sounds.ini. - QString get_effect_sound(QString fx_name, QString p_char); + // Return the effect sound associated with the fx_name in the + // misc/effects//sounds.ini, or theme/effects/sounds.ini. + QString get_effect_sound(QString fx_name, QString p_char); - // Returns the custom realisation used by the character. - QString get_custom_realization(QString p_char); + // Returns the custom realisation used by the character. + QString get_custom_realization(QString p_char); - //Returns the name of p_char - QString get_char_name(QString p_char); + // Returns the name of p_char + QString get_char_name(QString p_char); - //Returns the total amount of emotes of p_char - int get_emote_number(QString p_char); + // Returns the total amount of emotes of p_char + int get_emote_number(QString p_char); - //Returns the emote comment of p_char's p_emote - QString get_emote_comment(QString p_char, int p_emote); + // Returns the emote comment of p_char's p_emote + QString get_emote_comment(QString p_char, int p_emote); - //Returns the base name of p_char's p_emote - QString get_emote(QString p_char, int p_emote); + // Returns the base name of p_char's p_emote + QString get_emote(QString p_char, int p_emote); - //Returns the preanimation name of p_char's p_emote - QString get_pre_emote(QString p_char, int p_emote); + // Returns the preanimation name of p_char's p_emote + QString get_pre_emote(QString p_char, int p_emote); - //Returns the sfx of p_char's p_emote - QString get_sfx_name(QString p_char, int p_emote); + // Returns the sfx of p_char's p_emote + QString get_sfx_name(QString p_char, int p_emote); - //Returns the blipsound of p_char's p_emote - QString get_emote_blip(QString p_char, int p_emote); + // Returns the blipsound of p_char's p_emote + QString get_emote_blip(QString p_char, int p_emote); - //Returns if the sfx is defined as looping in char.ini - QString get_sfx_looping(QString p_char, QString p_sfx); + // Returns if the sfx is defined as looping in char.ini + QString get_sfx_looping(QString p_char, QString p_sfx); - //Returns if an emote has a frame specific SFX for it - QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); + // Returns if an emote has a frame specific SFX for it + QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); - //Returns if an emote has a frame specific SFX for it - QString get_flash_frame(QString p_char, QString p_emote, int n_frame); + // Returns if an emote has a frame specific SFX for it + QString get_flash_frame(QString p_char, QString p_emote, int n_frame); - //Returns if an emote has a frame specific SFX for it - QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); + // Returns if an emote has a frame specific SFX for it + QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); - //Not in use - int get_sfx_delay(QString p_char, int p_emote); + // Not in use + int get_sfx_delay(QString p_char, int p_emote); - //Returns the modifier for p_char's p_emote - int get_emote_mod(QString p_char, int p_emote); + // Returns the modifier for p_char's p_emote + int get_emote_mod(QString p_char, int p_emote); - //Returns the desk modifier for p_char's p_emote - int get_desk_mod(QString p_char, int p_emote); + // Returns the desk modifier for p_char's p_emote + int get_desk_mod(QString p_char, int p_emote); - //Returns p_char's gender - QString get_gender(QString p_char); + // Returns p_char's gender + QString get_gender(QString p_char); - // ====== - // These are all casing-related settings. - // ====== + // ====== + // These are all casing-related settings. + // ====== - // Returns if the user has casing alerts enabled. - bool get_casing_enabled(); + // Returns if the user has casing alerts enabled. + bool get_casing_enabled(); - // Returns if the user wants to get alerts for the defence role. - bool get_casing_defence_enabled(); + // Returns if the user wants to get alerts for the defence role. + bool get_casing_defence_enabled(); - // Same for prosecution. - bool get_casing_prosecution_enabled(); + // Same for prosecution. + bool get_casing_prosecution_enabled(); - // Same for judge. - bool get_casing_judge_enabled(); + // Same for judge. + bool get_casing_judge_enabled(); - // Same for juror. - bool get_casing_juror_enabled(); + // Same for juror. + bool get_casing_juror_enabled(); - // Same for steno. - bool get_casing_steno_enabled(); + // Same for steno. + bool get_casing_steno_enabled(); - // Same for CM. - bool get_casing_cm_enabled(); + // Same for CM. + bool get_casing_cm_enabled(); - // Get the message for the CM for casing alerts. - QString get_casing_can_host_cases(); + // Get the message for the CM for casing alerts. + QString get_casing_can_host_cases(); - //The file name of the log file in base/logs. - QString log_filename; + // The file name of the log file in base/logs. + QString log_filename; private: - const int RELEASE = 2; - const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 3; + const int RELEASE = 2; + const int MAJOR_VERSION = 8; + const int MINOR_VERSION = 3; - QString current_theme = "default"; + QString current_theme = "default"; - QVector server_list; - QVector favorite_list; + QVector server_list; + QVector favorite_list; private slots: - void ms_connect_finished(bool connected, bool will_retry); + void ms_connect_finished(bool connected, bool will_retry); public slots: - void server_disconnected(); - void loading_cancelled(); + void server_disconnected(); + void loading_cancelled(); }; #endif // AOAPPLICATION_H diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index db6dfce6..3a582a27 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -17,28 +17,28 @@ class AOBlipPlayer { public: - AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); + AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(qreal p_volume); + void set_blips(QString p_sfx); + void blip_tick(); + void set_volume(qreal p_volume); - int m_cycle = 0; + int m_cycle = 0; private: - const int max_blip_ms = 60; + const int max_blip_ms = 60; - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume; - QElapsedTimer delay; + QWidget *m_parent; + AOApplication *ao_app; + qreal m_volume; + QElapsedTimer delay; - void set_volume_internal(qreal p_volume); + void set_volume_internal(qreal p_volume); #if defined(BASSAUDIO) - HSTREAM m_stream_list[5]; + HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) - QSoundEffect m_blips; + QSoundEffect m_blips; #endif }; diff --git a/include/aobutton.h b/include/aobutton.h index 598d2c0d..f5758856 100644 --- a/include/aobutton.h +++ b/include/aobutton.h @@ -7,15 +7,15 @@ #include class AOButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - AOButton(QWidget *parent, AOApplication *p_ao_app); - ~AOButton(); + AOButton(QWidget *parent, AOApplication *p_ao_app); + ~AOButton(); - AOApplication *ao_app; + AOApplication *ao_app; - void set_image(QString p_image); + void set_image(QString p_image); }; #endif // AOBUTTON_H diff --git a/include/aocaseannouncerdialog.h b/include/aocaseannouncerdialog.h index 930fa414..0ac8f074 100644 --- a/include/aocaseannouncerdialog.h +++ b/include/aocaseannouncerdialog.h @@ -13,32 +13,34 @@ #include class AOCaseAnnouncerDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: - explicit AOCaseAnnouncerDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr, Courtroom *p_court = nullptr); + explicit AOCaseAnnouncerDialog(QWidget *parent = nullptr, + AOApplication *p_ao_app = nullptr, + Courtroom *p_court = nullptr); private: - AOApplication *ao_app; - Courtroom *court; + AOApplication *ao_app; + Courtroom *court; - QDialogButtonBox *ui_announcer_buttons; + QDialogButtonBox *ui_announcer_buttons; - QVBoxLayout *ui_vbox_layout; - QFormLayout *ui_form_layout; + QVBoxLayout *ui_vbox_layout; + QFormLayout *ui_form_layout; - QLabel *ui_case_title_label; - QLineEdit *ui_case_title_textbox; + QLabel *ui_case_title_label; + QLineEdit *ui_case_title_textbox; - QCheckBox *ui_defense_needed; - QCheckBox *ui_prosecutor_needed; - QCheckBox *ui_judge_needed; - QCheckBox *ui_juror_needed; - QCheckBox *ui_steno_needed; + QCheckBox *ui_defense_needed; + QCheckBox *ui_prosecutor_needed; + QCheckBox *ui_judge_needed; + QCheckBox *ui_juror_needed; + QCheckBox *ui_steno_needed; public slots: - void ok_pressed(); - void cancel_pressed(); + void ok_pressed(); + void cancel_pressed(); }; #endif // AOCASEANNOUNCERDIALOG_H diff --git a/include/aocharbutton.h b/include/aocharbutton.h index a5367924..dd27e62c 100644 --- a/include/aocharbutton.h +++ b/include/aocharbutton.h @@ -10,34 +10,35 @@ #include class AOCharButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken); + AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, + bool is_taken); - AOApplication *ao_app; + AOApplication *ao_app; - void refresh(); - void reset(); - void set_taken(bool is_taken); - void set_passworded(); + void refresh(); + void reset(); + void set_taken(bool is_taken); + void set_passworded(); - void apply_taken_image(); + void apply_taken_image(); - void set_image(QString p_character); + void set_image(QString p_character); private: - bool taken; + bool taken; - QWidget *m_parent; + QWidget *m_parent; - AOImage *ui_taken; - AOImage *ui_passworded; - AOImage *ui_selector; + AOImage *ui_taken; + AOImage *ui_passworded; + AOImage *ui_selector; protected: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); }; #endif // AOCHARBUTTON_H diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 2a185dd2..2dda0ec2 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -10,109 +10,116 @@ class AOApplication; class AOCharMovie : public QLabel { - Q_OBJECT + Q_OBJECT public: - AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); + AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app); - //Play a hat.gif - style preanimation - void play_pre(QString p_char, QString p_emote, int duration); + // Play a hat.gif - style preanimation + void play_pre(QString p_char, QString p_emote, int duration); - //Play a (b)normal.gif - style animation (talking) - void play_talking(QString p_char, QString p_emote); + // Play a (b)normal.gif - style animation (talking) + void play_talking(QString p_char, QString p_emote); - //Play an (a)normal.gif - style animation (not talking) - void play_idle(QString p_char, QString p_emote); + // Play an (a)normal.gif - style animation (not talking) + void play_idle(QString p_char, QString p_emote); - //Stop the movie, clearing the image - void stop(); + // Stop the movie, clearing the image + void stop(); - //Set the m_flipped variable to true/false - void set_flipped(bool p_flipped) { m_flipped = p_flipped; } + // Set the m_flipped variable to true/false + void set_flipped(bool p_flipped) { m_flipped = p_flipped; } - //Set the movie's playback speed (between 10% and 1000%) - void set_speed(int modifier) { speed = qMax(10, qMin(modifier, 1000)); } + // Set the movie's playback speed (between 10% and 1000%) + void set_speed(int modifier) { speed = qMax(10, qMin(modifier, 1000)); } - //Move the label itself around - void move(int ax, int ay); + // Move the label itself around + void move(int ax, int ay); - //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of - void combo_resize(int w, int h); + // This is somewhat pointless now as there's no "QMovie" object to resize, aka + // no "combo" to speak of + void combo_resize(int w, int h); - //Return the frame delay adjusted for speed - int get_frame_delay(int delay); + // Return the frame delay adjusted for speed + int get_frame_delay(int delay); - QStringList network_strings; + QStringList network_strings; - QString m_char; - QString m_emote; + QString m_char; + QString m_emote; private: - AOApplication *ao_app; + AOApplication *ao_app; - QVector movie_frames; - QVector movie_delays; + QVector movie_frames; + QVector movie_delays; - //Effects such as sfx, screenshakes and realization flashes are stored in here. - //QString entry format: "sfx^[sfx_name]", "shake", "flash". - //The program uses the QVector index as reference. - QVector> movie_effects; + // Effects such as sfx, screenshakes and realization flashes are stored in + // here. QString entry format: "sfx^[sfx_name]", "shake", "flash". The program + // uses the QVector index as reference. + QVector> movie_effects; - QTimer *preanim_timer; - QTimer *ticker; - QString last_path; - QImageReader *m_reader = new QImageReader(); + QTimer *preanim_timer; + QTimer *ticker; + QString last_path; + QImageReader *m_reader = new QImageReader(); - QElapsedTimer actual_time; + QElapsedTimer actual_time; - //Usually used to turn seconds into milliseconds such as for [Time] tag in char.ini - const int time_mod = 60; + // Usually used to turn seconds into milliseconds such as for [Time] tag in + // char.ini + const int time_mod = 60; - // These are the X and Y values before they are fixed based on the sprite's width. - int x = 0; - int y = 0; - // These are the width and height values before they are fixed based on the sprite's width. - int f_w = 0; - int f_h = 0; + // These are the X and Y values before they are fixed based on the sprite's + // width. + int x = 0; + int y = 0; + // These are the width and height values before they are fixed based on the + // sprite's width. + int f_w = 0; + int f_h = 0; - int frame = 0; - int max_frames = 0; + int frame = 0; + int max_frames = 0; - int speed = 100; + int speed = 100; - bool m_flipped = false; - bool play_once = true; + bool m_flipped = false; + bool play_once = true; - //Set the movie's image to provided paths, preparing for playback. - void load_image(QString p_char, QString p_emote, QString emote_prefix); + // Set the movie's image to provided paths, preparing for playback. + void load_image(QString p_char, QString p_emote, QString emote_prefix); - //Start playback of the movie (if animated). - void play(); + // Start playback of the movie (if animated). + void play(); - //Play a frame-specific effect, if there's any defined for that specific frame. - void play_frame_effect(int frame); + // Play a frame-specific effect, if there's any defined for that specific + // frame. + void play_frame_effect(int frame); - //Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a provided QImage - QPixmap get_pixmap(QImage image); + // Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a + // provided QImage + QPixmap get_pixmap(QImage image); - //Set the movie's frame to provided pixmap - void set_frame(QPixmap f_pixmap); + // Set the movie's frame to provided pixmap + void set_frame(QPixmap f_pixmap); - //Initialize the frame-specific effects from the char.ini - void load_effects(); + // Initialize the frame-specific effects from the char.ini + void load_effects(); - //Initialize the frame-specific effects from the provided network_strings, this is only initialized if network_strings has size more than 0. - void load_network_effects(); + // Initialize the frame-specific effects from the provided network_strings, + // this is only initialized if network_strings has size more than 0. + void load_network_effects(); signals: - void done(); - void shake(); - void flash(); - void play_sfx(QString sfx); + void done(); + void shake(); + void flash(); + void play_sfx(QString sfx); private slots: - void preanim_done(); - void movie_ticker(); + void preanim_done(); + void movie_ticker(); }; #endif // AOCHARMOVIE_H diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index 8674bb08..cb46167f 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -7,28 +7,29 @@ #include class AOEmoteButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, + int p_w, int p_h); - void set_image(QString p_image, QString p_emote_comment); - void set_char_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); - void set_id(int p_id) { m_id = p_id; } - int get_id() { return m_id; } + void set_id(int p_id) { m_id = p_id; } + int get_id() { return m_id; } private: - QWidget *parent; - AOApplication *ao_app; + QWidget *parent; + AOApplication *ao_app; - int m_id = 0; + int m_id = 0; signals: - void emote_clicked(int p_id); + void emote_clicked(int p_id); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEMOTEBUTTON_H diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h index 2ac6860b..d7812fe9 100644 --- a/include/aoevidencebutton.h +++ b/include/aoevidencebutton.h @@ -9,42 +9,43 @@ #include class AOEvidenceButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEvidenceButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, + int p_w, int p_h); - void set_image(QString p_image); - void set_theme_image(QString p_image); - void set_id(int p_id) { m_id = p_id; } + void set_image(QString p_image); + void set_theme_image(QString p_image); + void set_id(int p_id) { m_id = p_id; } - void set_selected(bool p_selected); + void set_selected(bool p_selected); private: - AOApplication *ao_app; - QWidget *m_parent; + AOApplication *ao_app; + QWidget *m_parent; - AOImage *ui_selected; - AOImage *ui_selector; + AOImage *ui_selected; + AOImage *ui_selector; - int m_id = 0; + int m_id = 0; protected: - void enterEvent(QEvent *e); - void leaveEvent(QEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); - /* - void dragLeaveEvent(QMouseEvent *e); - void dragEnterEvent(QMouseEvent *e); - */ + void enterEvent(QEvent *e); + void leaveEvent(QEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); + /* +void dragLeaveEvent(QMouseEvent *e); +void dragEnterEvent(QMouseEvent *e); +*/ signals: - void evidence_clicked(int p_id); - void evidence_double_clicked(int p_id); - void on_hover(int p_id, bool p_state); + void evidence_clicked(int p_id); + void evidence_double_clicked(int p_id); + void on_hover(int p_id, bool p_state); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEVIDENCEBUTTON_H diff --git a/include/aoevidencedisplay.h b/include/aoevidencedisplay.h index 0315ffcf..979a754e 100644 --- a/include/aoevidencedisplay.h +++ b/include/aoevidencedisplay.h @@ -9,24 +9,24 @@ #include class AOEvidenceDisplay : public QLabel { - Q_OBJECT + Q_OBJECT public: - AOEvidenceDisplay(QWidget *p_parent, AOApplication *p_ao_app); + AOEvidenceDisplay(QWidget *p_parent, AOApplication *p_ao_app); - void show_evidence(QString p_evidence_image, bool is_left_side, int p_volume); - QLabel *get_evidence_icon(); - void reset(); - void combo_resize(int w, int h); + void show_evidence(QString p_evidence_image, bool is_left_side, int p_volume); + QLabel *get_evidence_icon(); + void reset(); + void combo_resize(int w, int h); private: - AOApplication *ao_app; - AOMovie *evidence_movie; - QLabel *evidence_icon; - AOSfxPlayer *sfx_player; + AOApplication *ao_app; + AOMovie *evidence_movie; + QLabel *evidence_icon; + AOSfxPlayer *sfx_player; private slots: - void show_done(); + void show_done(); }; #endif // AOEVIDENCEDISPLAY_H diff --git a/include/aoimage.h b/include/aoimage.h index a6960de6..01ef8540 100644 --- a/include/aoimage.h +++ b/include/aoimage.h @@ -1,4 +1,4 @@ -//This class represents a static theme-dependent image +// This class represents a static theme-dependent image #ifndef AOIMAGE_H #define AOIMAGE_H @@ -10,15 +10,15 @@ class AOImage : public QLabel { public: - AOImage(QWidget *parent, AOApplication *p_ao_app); - ~AOImage(); + AOImage(QWidget *parent, AOApplication *p_ao_app); + ~AOImage(); - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; - bool set_image(QString p_image); - bool set_chatbox(QString p_path); - void set_size_and_pos(QString identifier); + bool set_image(QString p_image); + bool set_chatbox(QString p_path); + void set_size_and_pos(QString identifier); }; #endif // AOIMAGE_H diff --git a/include/aolineedit.h b/include/aolineedit.h index 06206a95..5dce3aaa 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -5,22 +5,22 @@ #include class AOLineEdit : public QLineEdit { - Q_OBJECT + Q_OBJECT public: - AOLineEdit(QWidget *parent); + AOLineEdit(QWidget *parent); - void preserve_selection(bool toggle) { p_selection = toggle; } + void preserve_selection(bool toggle) { p_selection = toggle; } private: - bool p_selection = false; + bool p_selection = false; protected: - void mouseDoubleClickEvent(QMouseEvent *e); - void focusOutEvent(QFocusEvent *ev); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: - void double_clicked(); + void double_clicked(); }; #endif // AOLINEEDIT_H diff --git a/include/aomovie.h b/include/aomovie.h index 8d604423..eb7f7a53 100644 --- a/include/aomovie.h +++ b/include/aomovie.h @@ -8,28 +8,29 @@ class Courtroom; class AOApplication; class AOMovie : public QLabel { - Q_OBJECT + Q_OBJECT public: - AOMovie(QWidget *p_parent, AOApplication *p_ao_app); + AOMovie(QWidget *p_parent, AOApplication *p_ao_app); - void set_play_once(bool p_play_once); - void play(QString p_image, QString p_char = "", QString p_custom_theme = "", int default_duration = 0); - void combo_resize(int w, int h); - void stop(); + void set_play_once(bool p_play_once); + void play(QString p_image, QString p_char = "", QString p_custom_theme = "", + int default_duration = 0); + void combo_resize(int w, int h); + void stop(); private: - QMovie *m_movie; - AOApplication *ao_app; - QTimer *timer; - bool play_once = true; + QMovie *m_movie; + AOApplication *ao_app; + QTimer *timer; + bool play_once = true; signals: - void done(); + void done(); private slots: - void frame_change(int n_frame); - void timer_done(); + void frame_change(int n_frame); + void timer_done(); }; #endif // AOMOVIE_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index d28a3ed6..5c72649f 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -17,63 +17,64 @@ #if defined(BASSAUDIO) class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - virtual ~AOMusicPlayer(); - void set_volume(int p_value, int channel = -1); - void set_looping(bool toggle, int channel = 0); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + virtual ~AOMusicPlayer(); + void set_volume(int p_value, int channel = -1); + void set_looping(bool toggle, int channel = 0); - const int m_channelmax = 4; + const int m_channelmax = 4; - //These have to be public for the stupid sync thing - QWORD loop_start = 0; - QWORD loop_end = 0; + // These have to be public for the stupid sync thing + QWORD loop_start = 0; + QWORD loop_end = 0; public slots: - void play(QString p_song, int channel = 0, bool loop = false, int effect_flags = 0); - void stop(int channel = 0); + void play(QString p_song, int channel = 0, bool loop = false, + int effect_flags = 0); + void stop(int channel = 0); private: - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; - bool m_looping = false; - int m_volume[4] = {0, 0, 0, 0}; + bool m_looping = false; + int m_volume[4] = {0, 0, 0, 0}; - // Channel 0 = music - // Channel 1 = ambience - // Channel 2 = extra - // Channel 3 = extra - HSTREAM m_stream_list[4]; - HSYNC loop_sync[4]; + // Channel 0 = music + // Channel 1 = ambience + // Channel 2 = extra + // Channel 3 = extra + HSTREAM m_stream_list[4]; + HSYNC loop_sync[4]; }; #elif defined(QTAUDIO) class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); - void play(QString p_song); - void set_volume(int p_value); + void play(QString p_song); + void set_volume(int p_value); private: - QMediaPlayer m_player; - QWidget *m_parent; - AOApplication *ao_app; + QMediaPlayer m_player; + QWidget *m_parent; + AOApplication *ao_app; - int m_volume = 0; + int m_volume = 0; }; #else class AOMusicPlayer { public: - AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); - void play(QString p_song); - void set_volume(int p_value); + void play(QString p_song); + void set_volume(int p_value); private: - QWidget *m_parent; - AOApplication *ao_app; + QWidget *m_parent; + AOApplication *ao_app; }; #endif diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index f9c369d2..b89e3174 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -31,116 +31,117 @@ #include class AOOptionsDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: - explicit AOOptionsDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr); + explicit AOOptionsDialog(QWidget *parent = nullptr, + AOApplication *p_ao_app = nullptr); private: - AOApplication *ao_app; - - QVBoxLayout *ui_vertical_layout; - QTabWidget *ui_settings_tabs; - - QWidget *ui_gameplay_tab; - QWidget *ui_form_layout_widget; - QFormLayout *ui_gameplay_form; - QLabel *ui_theme_label; - QComboBox *ui_theme_combobox; - QFrame *ui_theme_log_divider; - QLabel *ui_downwards_lbl; - QCheckBox *ui_downwards_cb; - QLabel *ui_length_lbl; - QSpinBox *ui_length_spinbox; - QFrame *ui_log_names_divider; - QLineEdit *ui_username_textbox; - QLabel *ui_username_lbl; - QLabel *ui_showname_lbl; - QCheckBox *ui_showname_cb; - QFrame *ui_net_divider; - QLabel *ui_ms_lbl; - QLineEdit *ui_ms_textbox; - QLabel *ui_discord_lbl; - QCheckBox *ui_discord_cb; - QLabel *ui_language_label; - QComboBox *ui_language_combobox; - - QLabel *ui_shake_lbl; - QCheckBox *ui_shake_cb; - QLabel *ui_effects_lbl; - QCheckBox *ui_effects_cb; - QLabel *ui_framenetwork_lbl; - QCheckBox *ui_framenetwork_cb; - - QLabel *ui_colorlog_lbl; - QCheckBox *ui_colorlog_cb; - - QLabel *ui_stickysounds_lbl; - QCheckBox *ui_stickysounds_cb; - - QLabel *ui_stickyeffects_lbl; - QCheckBox *ui_stickyeffects_cb; - - QLabel *ui_stickypres_lbl; - QCheckBox *ui_stickypres_cb; - - QWidget *ui_callwords_tab; - QWidget *ui_callwords_widget; - QVBoxLayout *ui_callwords_layout; - QPlainTextEdit *ui_callwords_textbox; - QLabel *ui_callwords_explain_lbl; - QCheckBox *ui_callwords_char_textbox; - - QWidget *ui_audio_tab; - QWidget *ui_audio_widget; - QFormLayout *ui_audio_layout; - QLabel *ui_audio_device_lbl; - QComboBox *ui_audio_device_combobox; - QFrame *ui_audio_volume_divider; - QSpinBox *ui_music_volume_spinbox; - QLabel *ui_music_volume_lbl; - QSpinBox *ui_sfx_volume_spinbox; - QSpinBox *ui_blips_volume_spinbox; - QLabel *ui_sfx_volume_lbl; - QLabel *ui_blips_volume_lbl; - QFrame *ui_volume_blip_divider; - QSpinBox *ui_bliprate_spinbox; - QLabel *ui_bliprate_lbl; - QCheckBox *ui_blank_blips_cb; - QLabel *ui_blank_blips_lbl; - QLabel *ui_loopsfx_lbl; - QCheckBox *ui_loopsfx_cb; - QLabel *ui_objectmusic_lbl; - QCheckBox *ui_objectmusic_cb; - QDialogButtonBox *ui_settings_buttons; - - QWidget *ui_casing_tab; - QWidget *ui_casing_widget; - QFormLayout *ui_casing_layout; - QLabel *ui_casing_supported_lbl; - QLabel *ui_casing_enabled_lbl; - QCheckBox *ui_casing_enabled_cb; - QLabel *ui_casing_def_lbl; - QCheckBox *ui_casing_def_cb; - QLabel *ui_casing_pro_lbl; - QCheckBox *ui_casing_pro_cb; - QLabel *ui_casing_jud_lbl; - QCheckBox *ui_casing_jud_cb; - QLabel *ui_casing_jur_lbl; - QCheckBox *ui_casing_jur_cb; - QLabel *ui_casing_steno_lbl; - QCheckBox *ui_casing_steno_cb; - QLabel *ui_casing_cm_lbl; - QCheckBox *ui_casing_cm_cb; - QLabel *ui_casing_cm_cases_lbl; - QLineEdit *ui_casing_cm_cases_textbox; - - bool needs_default_audiodev(); + AOApplication *ao_app; + + QVBoxLayout *ui_vertical_layout; + QTabWidget *ui_settings_tabs; + + QWidget *ui_gameplay_tab; + QWidget *ui_form_layout_widget; + QFormLayout *ui_gameplay_form; + QLabel *ui_theme_label; + QComboBox *ui_theme_combobox; + QFrame *ui_theme_log_divider; + QLabel *ui_downwards_lbl; + QCheckBox *ui_downwards_cb; + QLabel *ui_length_lbl; + QSpinBox *ui_length_spinbox; + QFrame *ui_log_names_divider; + QLineEdit *ui_username_textbox; + QLabel *ui_username_lbl; + QLabel *ui_showname_lbl; + QCheckBox *ui_showname_cb; + QFrame *ui_net_divider; + QLabel *ui_ms_lbl; + QLineEdit *ui_ms_textbox; + QLabel *ui_discord_lbl; + QCheckBox *ui_discord_cb; + QLabel *ui_language_label; + QComboBox *ui_language_combobox; + + QLabel *ui_shake_lbl; + QCheckBox *ui_shake_cb; + QLabel *ui_effects_lbl; + QCheckBox *ui_effects_cb; + QLabel *ui_framenetwork_lbl; + QCheckBox *ui_framenetwork_cb; + + QLabel *ui_colorlog_lbl; + QCheckBox *ui_colorlog_cb; + + QLabel *ui_stickysounds_lbl; + QCheckBox *ui_stickysounds_cb; + + QLabel *ui_stickyeffects_lbl; + QCheckBox *ui_stickyeffects_cb; + + QLabel *ui_stickypres_lbl; + QCheckBox *ui_stickypres_cb; + + QWidget *ui_callwords_tab; + QWidget *ui_callwords_widget; + QVBoxLayout *ui_callwords_layout; + QPlainTextEdit *ui_callwords_textbox; + QLabel *ui_callwords_explain_lbl; + QCheckBox *ui_callwords_char_textbox; + + QWidget *ui_audio_tab; + QWidget *ui_audio_widget; + QFormLayout *ui_audio_layout; + QLabel *ui_audio_device_lbl; + QComboBox *ui_audio_device_combobox; + QFrame *ui_audio_volume_divider; + QSpinBox *ui_music_volume_spinbox; + QLabel *ui_music_volume_lbl; + QSpinBox *ui_sfx_volume_spinbox; + QSpinBox *ui_blips_volume_spinbox; + QLabel *ui_sfx_volume_lbl; + QLabel *ui_blips_volume_lbl; + QFrame *ui_volume_blip_divider; + QSpinBox *ui_bliprate_spinbox; + QLabel *ui_bliprate_lbl; + QCheckBox *ui_blank_blips_cb; + QLabel *ui_blank_blips_lbl; + QLabel *ui_loopsfx_lbl; + QCheckBox *ui_loopsfx_cb; + QLabel *ui_objectmusic_lbl; + QCheckBox *ui_objectmusic_cb; + QDialogButtonBox *ui_settings_buttons; + + QWidget *ui_casing_tab; + QWidget *ui_casing_widget; + QFormLayout *ui_casing_layout; + QLabel *ui_casing_supported_lbl; + QLabel *ui_casing_enabled_lbl; + QCheckBox *ui_casing_enabled_cb; + QLabel *ui_casing_def_lbl; + QCheckBox *ui_casing_def_cb; + QLabel *ui_casing_pro_lbl; + QCheckBox *ui_casing_pro_cb; + QLabel *ui_casing_jud_lbl; + QCheckBox *ui_casing_jud_cb; + QLabel *ui_casing_jur_lbl; + QCheckBox *ui_casing_jur_cb; + QLabel *ui_casing_steno_lbl; + QCheckBox *ui_casing_steno_cb; + QLabel *ui_casing_cm_lbl; + QCheckBox *ui_casing_cm_cb; + QLabel *ui_casing_cm_cases_lbl; + QLineEdit *ui_casing_cm_cases_textbox; + + bool needs_default_audiodev(); signals: public slots: - void save_pressed(); - void discard_pressed(); + void save_pressed(); + void discard_pressed(); }; #endif // AOOPTIONSDIALOG_H diff --git a/include/aopacket.h b/include/aopacket.h index 4133fd56..4097be86 100644 --- a/include/aopacket.h +++ b/include/aopacket.h @@ -7,25 +7,25 @@ class AOPacket { public: - AOPacket(QString p_packet_string); - AOPacket(QString header, QStringList &p_contents); - ~AOPacket(); + AOPacket(QString p_packet_string); + AOPacket(QString header, QStringList &p_contents); + ~AOPacket(); - QString get_header() { return m_header; } - QStringList &get_contents() { return m_contents; } - QString to_string(); + QString get_header() { return m_header; } + QStringList &get_contents() { return m_contents; } + QString to_string(); - void encrypt_header(unsigned int p_key); - void decrypt_header(unsigned int p_key); + void encrypt_header(unsigned int p_key); + void decrypt_header(unsigned int p_key); - void net_encode(); - void net_decode(); + void net_encode(); + void net_decode(); private: - bool encrypted = false; + bool encrypted = false; - QString m_header; - QStringList m_contents; + QString m_header; + QStringList m_contents; }; #endif // AOPACKET_H diff --git a/include/aoscene.h b/include/aoscene.h index 3093b0fb..726e2641 100644 --- a/include/aoscene.h +++ b/include/aoscene.h @@ -9,31 +9,34 @@ class Courtroom; class AOApplication; class AOScene : public QLabel { - Q_OBJECT + Q_OBJECT public: - explicit AOScene(QWidget *parent, AOApplication *p_ao_app); + explicit AOScene(QWidget *parent, AOApplication *p_ao_app); - void set_image(QString p_image); - void set_legacy_desk(QString p_image); + void set_image(QString p_image); + void set_legacy_desk(QString p_image); - //Move the label itself around - void move(int ax, int ay); + // Move the label itself around + void move(int ax, int ay); - //This is somewhat pointless now as there's no "QMovie" object to resize, aka no "combo" to speak of - void combo_resize(int w, int h); + // This is somewhat pointless now as there's no "QMovie" object to resize, aka + // no "combo" to speak of + void combo_resize(int w, int h); private: - QWidget *m_parent; - QMovie *m_movie; - AOApplication *ao_app; - QString last_image; - - // These are the X and Y values before they are fixed based on the sprite's width. - int x = 0; - int y = 0; - // These are the width and height values before they are fixed based on the sprite's width. - int f_w = 0; - int f_h = 0; + QWidget *m_parent; + QMovie *m_movie; + AOApplication *ao_app; + QString last_image; + + // These are the X and Y values before they are fixed based on the sprite's + // width. + int x = 0; + int y = 0; + // These are the width and height values before they are fixed based on the + // sprite's width. + int f_w = 0; + int f_h = 0; }; #endif // AOSCENE_H diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 4488aa6a..9c9824ab 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -16,29 +16,30 @@ class AOSfxPlayer { public: - AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); + AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); - void clear(); - void loop_clear(); - void play(QString p_sfx, QString p_char = "", QString shout = "", int channel = -1); - void stop(int channel = -1); - void set_volume(qreal p_volume); - void set_looping(bool toggle, int channel = -1); - int m_channel = 0; + void clear(); + void loop_clear(); + void play(QString p_sfx, QString p_char = "", QString shout = "", + int channel = -1); + void stop(int channel = -1); + void set_volume(qreal p_volume); + void set_looping(bool toggle, int channel = -1); + int m_channel = 0; private: - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume = 0; + QWidget *m_parent; + AOApplication *ao_app; + qreal m_volume = 0; - bool m_looping = true; - void set_volume_internal(qreal p_volume); + bool m_looping = true; + void set_volume_internal(qreal p_volume); #if defined(BASSAUDIO) - const int m_channelmax = 5; - HSTREAM m_stream_list[5]; + const int m_channelmax = 5; + HSTREAM m_stream_list[5]; #elif defined(QTAUDIO) - QSoundEffect m_sfx; + QSoundEffect m_sfx; #endif }; diff --git a/include/aotextarea.h b/include/aotextarea.h index 8bf5199b..453e9659 100644 --- a/include/aotextarea.h +++ b/include/aotextarea.h @@ -9,16 +9,17 @@ class AOTextArea : public QTextBrowser { public: - AOTextArea(QWidget *p_parent = nullptr); + AOTextArea(QWidget *p_parent = nullptr); - void append_linked(QString p_message); - void append_chatmessage(QString p_name, QString p_message, QString p_colur); - void append_error(QString p_message); + void append_linked(QString p_message); + void append_chatmessage(QString p_name, QString p_message, QString p_colur); + void append_error(QString p_message); private: - const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); + const QRegExp url_parser_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b"); - void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down); + void auto_scroll(QTextCursor old_cursor, int scrollbar_value, + bool is_scrolled_down); }; #endif // AOTEXTAREA_H diff --git a/include/aotextedit.h b/include/aotextedit.h index eb2c356d..8d876f17 100644 --- a/include/aotextedit.h +++ b/include/aotextedit.h @@ -4,18 +4,18 @@ #include class AOTextEdit : public QPlainTextEdit { - Q_OBJECT + Q_OBJECT public: - AOTextEdit(QWidget *parent); + AOTextEdit(QWidget *parent); protected: - void mouseDoubleClickEvent(QMouseEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); signals: - void double_clicked(); + void double_clicked(); private slots: - void on_enter_pressed(); + void on_enter_pressed(); }; #endif // AOTEXTEDIT_H diff --git a/include/bass.h b/include/bass.h index 4180a371..ec2c7a29 100644 --- a/include/bass.h +++ b/include/bass.h @@ -1,8 +1,8 @@ /* - BASS 2.4 C/C++ header file - Copyright (c) 1999-2019 Un4seen Developments Ltd. + BASS 2.4 C/C++ header file + Copyright (c) 1999-2019 Un4seen Developments Ltd. - See the BASS.CHM file for more detailed documentation + See the BASS.CHM file for more detailed documentation */ #ifndef BASS_H @@ -152,13 +152,14 @@ typedef DWORD HPLUGIN; // Plugin handle #define BASS_CONFIG_LIBSSL 64 // BASS_Init flags -#define BASS_DEVICE_8BITS 1 // 8 bit -#define BASS_DEVICE_MONO 2 // mono -#define BASS_DEVICE_3D 4 // enable 3D functionality -#define BASS_DEVICE_16BITS 8 // limit output to 16 bit -#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) -#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel -#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment +#define BASS_DEVICE_8BITS 1 // 8 bit +#define BASS_DEVICE_MONO 2 // mono +#define BASS_DEVICE_3D 4 // enable 3D functionality +#define BASS_DEVICE_16BITS 8 // limit output to 16 bit +#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) +#define BASS_DEVICE_CPSPEAKERS \ + 0x400 // detect speakers via Windows control panel +#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment #define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement #define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin #define BASS_DEVICE_FREQ 0x4000 // set device sample rate @@ -173,14 +174,15 @@ typedef DWORD HPLUGIN; // Plugin handle // Device info structure typedef struct { -#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) - const wchar_t *name; // description - const wchar_t *driver; // driver +#if defined(_WIN32_WCE) || \ + (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // description + const wchar_t *driver; // driver #else - const char *name; // description - const char *driver; // driver + const char *name; // description + const char *driver; // driver #endif - DWORD flags; + DWORD flags; } BASS_DEVICEINFO; // BASS_DEVICEINFO flags @@ -206,26 +208,32 @@ typedef struct { #define BASS_DEVICES_AIRPLAY 0x1000000 typedef struct { - DWORD flags; // device capabilities (DSCAPS_xxx flags) - DWORD hwsize; // size of total device hardware memory - DWORD hwfree; // size of free device hardware memory - DWORD freesam; // number of free sample slots in the hardware - DWORD free3d; // number of free 3D sample slots in the hardware - DWORD minrate; // min sample rate supported by the hardware - DWORD maxrate; // max sample rate supported by the hardware - BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) - DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) - DWORD dsver; // DirectSound version - DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) - DWORD initflags; // BASS_Init "flags" parameter - DWORD speakers; // number of speakers available - DWORD freq; // current output rate + DWORD flags; // device capabilities (DSCAPS_xxx flags) + DWORD hwsize; // size of total device hardware memory + DWORD hwfree; // size of free device hardware memory + DWORD freesam; // number of free sample slots in the hardware + DWORD free3d; // number of free 3D sample slots in the hardware + DWORD minrate; // min sample rate supported by the hardware + DWORD maxrate; // max sample rate supported by the hardware + BOOL + eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + DWORD minbuf; // recommended minimum buffer length in ms (requires + // BASS_DEVICE_LATENCY) + DWORD dsver; // DirectSound version + DWORD latency; // delay (in ms) before start of playback (requires + // BASS_DEVICE_LATENCY) + DWORD initflags; // BASS_Init "flags" parameter + DWORD speakers; // number of speakers available + DWORD freq; // current output rate } BASS_INFO; // BASS_INFO flags (from DSOUND.H) -#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate -#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support -#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft +#define DSCAPS_CONTINUOUSRATE \ + 0x00000010 // supports all sample rates between min/maxrate +#define DSCAPS_EMULDRIVER \ + 0x00000020 // device does NOT have hardware DirectSound support +#define DSCAPS_CERTIFIED \ + 0x00000040 // device driver has been certified by Microsoft #define DSCAPS_SECONDARYMONO 0x00000100 // mono #define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo #define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit @@ -233,16 +241,19 @@ typedef struct { // Recording device info structure typedef struct { - DWORD flags; // device capabilities (DSCCAPS_xxx flags) - DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) - DWORD inputs; // number of inputs - BOOL singlein; // TRUE = only 1 input can be set at a time - DWORD freq; // current input rate + DWORD flags; // device capabilities (DSCCAPS_xxx flags) + DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) + DWORD inputs; // number of inputs + BOOL singlein; // TRUE = only 1 input can be set at a time + DWORD freq; // current input rate } BASS_RECORDINFO; // BASS_RECORDINFO flags (from DSOUND.H) -#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support -#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft +#define DSCCAPS_EMULDRIVER \ + DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording + // support +#define DSCCAPS_CERTIFIED \ + DSCAPS_CERTIFIED // device driver has been certified by Microsoft // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) #ifndef WAVE_FORMAT_1M08 @@ -262,46 +273,54 @@ typedef struct { // Sample info structure typedef struct { - DWORD freq; // default playback rate - float volume; // default volume (0-1) - float pan; // default pan (-1=left, 0=middle, 1=right) - DWORD flags; // BASS_SAMPLE_xxx flags - DWORD length; // length (in bytes) - DWORD max; // maximum simultaneous playbacks - DWORD origres; // original resolution - DWORD chans; // number of channels - DWORD mingap; // minimum gap (ms) between creating channels - DWORD mode3d; // BASS_3DMODE_xxx mode - float mindist; // minimum distance - float maxdist; // maximum distance - DWORD iangle; // angle of inside projection cone - DWORD oangle; // angle of outside projection cone - float outvol; // delta-volume outside the projection cone - DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) - DWORD priority; // priority (0=lowest, 0xffffffff=highest) + DWORD freq; // default playback rate + float volume; // default volume (0-1) + float pan; // default pan (-1=left, 0=middle, 1=right) + DWORD flags; // BASS_SAMPLE_xxx flags + DWORD length; // length (in bytes) + DWORD max; // maximum simultaneous playbacks + DWORD origres; // original resolution + DWORD chans; // number of channels + DWORD mingap; // minimum gap (ms) between creating channels + DWORD mode3d; // BASS_3DMODE_xxx mode + float mindist; // minimum distance + float maxdist; // maximum distance + DWORD iangle; // angle of inside projection cone + DWORD oangle; // angle of outside projection cone + float outvol; // delta-volume outside the projection cone + DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) + DWORD priority; // priority (0=lowest, 0xffffffff=highest) } BASS_SAMPLE; -#define BASS_SAMPLE_8BITS 1 // 8 bit -#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point -#define BASS_SAMPLE_MONO 2 // mono -#define BASS_SAMPLE_LOOP 4 // looped -#define BASS_SAMPLE_3D 8 // 3D functionality -#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing -#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) -#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management -#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects -#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume -#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing -#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only) - -#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) -#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends -#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams -#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks -#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) -#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC - -#define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info +#define BASS_SAMPLE_8BITS 1 // 8 bit +#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point +#define BASS_SAMPLE_MONO 2 // mono +#define BASS_SAMPLE_LOOP 4 // looped +#define BASS_SAMPLE_3D 8 // 3D functionality +#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing +#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) +#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management +#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects +#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume +#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing +#define BASS_SAMPLE_OVER_DIST \ + 0x30000 // override furthest from listener (3D only) + +#define BASS_STREAM_PRESCAN \ + 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) +#define BASS_STREAM_AUTOFREE \ + 0x40000 // automatically free the stream when it stop/ends +#define BASS_STREAM_RESTRATE \ + 0x80000 // restrict the download rate of internet file streams +#define BASS_STREAM_BLOCK \ + 0x100000 // download/play internet file stream in small blocks +#define BASS_STREAM_DECODE \ + 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) +#define BASS_STREAM_STATUS \ + 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC + +#define BASS_MP3_IGNOREDELAY \ + 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info #define BASS_MP3_SETPOS BASS_STREAM_PRESCAN #define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT @@ -313,19 +332,20 @@ typedef struct { #define BASS_MUSIC_DECODE BASS_STREAM_DECODE #define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length #define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN -#define BASS_MUSIC_RAMP 0x200 // normal ramping -#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping -#define BASS_MUSIC_SURROUND 0x800 // surround sound -#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) -#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files -#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does -#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does -#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing -#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing -#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position -#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position -#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect -#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples +#define BASS_MUSIC_RAMP 0x200 // normal ramping +#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping +#define BASS_MUSIC_SURROUND 0x800 // surround sound +#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) +#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files +#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does +#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does +#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing +#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing +#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position +#define BASS_MUSIC_POSRESETEX \ + 0x400000 // stop all notes and reset bmp/etc when moving position +#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect +#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples // Speaker assignment flags #define BASS_SPEAKER_FRONT 0x1000000 // front speakers @@ -360,14 +380,14 @@ typedef struct { // Channel info structure typedef struct { - DWORD freq; // default playback rate - DWORD chans; // channels - DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags - DWORD ctype; // type of channel - DWORD origres; // original resolution - HPLUGIN plugin; // plugin - HSAMPLE sample; // sample - const char *filename; // filename + DWORD freq; // default playback rate + DWORD chans; // channels + DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + DWORD ctype; // type of channel + DWORD origres; // original resolution + HPLUGIN plugin; // plugin + HSAMPLE sample; // sample + const char *filename; // filename } BASS_CHANNELINFO; #define BASS_ORIGRES_FLOAT 0x10000 @@ -397,31 +417,32 @@ typedef struct { #define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag typedef struct { - DWORD ctype; // channel type -#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) - const wchar_t *name; // format description - const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) + DWORD ctype; // channel type +#if defined(_WIN32_WCE) || \ + (WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // format description + const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) #else - const char *name; // format description - const char *exts; // file extension filter (*.ext1;*.ext2;etc...) + const char *name; // format description + const char *exts; // file extension filter (*.ext1;*.ext2;etc...) #endif } BASS_PLUGINFORM; typedef struct { - DWORD version; // version (same form as BASS_GetVersion) - DWORD formatc; // number of formats - const BASS_PLUGINFORM *formats; // the array of formats + DWORD version; // version (same form as BASS_GetVersion) + DWORD formatc; // number of formats + const BASS_PLUGINFORM *formats; // the array of formats } BASS_PLUGININFO; // 3D vector (for 3D positions/velocities/orientations) typedef struct BASS_3DVECTOR { #ifdef __cplusplus - BASS_3DVECTOR(){}; - BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z){}; + BASS_3DVECTOR(){}; + BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z){}; #endif - float x; // +=right, -=left - float y; // +=up, -=down - float z; // +=front, -=behind + float x; // +=right, -=left + float y; // +=up, -=down + float z; // +=front, -=behind } BASS_3DVECTOR; // 3D channel modes @@ -437,34 +458,34 @@ typedef struct BASS_3DVECTOR { // EAX environments, use with BASS_SetEAXParameters enum { - EAX_ENVIRONMENT_GENERIC, - EAX_ENVIRONMENT_PADDEDCELL, - EAX_ENVIRONMENT_ROOM, - EAX_ENVIRONMENT_BATHROOM, - EAX_ENVIRONMENT_LIVINGROOM, - EAX_ENVIRONMENT_STONEROOM, - EAX_ENVIRONMENT_AUDITORIUM, - EAX_ENVIRONMENT_CONCERTHALL, - EAX_ENVIRONMENT_CAVE, - EAX_ENVIRONMENT_ARENA, - EAX_ENVIRONMENT_HANGAR, - EAX_ENVIRONMENT_CARPETEDHALLWAY, - EAX_ENVIRONMENT_HALLWAY, - EAX_ENVIRONMENT_STONECORRIDOR, - EAX_ENVIRONMENT_ALLEY, - EAX_ENVIRONMENT_FOREST, - EAX_ENVIRONMENT_CITY, - EAX_ENVIRONMENT_MOUNTAINS, - EAX_ENVIRONMENT_QUARRY, - EAX_ENVIRONMENT_PLAIN, - EAX_ENVIRONMENT_PARKINGLOT, - EAX_ENVIRONMENT_SEWERPIPE, - EAX_ENVIRONMENT_UNDERWATER, - EAX_ENVIRONMENT_DRUGGED, - EAX_ENVIRONMENT_DIZZY, - EAX_ENVIRONMENT_PSYCHOTIC, - - EAX_ENVIRONMENT_COUNT // total number of environments + EAX_ENVIRONMENT_GENERIC, + EAX_ENVIRONMENT_PADDEDCELL, + EAX_ENVIRONMENT_ROOM, + EAX_ENVIRONMENT_BATHROOM, + EAX_ENVIRONMENT_LIVINGROOM, + EAX_ENVIRONMENT_STONEROOM, + EAX_ENVIRONMENT_AUDITORIUM, + EAX_ENVIRONMENT_CONCERTHALL, + EAX_ENVIRONMENT_CAVE, + EAX_ENVIRONMENT_ARENA, + EAX_ENVIRONMENT_HANGAR, + EAX_ENVIRONMENT_CARPETEDHALLWAY, + EAX_ENVIRONMENT_HALLWAY, + EAX_ENVIRONMENT_STONECORRIDOR, + EAX_ENVIRONMENT_ALLEY, + EAX_ENVIRONMENT_FOREST, + EAX_ENVIRONMENT_CITY, + EAX_ENVIRONMENT_MOUNTAINS, + EAX_ENVIRONMENT_QUARRY, + EAX_ENVIRONMENT_PLAIN, + EAX_ENVIRONMENT_PARKINGLOT, + EAX_ENVIRONMENT_SEWERPIPE, + EAX_ENVIRONMENT_UNDERWATER, + EAX_ENVIRONMENT_DRUGGED, + EAX_ENVIRONMENT_DIZZY, + EAX_ENVIRONMENT_PSYCHOTIC, + + EAX_ENVIRONMENT_COUNT // total number of environments }; // EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx) @@ -479,9 +500,11 @@ enum { #define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE, 0.5F, 2.886F, 1.304F #define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA, 0.361F, 7.284F, 0.332F #define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR, 0.5F, 10.0F, 0.3F -#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153F, 0.259F, 2.0F +#define EAX_PRESET_CARPETEDHALLWAY \ + EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153F, 0.259F, 2.0F #define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY, 0.361F, 1.493F, 0.0F -#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR, 0.444F, 2.697F, 0.638F +#define EAX_PRESET_STONECORRIDOR \ + EAX_ENVIRONMENT_STONECORRIDOR, 0.444F, 2.697F, 0.638F #define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY, 0.25F, 1.752F, 0.776F #define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST, 0.111F, 3.145F, 0.472F #define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY, 0.111F, 2.767F, 0.224F @@ -495,14 +518,14 @@ enum { #define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY, 0.139F, 17.234F, 0.666F #define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC, 0.486F, 7.563F, 0.806F -typedef DWORD(CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user); -/* User stream callback function. NOTE: A stream function should obviously be as quick -as possible, other streams (and MOD musics) can't be mixed until it's finished. -handle : The stream that needs writing -buffer : Buffer to write the samples in -length : Number of bytes to write -user : The 'user' parameter value given when calling BASS_StreamCreate -RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */ +typedef DWORD(CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, + void *user); +/* User stream callback function. NOTE: A stream function should obviously be as +quick as possible, other streams (and MOD musics) can't be mixed until it's +finished. handle : The stream that needs writing buffer : Buffer to write the +samples in length : Number of bytes to write user : The 'user' parameter value +given when calling BASS_StreamCreate RETURN : Number of bytes written. Set the +BASS_STREAMPROC_END flag to end the stream. */ #define BASS_STREAMPROC_END 0x80000000 // end of user stream flag @@ -524,10 +547,10 @@ typedef DWORD(CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user); typedef BOOL(CALLBACK FILESEEKPROC)(QWORD offset, void *user); typedef struct { - FILECLOSEPROC *close; - FILELENPROC *length; - FILEREADPROC *read; - FILESEEKPROC *seek; + FILECLOSEPROC *close; + FILELENPROC *length; + FILEREADPROC *read; + FILESEEKPROC *seek; } BASS_FILEPROCS; // BASS_StreamPutFileData options @@ -546,7 +569,8 @@ typedef struct { #define BASS_FILEPOS_SIZE 8 #define BASS_FILEPOS_BUFFERING 9 -typedef void(CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); +typedef void(CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, + void *user); /* Internet stream download callback function. buffer : Buffer containing the downloaded data... NULL=end of download length : Number of bytes in the buffer @@ -570,7 +594,8 @@ user : The 'user' parameter value given when calling BASS_StreamCreateURL */ #define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime #define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously -typedef void(CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user); +typedef void(CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, + void *user); /* Sync callback function. NOTE: a sync callback function should be very quick as other syncs can't be processed until it has finished. If the sync is a "mixtime" sync, then other streams and MOD musics can't be mixed until @@ -580,7 +605,8 @@ channel: Channel that the sync occured in data : Additional data associated with the sync's occurance user : The 'user' parameter given when calling BASS_ChannelSetSync */ -typedef void(CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user); +typedef void(CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, + DWORD length, void *user); /* DSP callback function. NOTE: A DSP function should obviously be as quick as possible... other DSP functions, streams and MOD musics can not be processed until it's finished. @@ -590,7 +616,8 @@ buffer : Buffer to apply the DSP to length : Number of bytes in the buffer user : The 'user' parameter given when calling BASS_ChannelSetDSP */ -typedef BOOL(CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user); +typedef BOOL(CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, + DWORD length, void *user); /* Recording callback function. handle : The recording handle buffer : Buffer containing the recorded sample data @@ -644,11 +671,12 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_DATA_FFT8192 0x80000005 // 8192 FFT #define BASS_DATA_FFT16384 0x80000006 // 16384 FFT #define BASS_DATA_FFT32768 0x80000007 // 32768 FFT -#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined -#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window -#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias -#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data -#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value +#define BASS_DATA_FFT_INDIVIDUAL \ + 0x10 // FFT flag: FFT for each channel, else all combined +#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window +#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias +#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data +#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value // BASS_ChannelGetLevelEx flags #define BASS_LEVEL_MONO 1 @@ -657,52 +685,59 @@ RETURN : TRUE = continue recording, FALSE = stop */ #define BASS_LEVEL_VOLPAN 8 // BASS_ChannelGetTags types : what's returned -#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure -#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block -#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings -#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings -#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings -#define BASS_TAG_META 5 // ICY metadata : ANSI string -#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings -#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings -#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings -#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string -#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string -#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure -#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings -#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure -#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string -#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string -#define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings -#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure -#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure -#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string -#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure -#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure -#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure +#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure +#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block +#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings +#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings +#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings +#define BASS_TAG_META 5 // ICY metadata : ANSI string +#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings +#define BASS_TAG_MP4 \ + 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings +#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings +#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string +#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string +#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure +#define BASS_TAG_MF \ + 13 // Media Foundation tags : series of null-terminated UTF-8 strings +#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure +#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string +#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string +#define BASS_TAG_RIFF_INFO \ + 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings +#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure +#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure +#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string +#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure +#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure +#define BASS_TAG_APE_BINARY \ + 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure #define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string #define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string -#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers -#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string -#define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string -#define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string +#define BASS_TAG_MUSIC_ORDERS \ + 0x10002 // MOD order list : BYTE array of pattern numbers +#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string +#define BASS_TAG_MUSIC_INST \ + 0x10100 // + instrument #, MOD instrument name : ANSI string +#define BASS_TAG_MUSIC_SAMPLE \ + 0x10300 // + sample #, MOD sample name : ANSI string // ID3v1 tag structure typedef struct { - char id[3]; - char title[30]; - char artist[30]; - char album[30]; - char year[4]; - char comment[30]; - BYTE genre; + char id[3]; + char title[30]; + char artist[30]; + char album[30]; + char year[4]; + char comment[30]; + BYTE genre; } TAG_ID3; // Binary APE tag structure typedef struct { - const char *key; - const void *data; - DWORD length; + const char *key; + const void *data; + DWORD length; } TAG_APE_BINARY; // BWF "bext" tag structure @@ -712,113 +747,107 @@ typedef struct { #endif #pragma pack(push, 1) typedef struct { - char Description[256]; // description - char Originator[32]; // name of the originator - char OriginatorReference[32]; // reference of the originator - char OriginationDate[10]; // date of creation (yyyy-mm-dd) - char OriginationTime[8]; // time of creation (hh-mm-ss) - QWORD TimeReference; // first sample count since midnight (little-endian) - WORD Version; // BWF version (little-endian) - BYTE UMID[64]; // SMPTE UMID - BYTE Reserved[190]; + char Description[256]; // description + char Originator[32]; // name of the originator + char OriginatorReference[32]; // reference of the originator + char OriginationDate[10]; // date of creation (yyyy-mm-dd) + char OriginationTime[8]; // time of creation (hh-mm-ss) + QWORD TimeReference; // first sample count since midnight (little-endian) + WORD Version; // BWF version (little-endian) + BYTE UMID[64]; // SMPTE UMID + BYTE Reserved[190]; #if defined(__GNUC__) && __GNUC__ < 3 - char CodingHistory[0]; // history -#elif 1 // change to 0 if compiler fails the following line - char CodingHistory[]; // history + char CodingHistory[0]; // history +#elif 1 // change to 0 if compiler fails the following line + char CodingHistory[]; // history #else - char CodingHistory[1]; // history + char CodingHistory[1]; // history #endif } TAG_BEXT; #pragma pack(pop) // BWF "cart" tag structures -typedef struct -{ - DWORD dwUsage; // FOURCC timer usage ID - DWORD dwValue; // timer value in samples from head +typedef struct { + DWORD dwUsage; // FOURCC timer usage ID + DWORD dwValue; // timer value in samples from head } TAG_CART_TIMER; -typedef struct -{ - char Version[4]; // version of the data structure - char Title[64]; // title of cart audio sequence - char Artist[64]; // artist or creator name - char CutID[64]; // cut number identification - char ClientID[64]; // client identification - char Category[64]; // category ID, PSA, NEWS, etc - char Classification[64]; // classification or auxiliary key - char OutCue[64]; // out cue text - char StartDate[10]; // yyyy-mm-dd - char StartTime[8]; // hh:mm:ss - char EndDate[10]; // yyyy-mm-dd - char EndTime[8]; // hh:mm:ss - char ProducerAppID[64]; // name of vendor or application - char ProducerAppVersion[64]; // version of producer application - char UserDef[64]; // user defined text - DWORD dwLevelReference; // sample value for 0 dB reference - TAG_CART_TIMER PostTimer[8]; // 8 time markers after head - char Reserved[276]; - char URL[1024]; // uniform resource locator +typedef struct { + char Version[4]; // version of the data structure + char Title[64]; // title of cart audio sequence + char Artist[64]; // artist or creator name + char CutID[64]; // cut number identification + char ClientID[64]; // client identification + char Category[64]; // category ID, PSA, NEWS, etc + char Classification[64]; // classification or auxiliary key + char OutCue[64]; // out cue text + char StartDate[10]; // yyyy-mm-dd + char StartTime[8]; // hh:mm:ss + char EndDate[10]; // yyyy-mm-dd + char EndTime[8]; // hh:mm:ss + char ProducerAppID[64]; // name of vendor or application + char ProducerAppVersion[64]; // version of producer application + char UserDef[64]; // user defined text + DWORD dwLevelReference; // sample value for 0 dB reference + TAG_CART_TIMER PostTimer[8]; // 8 time markers after head + char Reserved[276]; + char URL[1024]; // uniform resource locator #if defined(__GNUC__) && __GNUC__ < 3 - char TagText[0]; // free form text for scripts or tags -#elif 1 // change to 0 if compiler fails the following line - char TagText[]; // free form text for scripts or tags + char TagText[0]; // free form text for scripts or tags +#elif 1 // change to 0 if compiler fails the following line + char TagText[]; // free form text for scripts or tags #else - char TagText[1]; // free form text for scripts or tags + char TagText[1]; // free form text for scripts or tags #endif } TAG_CART; // RIFF "cue " tag structures -typedef struct -{ - DWORD dwName; - DWORD dwPosition; - DWORD fccChunk; - DWORD dwChunkStart; - DWORD dwBlockStart; - DWORD dwSampleOffset; +typedef struct { + DWORD dwName; + DWORD dwPosition; + DWORD fccChunk; + DWORD dwChunkStart; + DWORD dwBlockStart; + DWORD dwSampleOffset; } TAG_CUE_POINT; -typedef struct -{ - DWORD dwCuePoints; +typedef struct { + DWORD dwCuePoints; #if defined(__GNUC__) && __GNUC__ < 3 - TAG_CUE_POINT CuePoints[0]; + TAG_CUE_POINT CuePoints[0]; #elif 1 // change to 0 if compiler fails the following line - TAG_CUE_POINT CuePoints[]; + TAG_CUE_POINT CuePoints[]; #else - TAG_CUE_POINT CuePoints[1]; + TAG_CUE_POINT CuePoints[1]; #endif } TAG_CUE; // RIFF "smpl" tag structures -typedef struct -{ - DWORD dwIdentifier; - DWORD dwType; - DWORD dwStart; - DWORD dwEnd; - DWORD dwFraction; - DWORD dwPlayCount; +typedef struct { + DWORD dwIdentifier; + DWORD dwType; + DWORD dwStart; + DWORD dwEnd; + DWORD dwFraction; + DWORD dwPlayCount; } TAG_SMPL_LOOP; -typedef struct -{ - DWORD dwManufacturer; - DWORD dwProduct; - DWORD dwSamplePeriod; - DWORD dwMIDIUnityNote; - DWORD dwMIDIPitchFraction; - DWORD dwSMPTEFormat; - DWORD dwSMPTEOffset; - DWORD cSampleLoops; - DWORD cbSamplerData; +typedef struct { + DWORD dwManufacturer; + DWORD dwProduct; + DWORD dwSamplePeriod; + DWORD dwMIDIUnityNote; + DWORD dwMIDIPitchFraction; + DWORD dwSMPTEFormat; + DWORD dwSMPTEOffset; + DWORD cSampleLoops; + DWORD cbSamplerData; #if defined(__GNUC__) && __GNUC__ < 3 - TAG_SMPL_LOOP SampleLoops[0]; + TAG_SMPL_LOOP SampleLoops[0]; #elif 1 // change to 0 if compiler fails the following line - TAG_SMPL_LOOP SampleLoops[]; + TAG_SMPL_LOOP SampleLoops[]; #else - TAG_SMPL_LOOP SampleLoops[1]; + TAG_SMPL_LOOP SampleLoops[1]; #endif } TAG_SMPL; #ifdef _MSC_VER @@ -827,37 +856,40 @@ typedef struct // CoreAudio codec info structure typedef struct { - DWORD ftype; // file format - DWORD atype; // audio format - const char *name; // description + DWORD ftype; // file format + DWORD atype; // audio format + const char *name; // description } TAG_CA_CODEC; #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ #pragma pack(push, 1) typedef struct tWAVEFORMATEX { - WORD wFormatTag; - WORD nChannels; - DWORD nSamplesPerSec; - DWORD nAvgBytesPerSec; - WORD nBlockAlign; - WORD wBitsPerSample; - WORD cbSize; + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; } WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; typedef const WAVEFORMATEX *LPCWAVEFORMATEX; #pragma pack(pop) #endif // BASS_ChannelGetLength/GetPosition/SetPosition modes -#define BASS_POS_BYTE 0 // byte position -#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) -#define BASS_POS_OGG 3 // OGG bitstream number -#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers -#define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position -#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position -#define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position -#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking -#define BASS_POS_SCAN 0x40000000 // flag: scan to the position +#define BASS_POS_BYTE 0 // byte position +#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) +#define BASS_POS_OGG 3 // OGG bitstream number +#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers +#define BASS_POS_RELATIVE \ + 0x4000000 // flag: seek relative to the current position +#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position +#define BASS_POS_DECODE \ + 0x10000000 // flag: get the decoding (not playing) position +#define BASS_POS_DECODETO \ + 0x20000000 // flag: decode to the position instead of seeking +#define BASS_POS_SCAN 0x40000000 // flag: scan to the position // BASS_ChannelSetDevice/GetDevice option #define BASS_NODEVICE 0x20000 @@ -892,81 +924,81 @@ typedef const WAVEFORMATEX *LPCWAVEFORMATEX; #define BASS_FX_VOLUME 9 typedef struct { - float fWetDryMix; - float fDepth; - float fFeedback; - float fFrequency; - DWORD lWaveform; // 0=triangle, 1=sine - float fDelay; - DWORD lPhase; // BASS_DX8_PHASE_xxx + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx } BASS_DX8_CHORUS; typedef struct { - float fGain; - float fAttack; - float fRelease; - float fThreshold; - float fRatio; - float fPredelay; + float fGain; + float fAttack; + float fRelease; + float fThreshold; + float fRatio; + float fPredelay; } BASS_DX8_COMPRESSOR; typedef struct { - float fGain; - float fEdge; - float fPostEQCenterFrequency; - float fPostEQBandwidth; - float fPreLowpassCutoff; + float fGain; + float fEdge; + float fPostEQCenterFrequency; + float fPostEQBandwidth; + float fPreLowpassCutoff; } BASS_DX8_DISTORTION; typedef struct { - float fWetDryMix; - float fFeedback; - float fLeftDelay; - float fRightDelay; - BOOL lPanDelay; + float fWetDryMix; + float fFeedback; + float fLeftDelay; + float fRightDelay; + BOOL lPanDelay; } BASS_DX8_ECHO; typedef struct { - float fWetDryMix; - float fDepth; - float fFeedback; - float fFrequency; - DWORD lWaveform; // 0=triangle, 1=sine - float fDelay; - DWORD lPhase; // BASS_DX8_PHASE_xxx + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx } BASS_DX8_FLANGER; typedef struct { - DWORD dwRateHz; // Rate of modulation in hz - DWORD dwWaveShape; // 0=triangle, 1=square + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // 0=triangle, 1=square } BASS_DX8_GARGLE; typedef struct { - int lRoom; // [-10000, 0] default: -1000 mB - int lRoomHF; // [-10000, 0] default: 0 mB - float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 - float flDecayTime; // [0.1, 20.0] default: 1.49s - float flDecayHFRatio; // [0.1, 2.0] default: 0.83 - int lReflections; // [-10000, 1000] default: -2602 mB - float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s - int lReverb; // [-10000, 2000] default: 200 mB - float flReverbDelay; // [0.0, 0.1] default: 0.011 s - float flDiffusion; // [0.0, 100.0] default: 100.0 % - float flDensity; // [0.0, 100.0] default: 100.0 % - float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz + int lRoom; // [-10000, 0] default: -1000 mB + int lRoomHF; // [-10000, 0] default: 0 mB + float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + float flDecayTime; // [0.1, 20.0] default: 1.49s + float flDecayHFRatio; // [0.1, 2.0] default: 0.83 + int lReflections; // [-10000, 1000] default: -2602 mB + float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + int lReverb; // [-10000, 2000] default: 200 mB + float flReverbDelay; // [0.0, 0.1] default: 0.011 s + float flDiffusion; // [0.0, 100.0] default: 100.0 % + float flDensity; // [0.0, 100.0] default: 100.0 % + float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz } BASS_DX8_I3DL2REVERB; typedef struct { - float fCenter; - float fBandwidth; - float fGain; + float fCenter; + float fBandwidth; + float fGain; } BASS_DX8_PARAMEQ; typedef struct { - float fInGain; // [-96.0,0.0] default: 0.0 dB - float fReverbMix; // [-96.0,0.0] default: 0.0 db - float fReverbTime; // [0.001,3000.0] default: 1000.0 ms - float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 + float fInGain; // [-96.0,0.0] default: 0.0 dB + float fReverbMix; // [-96.0,0.0] default: 0.0 db + float fReverbTime; // [0.001,3000.0] default: 1000.0 ms + float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 } BASS_DX8_REVERB; #define BASS_DX8_PHASE_NEG_180 0 @@ -976,10 +1008,10 @@ typedef struct { #define BASS_DX8_PHASE_180 4 typedef struct { - float fTarget; - float fCurrent; - float fTime; - DWORD lCurve; + float fTarget; + float fCurrent; + float fTime; + DWORD lCurve; } BASS_FX_VOLUME_PARAM; typedef void(CALLBACK IOSNOTIFYPROC)(DWORD status); @@ -996,15 +1028,19 @@ void *BASSDEF(BASS_GetConfigPtr)(DWORD option); DWORD BASSDEF(BASS_GetVersion)(); int BASSDEF(BASS_ErrorGetCode)(); BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) -BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid); +#if defined(_WIN32) && !defined(_WIN32_WCE) && \ + !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, + const GUID *dsguid); #else -BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid); +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, + void *dsguid); #endif BOOL BASSDEF(BASS_SetDevice)(DWORD device); DWORD BASSDEF(BASS_GetDevice)(); BOOL BASSDEF(BASS_Free)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) +#if defined(_WIN32) && !defined(_WIN32_WCE) && \ + !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) void *BASSDEF(BASS_GetDSoundObject)(DWORD object); #endif BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); @@ -1023,19 +1059,29 @@ const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle); BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf); BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); -BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top); -BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top); +BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, + const BASS_3DVECTOR *vel, + const BASS_3DVECTOR *front, + const BASS_3DVECTOR *top); +BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, + BASS_3DVECTOR *front, BASS_3DVECTOR *top); void BASSDEF(BASS_Apply3D)(); -#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) -BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp); -BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp); +#if defined(_WIN32) && !defined(_WIN32_WCE) && \ + !(WINAPI_FAMILY && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, + float damp); +BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, + float *damp); #endif -HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq); +HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, + DWORD length, DWORD flags, DWORD freq); BOOL BASSDEF(BASS_MusicFree)(HMUSIC handle); -HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags); -HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags); +HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, + DWORD length, DWORD max, DWORD flags); +HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, + DWORD max, DWORD flags); BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle); BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer); BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer); @@ -1045,14 +1091,22 @@ HCHANNEL BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, BOOL onlynew); DWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels); BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle); -HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user); -HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); -HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); -HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, + STREAMPROC *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, + QWORD length, DWORD flags); +HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, + DWORD flags, DOWNLOADPROC *proc, + void *user); +HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, + const BASS_FILEPROCS *proc, + void *user); BOOL BASSDEF(BASS_StreamFree)(HSTREAM handle); QWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode); -DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length); -DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length); +DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, + DWORD length); +DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, + DWORD length); BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); BOOL BASSDEF(BASS_RecordInit)(int device); @@ -1063,7 +1117,8 @@ BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info); const char *BASSDEF(BASS_RecordGetInputName)(int input); BOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume); DWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume); -HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user); +HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, + RECORDPROC *proc, void *user); double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos); QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos); @@ -1079,24 +1134,39 @@ BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart); BOOL BASSDEF(BASS_ChannelStop)(DWORD handle); BOOL BASSDEF(BASS_ChannelPause)(DWORD handle); BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value); -BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value); -BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time); +BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, + float *value); +BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, + float value, DWORD time); BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib); -BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); -DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); -BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol); -BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol); -BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel); -BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel); +BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, + void *value, DWORD size); +DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, + void *value, DWORD size); +BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, + float max, int iangle, int oangle, + float outvol); +BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, + float *max, DWORD *iangle, + DWORD *oangle, float *outvol); +BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, + const BASS_3DVECTOR *orient, + const BASS_3DVECTOR *vel); +BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, + BASS_3DVECTOR *orient, + BASS_3DVECTOR *vel); QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode); BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode); QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode); DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle); -BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); +BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, + DWORD flags); DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length); -HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user); +HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, + SYNCPROC *proc, void *user); BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync); -HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority); +HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, + int priority); BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp); BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan); BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan); @@ -1114,32 +1184,42 @@ BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); #if defined(_WIN32) && !defined(NOBASSOVERLOADS) static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) { - return BASS_PluginLoad((const char *)file, flags | BASS_UNICODE); + return BASS_PluginLoad((const char *)file, flags | BASS_UNICODE); } -static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, + DWORD length, DWORD flags, DWORD freq) { - return BASS_MusicLoad(mem, (const void *)file, offset, length, flags | BASS_UNICODE, freq); + return BASS_MusicLoad(mem, (const void *)file, offset, length, + flags | BASS_UNICODE, freq); } -static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, + DWORD length, DWORD max, DWORD flags) { - return BASS_SampleLoad(mem, (const void *)file, offset, length, max, flags | BASS_UNICODE); + return BASS_SampleLoad(mem, (const void *)file, offset, length, max, + flags | BASS_UNICODE); } -static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, + QWORD offset, QWORD length, + DWORD flags) { - return BASS_StreamCreateFile(mem, (const void *)file, offset, length, flags | BASS_UNICODE); + return BASS_StreamCreateFile(mem, (const void *)file, offset, length, + flags | BASS_UNICODE); } -static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, + DWORD flags, DOWNLOADPROC *proc, + void *user) { - return BASS_StreamCreateURL((const char *)url, offset, flags | BASS_UNICODE, proc, user); + return BASS_StreamCreateURL((const char *)url, offset, flags | BASS_UNICODE, + proc, user); } static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value) { - return BASS_SetConfigPtr(option | BASS_UNICODE, (const void *)value); + return BASS_SetConfigPtr(option | BASS_UNICODE, (const void *)value); } #endif #endif diff --git a/include/bassopus.h b/include/bassopus.h index 757ff70c..3d8b131d 100644 --- a/include/bassopus.h +++ b/include/bassopus.h @@ -1,8 +1,8 @@ /* - BASSOPUS 2.4 C/C++ header file - Copyright (c) 2012-2015 Un4seen Developments Ltd. + BASSOPUS 2.4 C/C++ header file + Copyright (c) 2012-2015 Un4seen Developments Ltd. - See the BASSOPUS.CHM file for more detailed documentation + See the BASSOPUS.CHM file for more detailed documentation */ #ifndef BASSOPUS_H @@ -29,22 +29,34 @@ extern "C" { #define BASS_ATTRIB_OPUS_ORIGFREQ 0x13000 #define BASS_ATTRIB_OPUS_GAIN 0x13001 -HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); -HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); -HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user); +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFile)(BOOL mem, const void *file, + QWORD offset, QWORD length, + DWORD flags); +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateURL)(const char *url, DWORD offset, + DWORD flags, DOWNLOADPROC *proc, + void *user); +HSTREAM BASSOPUSDEF(BASS_OPUS_StreamCreateFileUser)(DWORD system, DWORD flags, + const BASS_FILEPROCS *procs, + void *user); #ifdef __cplusplus } #if defined(_WIN32) && !defined(NOBASSOVERLOADS) -static inline HSTREAM BASS_OPUS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +static inline HSTREAM BASS_OPUS_StreamCreateFile(BOOL mem, const WCHAR *file, + QWORD offset, QWORD length, + DWORD flags) { - return BASS_OPUS_StreamCreateFile(mem, (const void *)file, offset, length, flags | BASS_UNICODE); + return BASS_OPUS_StreamCreateFile(mem, (const void *)file, offset, length, + flags | BASS_UNICODE); } -static inline HSTREAM BASS_OPUS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +static inline HSTREAM BASS_OPUS_StreamCreateURL(const WCHAR *url, DWORD offset, + DWORD flags, DOWNLOADPROC *proc, + void *user) { - return BASS_OPUS_StreamCreateURL((const char *)url, offset, flags | BASS_UNICODE, proc, user); + return BASS_OPUS_StreamCreateURL((const char *)url, offset, + flags | BASS_UNICODE, proc, user); } #endif #endif diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h index c2d32b24..e6f77c74 100644 --- a/include/chatlogpiece.h +++ b/include/chatlogpiece.h @@ -6,25 +6,27 @@ class chatlogpiece { public: - chatlogpiece(); - chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song); - chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song, QDateTime p_datetime); + chatlogpiece(); + chatlogpiece(QString p_name, QString p_showname, QString p_message, + bool p_song); + chatlogpiece(QString p_name, QString p_showname, QString p_message, + bool p_song, QDateTime p_datetime); - QString get_name(); - QString get_showname(); - QString get_message(); - bool is_song(); - QDateTime get_datetime(); - QString get_datetime_as_string(); + QString get_name(); + QString get_showname(); + QString get_message(); + bool is_song(); + QDateTime get_datetime(); + QString get_datetime_as_string(); - QString get_full(); + QString get_full(); private: - QString name; - QString showname; - QString message; - QDateTime datetime; - bool p_is_song; + QString name; + QString showname; + QString message; + QDateTime datetime; + bool p_is_song; }; #endif // CHATLOGPIECE_H diff --git a/include/courtroom.h b/include/courtroom.h index c3c6b87e..259a7ed5 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -63,723 +63,743 @@ class AOApplication; class Courtroom : public QMainWindow { - Q_OBJECT + Q_OBJECT public: - explicit Courtroom(AOApplication *p_ao_app); - - void append_char(char_type p_char) { char_list.append(p_char); } - void append_evidence(evi_type p_evi) { evidence_list.append(p_evi); } - void append_music(QString f_music) { music_list.append(f_music); } - void append_area(QString f_area) { area_list.append(f_area); } - void clear_music() { music_list.clear(); } - void clear_areas() { area_list.clear(); } - - void fix_last_area() - { - if (area_list.size() > 0) { - QString malplaced = area_list.last(); - area_list.removeLast(); - append_music(malplaced); - } + explicit Courtroom(AOApplication *p_ao_app); + + void append_char(char_type p_char) { char_list.append(p_char); } + void append_evidence(evi_type p_evi) { evidence_list.append(p_evi); } + void append_music(QString f_music) { music_list.append(f_music); } + void append_area(QString f_area) { area_list.append(f_area); } + void clear_music() { music_list.clear(); } + void clear_areas() { area_list.clear(); } + + void fix_last_area() + { + if (area_list.size() > 0) { + QString malplaced = area_list.last(); + area_list.removeLast(); + append_music(malplaced); } - - void arup_append(int players, QString status, QString cm, QString locked) - { - arup_players.append(players); - arup_statuses.append(status); - arup_cms.append(cm); - arup_locks.append(locked); + } + + void arup_append(int players, QString status, QString cm, QString locked) + { + arup_players.append(players); + arup_statuses.append(status); + arup_cms.append(cm); + arup_locks.append(locked); + } + + void arup_modify(int type, int place, QString value) + { + if (type == 0) { + if (arup_players.size() > place) + arup_players[place] = value.toInt(); } - - void arup_modify(int type, int place, QString value) - { - if (type == 0) { - if (arup_players.size() > place) - arup_players[place] = value.toInt(); - } - else if (type == 1) { - if (arup_statuses.size() > place) - arup_statuses[place] = value; - } - else if (type == 2) { - if (arup_cms.size() > place) - arup_cms[place] = value; - } - else if (type == 3) { - if (arup_locks.size() > place) - arup_locks[place] = value; - } - list_areas(); + else if (type == 1) { + if (arup_statuses.size() > place) + arup_statuses[place] = value; + } + else if (type == 2) { + if (arup_cms.size() > place) + arup_cms[place] = value; } + else if (type == 3) { + if (arup_locks.size() > place) + arup_locks[place] = value; + } + list_areas(); + } - void character_loading_finished(); + void character_loading_finished(); - //sets position of widgets based on theme ini files - void set_widgets(); + // sets position of widgets based on theme ini files + void set_widgets(); - //sets font size based on theme ini files - void set_font(QWidget *widget, QString class_name, QString p_identifier); + // sets font size based on theme ini files + void set_font(QWidget *widget, QString class_name, QString p_identifier); - //Get the properly constructed font - QFont get_qfont(QString font_name, int f_pointsize, bool antialias = true); + // Get the properly constructed font + QFont get_qfont(QString font_name, int f_pointsize, bool antialias = true); - //actual operation of setting the font on a widget - void set_qfont(QWidget *widget, QString class_name, QFont font, QColor f_color = Qt::black, bool bold = false); + // actual operation of setting the font on a widget + void set_qfont(QWidget *widget, QString class_name, QFont font, + QColor f_color = Qt::black, bool bold = false); - //helper function that calls above function on the relevant widgets - void set_fonts(); + // helper function that calls above function on the relevant widgets + void set_fonts(); - //sets dropdown menu stylesheet - void set_dropdown(QWidget *widget); + // sets dropdown menu stylesheet + void set_dropdown(QWidget *widget); - //helper funciton that call above function on the relevant widgets - void set_dropdowns(); + // helper funciton that call above function on the relevant widgets + void set_dropdowns(); - void set_window_title(QString p_title); + void set_window_title(QString p_title); - //reads theme inis and sets size and pos based on the identifier - void set_size_and_pos(QWidget *p_widget, QString p_identifier); + // reads theme inis and sets size and pos based on the identifier + void set_size_and_pos(QWidget *p_widget, QString p_identifier); - //reads theme inis and returns the size and pos as defined by it - QPoint get_theme_pos(QString p_identifier); + // reads theme inis and returns the size and pos as defined by it + QPoint get_theme_pos(QString p_identifier); - //sets status as taken on character with cid n_char and places proper shading on charselect - void set_taken(int n_char, bool p_taken); + // sets status as taken on character with cid n_char and places proper shading + // on charselect + void set_taken(int n_char, bool p_taken); - //sets the current background to argument. also does some checks to see if it's a legacy bg - void set_background(QString p_background, bool display = false); + // sets the current background to argument. also does some checks to see if + // it's a legacy bg + void set_background(QString p_background, bool display = false); - //sets the local character pos/side to use. - void set_side(QString p_side); + // sets the local character pos/side to use. + void set_side(QString p_side); - //sets the pos dropdown - void set_pos_dropdown(QStringList pos_dropdowns); + // sets the pos dropdown + void set_pos_dropdown(QStringList pos_dropdowns); - //sets the evidence list member variable to argument - void set_evidence_list(QVector &p_evi_list); + // sets the evidence list member variable to argument + void set_evidence_list(QVector &p_evi_list); - //called when a DONE#% from the server was received - void done_received(); + // called when a DONE#% from the server was received + void done_received(); - //sets the local mute list based on characters available on the server - void set_mute_list(); + // sets the local mute list based on characters available on the server + void set_mute_list(); - // Sets the local pair list based on the characters available on the server. - void set_pair_list(); + // Sets the local pair list based on the characters available on the server. + void set_pair_list(); - //sets desk and bg based on pos in chatmessage - void set_scene(QString f_desk_mod, QString f_side); + // sets desk and bg based on pos in chatmessage + void set_scene(QString f_desk_mod, QString f_side); - //takes in serverD-formatted IP list as prints a converted version to server OOC - //admittedly poorly named - void set_ip_list(QString p_list); + // takes in serverD-formatted IP list as prints a converted version to server + // OOC admittedly poorly named + void set_ip_list(QString p_list); - //disables chat if current cid matches second argument - //enables if p_muted is false - void set_mute(bool p_muted, int p_cid); + // disables chat if current cid matches second argument + // enables if p_muted is false + void set_mute(bool p_muted, int p_cid); - //send a message that the player is banned and quits the server - void set_ban(int p_cid); + // send a message that the player is banned and quits the server + void set_ban(int p_cid); - //cid = character id, returns the cid of the currently selected character - int get_cid() { return m_cid; } - QString get_current_char() { return current_char; } - QString get_current_background() { return current_background; } + // cid = character id, returns the cid of the currently selected character + int get_cid() { return m_cid; } + QString get_current_char() { return current_char; } + QString get_current_background() { return current_background; } - //updates character to p_cid and updates necessary ui elements - void update_character(int p_cid); + // updates character to p_cid and updates necessary ui elements + void update_character(int p_cid); - //properly sets up some varibles: resets user state - void enter_courtroom(); + // properly sets up some varibles: resets user state + void enter_courtroom(); - //helper function that populates ui_music_list with the contents of music_list - void list_music(); - void list_areas(); + // helper function that populates ui_music_list with the contents of + // music_list + void list_music(); + void list_areas(); - //these are for OOC chat - void append_ms_chatmessage(QString f_name, QString f_message); - void append_server_chatmessage(QString p_name, QString p_message, QString p_color); + // these are for OOC chat + void append_ms_chatmessage(QString f_name, QString f_message); + void append_server_chatmessage(QString p_name, QString p_message, + QString p_color); - //these functions handle chatmessages sequentially. - //The process itself is very convoluted and merits separate documentation - //But the general idea is objection animation->pre animation->talking->idle - void handle_chatmessage(QStringList *p_contents); - void handle_chatmessage_2(); - void handle_chatmessage_3(); + // these functions handle chatmessages sequentially. + // The process itself is very convoluted and merits separate documentation + // But the general idea is objection animation->pre animation->talking->idle + void handle_chatmessage(QStringList *p_contents); + void handle_chatmessage_2(); + void handle_chatmessage_3(); - //This function filters out the common CC inline text trickery, for appending to - //the IC chatlog. - QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); + // This function filters out the common CC inline text trickery, for appending + // to the IC chatlog. + QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, + int default_color = 0); - //adds text to the IC chatlog. p_name first as bold then p_text then a newlin - //this function keeps the chatlog scrolled to the top unless there's text selected - // or the user isn't already scrolled to the top - void append_ic_text(QString p_text, QString p_name = "", QString action = ""); + // adds text to the IC chatlog. p_name first as bold then p_text then a newlin + // this function keeps the chatlog scrolled to the top unless there's text + // selected + // or the user isn't already scrolled to the top + void append_ic_text(QString p_text, QString p_name = "", QString action = ""); - //prints who played the song to IC chat and plays said song(if found on local filesystem) - //takes in a list where the first element is the song name and the second is the char id of who played it - void handle_song(QStringList *p_contents); + // prints who played the song to IC chat and plays said song(if found on local + // filesystem) takes in a list where the first element is the song name and the + // second is the char id of who played it + void handle_song(QStringList *p_contents); - void play_preanim(bool noninterrupting); + void play_preanim(bool noninterrupting); - //plays the witness testimony or cross examination animation based on argument - void handle_wtce(QString p_wtce, int variant); + // plays the witness testimony or cross examination animation based on + // argument + void handle_wtce(QString p_wtce, int variant); - //sets the hp bar of defense(p_bar 1) or pro(p_bar 2) - //state is an number between 0 and 10 inclusive - void set_hp_bar(int p_bar, int p_state); + // sets the hp bar of defense(p_bar 1) or pro(p_bar 2) + // state is an number between 0 and 10 inclusive + void set_hp_bar(int p_bar, int p_state); - //Toggles the judge buttons, whether they should appear or not. - void toggle_judge_buttons(bool is_on); + // Toggles the judge buttons, whether they should appear or not. + void toggle_judge_buttons(bool is_on); - void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, + bool steno); - void check_connection_received(); + void check_connection_received(); - ~Courtroom(); + ~Courtroom(); private: - AOApplication *ao_app; - - int m_courtroom_width = 714; - int m_courtroom_height = 668; - - int m_viewport_x = 0; - int m_viewport_y = 0; + AOApplication *ao_app; - int m_viewport_width = 256; - int m_viewport_height = 192; + int m_courtroom_width = 714; + int m_courtroom_height = 668; - bool first_message_sent = false; - int maximumMessages = 0; + int m_viewport_x = 0; + int m_viewport_y = 0; - QParallelAnimationGroup *screenshake_animation_group = new QParallelAnimationGroup; + int m_viewport_width = 256; + int m_viewport_height = 192; - bool next_character_is_not_special = false; // If true, write the - // next character as it is. + bool first_message_sent = false; + int maximumMessages = 0; - bool message_is_centered = false; + QParallelAnimationGroup *screenshake_animation_group = + new QParallelAnimationGroup; - int current_display_speed = 3; - int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; + bool next_character_is_not_special = false; // If true, write the + // next character as it is. - // The character ID of the character this user wants to appear alongside with. - int other_charid = -1; + bool message_is_centered = false; - // The offset this user has given if they want to appear alongside someone. - int char_offset = 0; + int current_display_speed = 3; + int message_display_speed[7] = {0, 10, 25, 40, 50, 70, 90}; - // 0 = in front, 1 = behind - int pair_order = 0; + // The character ID of the character this user wants to appear alongside with. + int other_charid = -1; - QVector char_list; - QVector evidence_list; - QVector music_list; - QVector area_list; + // The offset this user has given if they want to appear alongside someone. + int char_offset = 0; - QVector arup_players; - QVector arup_statuses; - QVector arup_cms; - QVector arup_locks; + // 0 = in front, 1 = behind + int pair_order = 0; - QVector ic_chatlog_history; + QVector char_list; + QVector evidence_list; + QVector music_list; + QVector area_list; - //triggers ping_server() every 60 seconds - QTimer *keepalive_timer; + QVector arup_players; + QVector arup_statuses; + QVector arup_cms; + QVector arup_locks; - //determines how fast messages tick onto screen - QTimer *chat_tick_timer; - //int chat_tick_interval = 60; - //which tick position(character in chat message) we are at - int tick_pos = 0; - //the actual document tick pos we gotta worry about for making the text scroll better - int real_tick_pos = 0; - //used to determine how often blips sound - int blip_ticker = 0; - int blip_rate = 1; - int rainbow_counter = 0; - bool rainbow_appended = false; - bool blank_blip = false; + QVector ic_chatlog_history; - //Whether or not is this message additive to the previous one - bool is_additive = false; + // triggers ping_server() every 60 seconds + QTimer *keepalive_timer; - // Used for getting the current maximum blocks allowed in the IC chatlog. - int log_maximum_blocks = 0; + // determines how fast messages tick onto screen + QTimer *chat_tick_timer; + // int chat_tick_interval = 60; + // which tick position(character in chat message) we are at + int tick_pos = 0; + // the actual document tick pos we gotta worry about for making the text + // scroll better + int real_tick_pos = 0; + // used to determine how often blips sound + int blip_ticker = 0; + int blip_rate = 1; + int rainbow_counter = 0; + bool rainbow_appended = false; + bool blank_blip = false; - // True, if the log should go downwards. - bool log_goes_downwards = false; + // Whether or not is this message additive to the previous one + bool is_additive = false; - //delay before chat messages starts ticking - QTimer *text_delay_timer; + // Used for getting the current maximum blocks allowed in the IC chatlog. + int log_maximum_blocks = 0; - //delay before sfx plays - QTimer *sfx_delay_timer; + // True, if the log should go downwards. + bool log_goes_downwards = false; - //every time point in char.inis times this equals the final time - const int time_mod = 40; + // delay before chat messages starts ticking + QTimer *text_delay_timer; - //the amount of time non-animated objection/hold it/takethat images stay onscreen for in ms - const int shout_stay_time = 724; + // delay before sfx plays + QTimer *sfx_delay_timer; - //the amount of time non-animated guilty/not guilty images stay onscreen for in ms - const int verdict_stay_time = 3000; + // every time point in char.inis times this equals the final time + const int time_mod = 40; - //the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms - const int wtce_stay_time = 1500; + // the amount of time non-animated objection/hold it/takethat images stay + // onscreen for in ms + const int shout_stay_time = 724; - //characters we consider punctuation - const QString punctuation_chars = ".,?!:;"; + // the amount of time non-animated guilty/not guilty images stay onscreen for + // in ms + const int verdict_stay_time = 3000; - //amount by which we multiply the delay when we parse punctuation chars - const int punctuation_modifier = 3; + // the amount of time non-animated witness testimony/cross-examination images + // stay onscreen for in ms + const int wtce_stay_time = 1500; - static const int chatmessage_size = 30; - QString m_chatmessage[chatmessage_size]; - bool chatmessage_is_empty = false; + // characters we consider punctuation + const QString punctuation_chars = ".,?!:;"; - QString previous_ic_message = ""; - QString additive_previous = ""; + // amount by which we multiply the delay when we parse punctuation chars + const int punctuation_modifier = 3; - //char id, muted or not - QMap mute_map; + static const int chatmessage_size = 30; + QString m_chatmessage[chatmessage_size]; + bool chatmessage_is_empty = false; - //QVector muted_cids; + QString previous_ic_message = ""; + QString additive_previous = ""; - bool is_muted = false; + // char id, muted or not + QMap mute_map; - //state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = noniterrupting preanim - int anim_state = 3; + // QVector muted_cids; - //whether or not current color is a talking one - bool color_is_talking = true; + bool is_muted = false; - //state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done - int text_state = 2; + // state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = + // noniterrupting preanim + int anim_state = 3; - //character id, which index of the char_list the player is - int m_cid = -1; - //cid and this may differ in cases of ini-editing - QString current_char = ""; + // whether or not current color is a talking one + bool color_is_talking = true; - int objection_state = 0; - int realization_state = 0; - int screenshake_state = 0; - int text_color = 0; + // state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = + // ticking done + int text_state = 2; - //How many unique user colors are possible - static const int max_colors = 12; + // character id, which index of the char_list the player is + int m_cid = -1; + // cid and this may differ in cases of ini-editing + QString current_char = ""; - //Text Color-related optimization: - //Current color list indexes to real color references - QVector color_row_to_number; + int objection_state = 0; + int realization_state = 0; + int screenshake_state = 0; + int text_color = 0; - //List of associated RGB colors for this color index - QVector color_rgb_list; + // How many unique user colors are possible + static const int max_colors = 12; - //List of markdown start characters, their index is tied to the color index - QStringList color_markdown_start_list; + // Text Color-related optimization: + // Current color list indexes to real color references + QVector color_row_to_number; - //List of markdown end characters, their index is tied to the color index - QStringList color_markdown_end_list; + // List of associated RGB colors for this color index + QVector color_rgb_list; - //Whether or not we're supposed to remove this char during parsing - QVector color_markdown_remove_list; + // List of markdown start characters, their index is tied to the color index + QStringList color_markdown_start_list; - //Whether or not this color allows us to play the talking animation - QVector color_markdown_talking_list; - //Text Color-related optimization END + // List of markdown end characters, their index is tied to the color index + QStringList color_markdown_end_list; - //List of all currently available pos - QStringList pos_dropdown_list; + // Whether or not we're supposed to remove this char during parsing + QVector color_markdown_remove_list; - bool is_presenting_evidence = false; + // Whether or not this color allows us to play the talking animation + QVector color_markdown_talking_list; + // Text Color-related optimization END - QString effect = ""; + // List of all currently available pos + QStringList pos_dropdown_list; - //Music effect flags we want to send to server when we play music - int music_flags = 0; + bool is_presenting_evidence = false; - int defense_bar_state = 0; - int prosecution_bar_state = 0; + QString effect = ""; - int current_char_page = 0; - int char_columns = 10; - int char_rows = 9; - int max_chars_on_page = 90; + // Music effect flags we want to send to server when we play music + int music_flags = 0; - const int button_width = 60; - const int button_height = 60; + int defense_bar_state = 0; + int prosecution_bar_state = 0; - int current_emote_page = 0; - int current_emote = 0; - int emote_columns = 5; - int emote_rows = 2; - int max_emotes_on_page = 10; + int current_char_page = 0; + int char_columns = 10; + int char_rows = 9; + int max_chars_on_page = 90; - QVector local_evidence_list; - QVector private_evidence_list; - QVector global_evidence_list; + const int button_width = 60; + const int button_height = 60; - //false = use private_evidence_list - bool current_evidence_global = true; + int current_emote_page = 0; + int current_emote = 0; + int emote_columns = 5; + int emote_rows = 2; + int max_emotes_on_page = 10; - int current_evidence_page = 0; - int current_evidence = 0; - int evidence_columns = 6; - int evidence_rows = 3; - int max_evidence_on_page = 18; + QVector local_evidence_list; + QVector private_evidence_list; + QVector global_evidence_list; - //is set to true if the bg folder contains defensedesk.png, prosecutiondesk.png and stand.png - bool is_ao2_bg = false; + // false = use private_evidence_list + bool current_evidence_global = true; - //whether the ooc chat is server or master chat, true is server - bool server_ooc = true; + int current_evidence_page = 0; + int current_evidence = 0; + int evidence_columns = 6; + int evidence_rows = 3; + int max_evidence_on_page = 18; - QString current_background = "default"; - QString current_side = ""; + // is set to true if the bg folder contains defensedesk.png, + // prosecutiondesk.png and stand.png + bool is_ao2_bg = false; - AOMusicPlayer *music_player; - AOSfxPlayer *sfx_player; - AOSfxPlayer *objection_player; - AOBlipPlayer *blip_player; + // whether the ooc chat is server or master chat, true is server + bool server_ooc = true; - AOSfxPlayer *modcall_player; + QString current_background = "default"; + QString current_side = ""; - AOImage *ui_background; + AOMusicPlayer *music_player; + AOSfxPlayer *sfx_player; + AOSfxPlayer *objection_player; + AOBlipPlayer *blip_player; - QWidget *ui_viewport; - AOScene *ui_vp_background; - AOMovie *ui_vp_speedlines; - AOCharMovie *ui_vp_player_char; - AOCharMovie *ui_vp_sideplayer_char; - AOScene *ui_vp_desk; - AOScene *ui_vp_legacy_desk; - AOEvidenceDisplay *ui_vp_evidence_display; - AOImage *ui_vp_chatbox; - QLabel *ui_vp_showname; - AOMovie *ui_vp_chat_arrow; - QTextEdit *ui_vp_message; - AOMovie *ui_vp_effect; - AOMovie *ui_vp_testimony; - AOMovie *ui_vp_wtce; - AOMovie *ui_vp_objection; + AOSfxPlayer *modcall_player; - QTextEdit *ui_ic_chatlog; + AOImage *ui_background; - AOTextArea *ui_ms_chatlog; - AOTextArea *ui_server_chatlog; + QWidget *ui_viewport; + AOScene *ui_vp_background; + AOMovie *ui_vp_speedlines; + AOCharMovie *ui_vp_player_char; + AOCharMovie *ui_vp_sideplayer_char; + AOScene *ui_vp_desk; + AOScene *ui_vp_legacy_desk; + AOEvidenceDisplay *ui_vp_evidence_display; + AOImage *ui_vp_chatbox; + QLabel *ui_vp_showname; + AOMovie *ui_vp_chat_arrow; + QTextEdit *ui_vp_message; + AOMovie *ui_vp_effect; + AOMovie *ui_vp_testimony; + AOMovie *ui_vp_wtce; + AOMovie *ui_vp_objection; - QListWidget *ui_mute_list; - QTreeWidget *ui_area_list; - QTreeWidget *ui_music_list; + QTextEdit *ui_ic_chatlog; - ScrollText *ui_music_name; - AOMovie *ui_music_display; + AOTextArea *ui_ms_chatlog; + AOTextArea *ui_server_chatlog; - AOButton *ui_pair_button; - QListWidget *ui_pair_list; - QSpinBox *ui_pair_offset_spinbox; + QListWidget *ui_mute_list; + QTreeWidget *ui_area_list; + QTreeWidget *ui_music_list; - QComboBox *ui_pair_order_dropdown; + ScrollText *ui_music_name; + AOMovie *ui_music_display; - AOLineEdit *ui_ic_chat_message; - QLineEdit *ui_ic_chat_name; + AOButton *ui_pair_button; + QListWidget *ui_pair_list; + QSpinBox *ui_pair_offset_spinbox; - QLineEdit *ui_ooc_chat_message; - QLineEdit *ui_ooc_chat_name; + QComboBox *ui_pair_order_dropdown; - //QLineEdit *ui_area_password; - QLineEdit *ui_music_search; + AOLineEdit *ui_ic_chat_message; + QLineEdit *ui_ic_chat_name; - QWidget *ui_emotes; - QVector ui_emote_list; - AOButton *ui_emote_left; - AOButton *ui_emote_right; + QLineEdit *ui_ooc_chat_message; + QLineEdit *ui_ooc_chat_name; - QComboBox *ui_emote_dropdown; - QComboBox *ui_pos_dropdown; + // QLineEdit *ui_area_password; + QLineEdit *ui_music_search; - QComboBox *ui_iniswap_dropdown; - AOButton *ui_iniswap_remove; + QWidget *ui_emotes; + QVector ui_emote_list; + AOButton *ui_emote_left; + AOButton *ui_emote_right; - QComboBox *ui_sfx_dropdown; - AOButton *ui_sfx_remove; + QComboBox *ui_emote_dropdown; + QComboBox *ui_pos_dropdown; - QComboBox *ui_effects_dropdown; + QComboBox *ui_iniswap_dropdown; + AOButton *ui_iniswap_remove; - AOImage *ui_defense_bar; - AOImage *ui_prosecution_bar; + QComboBox *ui_sfx_dropdown; + AOButton *ui_sfx_remove; - QLabel *ui_music_label; - QLabel *ui_sfx_label; - QLabel *ui_blip_label; + QComboBox *ui_effects_dropdown; + + AOImage *ui_defense_bar; + AOImage *ui_prosecution_bar; + + QLabel *ui_music_label; + QLabel *ui_sfx_label; + QLabel *ui_blip_label; - AOButton *ui_hold_it; - AOButton *ui_objection; - AOButton *ui_take_that; + AOButton *ui_hold_it; + AOButton *ui_objection; + AOButton *ui_take_that; - AOButton *ui_ooc_toggle; + AOButton *ui_ooc_toggle; - AOButton *ui_witness_testimony; - AOButton *ui_cross_examination; - AOButton *ui_guilty; - AOButton *ui_not_guilty; + AOButton *ui_witness_testimony; + AOButton *ui_cross_examination; + AOButton *ui_guilty; + AOButton *ui_not_guilty; - AOButton *ui_change_character; - AOButton *ui_reload_theme; - AOButton *ui_call_mod; - AOButton *ui_settings; - AOButton *ui_announce_casing; - AOButton *ui_switch_area_music; + AOButton *ui_change_character; + AOButton *ui_reload_theme; + AOButton *ui_call_mod; + AOButton *ui_settings; + AOButton *ui_announce_casing; + AOButton *ui_switch_area_music; - QCheckBox *ui_pre; - QCheckBox *ui_flip; - QCheckBox *ui_additive; - QCheckBox *ui_guard; - QCheckBox *ui_casing; + QCheckBox *ui_pre; + QCheckBox *ui_flip; + QCheckBox *ui_additive; + QCheckBox *ui_guard; + QCheckBox *ui_casing; - QCheckBox *ui_pre_non_interrupt; - QCheckBox *ui_showname_enable; + QCheckBox *ui_pre_non_interrupt; + QCheckBox *ui_showname_enable; - AOButton *ui_custom_objection; - AOButton *ui_realization; - AOButton *ui_screenshake; - AOButton *ui_mute; - - AOButton *ui_defense_plus; - AOButton *ui_defense_minus; - - AOButton *ui_prosecution_plus; - AOButton *ui_prosecution_minus; + AOButton *ui_custom_objection; + AOButton *ui_realization; + AOButton *ui_screenshake; + AOButton *ui_mute; + + AOButton *ui_defense_plus; + AOButton *ui_defense_minus; + + AOButton *ui_prosecution_plus; + AOButton *ui_prosecution_minus; - QComboBox *ui_text_color; + QComboBox *ui_text_color; - QSlider *ui_music_slider; - QSlider *ui_sfx_slider; - QSlider *ui_blip_slider; + QSlider *ui_music_slider; + QSlider *ui_sfx_slider; + QSlider *ui_blip_slider; - AOImage *ui_muted; + AOImage *ui_muted; - AOButton *ui_evidence_button; - AOImage *ui_evidence; - AOLineEdit *ui_evidence_name; - QWidget *ui_evidence_buttons; - QVector ui_evidence_list; - AOButton *ui_evidence_left; - AOButton *ui_evidence_right; - AOButton *ui_evidence_present; - AOImage *ui_evidence_overlay; - AOButton *ui_evidence_delete; - AOLineEdit *ui_evidence_image_name; - AOButton *ui_evidence_image_button; - AOButton *ui_evidence_x; - AOButton *ui_evidence_ok; - AOButton *ui_evidence_switch; - AOButton *ui_evidence_transfer; - AOButton *ui_evidence_save; - AOButton *ui_evidence_load; - AOTextEdit *ui_evidence_description; + AOButton *ui_evidence_button; + AOImage *ui_evidence; + AOLineEdit *ui_evidence_name; + QWidget *ui_evidence_buttons; + QVector ui_evidence_list; + AOButton *ui_evidence_left; + AOButton *ui_evidence_right; + AOButton *ui_evidence_present; + AOImage *ui_evidence_overlay; + AOButton *ui_evidence_delete; + AOLineEdit *ui_evidence_image_name; + AOButton *ui_evidence_image_button; + AOButton *ui_evidence_x; + AOButton *ui_evidence_ok; + AOButton *ui_evidence_switch; + AOButton *ui_evidence_transfer; + AOButton *ui_evidence_save; + AOButton *ui_evidence_load; + AOTextEdit *ui_evidence_description; - AOImage *ui_char_select_background; + AOImage *ui_char_select_background; - //abstract widget to hold char buttons - QWidget *ui_char_buttons; + // abstract widget to hold char buttons + QWidget *ui_char_buttons; - QVector ui_char_button_list; - QVector ui_char_button_list_filtered; - AOImage *ui_selector; + QVector ui_char_button_list; + QVector ui_char_button_list_filtered; + AOImage *ui_selector; - AOButton *ui_back_to_lobby; + AOButton *ui_back_to_lobby; - QLineEdit *ui_char_password; + QLineEdit *ui_char_password; - AOButton *ui_char_select_left; - AOButton *ui_char_select_right; + AOButton *ui_char_select_left; + AOButton *ui_char_select_right; - AOButton *ui_spectator; + AOButton *ui_spectator; - QLineEdit *ui_char_search; - QCheckBox *ui_char_passworded; - QCheckBox *ui_char_taken; + QLineEdit *ui_char_search; + QCheckBox *ui_char_passworded; + QCheckBox *ui_char_taken; - void construct_char_select(); - void set_char_select(); - void set_char_select_page(); - void char_clicked(int n_char); - void put_button_in_place(int starting, int chars_on_this_page); - void filter_character_list(); - - void initialize_emotes(); - void refresh_emotes(); - void set_emote_page(); - void set_emote_dropdown(); - - void initialize_evidence(); - void refresh_evidence(); - void set_evidence_page(); + void construct_char_select(); + void set_char_select(); + void set_char_select_page(); + void char_clicked(int n_char); + void put_button_in_place(int starting, int chars_on_this_page); + void filter_character_list(); + + void initialize_emotes(); + void refresh_emotes(); + void set_emote_page(); + void set_emote_dropdown(); + + void initialize_evidence(); + void refresh_evidence(); + void set_evidence_page(); public slots: - void objection_done(); - void preanim_done(); - void do_screenshake(); - void do_flash(); - void do_effect(QString fx_path, QString fx_sound, QString p_char, QString p_folder); - void play_char_sfx(QString sfx_name); + void objection_done(); + void preanim_done(); + void do_screenshake(); + void do_flash(); + void do_effect(QString fx_path, QString fx_sound, QString p_char, + QString p_folder); + void play_char_sfx(QString sfx_name); - void mod_called(QString p_ip); + void mod_called(QString p_ip); - void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); + void case_called(QString msg, bool def, bool pro, bool jud, bool jur, + bool steno); private slots: - void start_chat_ticking(); - void play_sfx(); + void start_chat_ticking(); + void play_sfx(); - void chat_tick(); + void chat_tick(); - void on_mute_list_clicked(QModelIndex p_index); - void on_pair_list_clicked(QModelIndex p_index); + void on_mute_list_clicked(QModelIndex p_index); + void on_pair_list_clicked(QModelIndex p_index); - void on_chat_return_pressed(); + void on_chat_return_pressed(); - void on_ooc_return_pressed(); + void on_ooc_return_pressed(); - void on_music_search_edited(QString p_text); - void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); - void on_music_list_context_menu_requested(const QPoint &pos); - void music_fade_out(bool toggle); - void music_fade_in(bool toggle); - void music_synchronize(bool toggle); - void music_list_expand_all(); - void music_list_collapse_all(); - void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); + void on_music_search_edited(QString p_text); + void on_music_list_double_clicked(QTreeWidgetItem *p_item, int column); + void on_music_list_context_menu_requested(const QPoint &pos); + void music_fade_out(bool toggle); + void music_fade_in(bool toggle); + void music_synchronize(bool toggle); + void music_list_expand_all(); + void music_list_collapse_all(); + void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); - void select_emote(int p_id); + void select_emote(int p_id); - void on_emote_clicked(int p_id); + void on_emote_clicked(int p_id); - void on_emote_left_clicked(); - void on_emote_right_clicked(); + void on_emote_left_clicked(); + void on_emote_right_clicked(); - void on_emote_dropdown_changed(int p_index); - void on_pos_dropdown_changed(int p_index); + void on_emote_dropdown_changed(int p_index); + void on_pos_dropdown_changed(int p_index); - void on_iniswap_dropdown_changed(int p_index); - void set_iniswap_dropdown(); - void on_iniswap_context_menu_requested(const QPoint &pos); - void on_iniswap_edit_requested(); - void on_iniswap_remove_clicked(); + void on_iniswap_dropdown_changed(int p_index); + void set_iniswap_dropdown(); + void on_iniswap_context_menu_requested(const QPoint &pos); + void on_iniswap_edit_requested(); + void on_iniswap_remove_clicked(); - void on_sfx_dropdown_changed(int p_index); - void set_sfx_dropdown(); - void on_sfx_context_menu_requested(const QPoint &pos); - void on_sfx_edit_requested(); - void on_sfx_remove_clicked(); + void on_sfx_dropdown_changed(int p_index); + void set_sfx_dropdown(); + void on_sfx_context_menu_requested(const QPoint &pos); + void on_sfx_edit_requested(); + void on_sfx_remove_clicked(); - void set_effects_dropdown(); - void on_effects_context_menu_requested(const QPoint &pos); - void on_effects_edit_requested(); - void on_character_effects_edit_requested(); - void on_effects_dropdown_changed(int p_index); - bool effects_dropdown_find_and_set(QString effect); + void set_effects_dropdown(); + void on_effects_context_menu_requested(const QPoint &pos); + void on_effects_edit_requested(); + void on_character_effects_edit_requested(); + void on_effects_dropdown_changed(int p_index); + bool effects_dropdown_find_and_set(QString effect); - QString get_char_sfx(); - int get_char_sfx_delay(); + QString get_char_sfx(); + int get_char_sfx_delay(); - void on_evidence_name_edited(); - void on_evidence_image_name_edited(); - void on_evidence_image_button_clicked(); - void on_evidence_clicked(int p_id); - void on_evidence_double_clicked(int p_id); + void on_evidence_name_edited(); + void on_evidence_image_name_edited(); + void on_evidence_image_button_clicked(); + void on_evidence_clicked(int p_id); + void on_evidence_double_clicked(int p_id); - void on_evidence_hover(int p_id, bool p_state); + void on_evidence_hover(int p_id, bool p_state); - void on_evidence_left_clicked(); - void on_evidence_right_clicked(); - void on_evidence_present_clicked(); + void on_evidence_left_clicked(); + void on_evidence_right_clicked(); + void on_evidence_present_clicked(); - void on_hold_it_clicked(); - void on_objection_clicked(); - void on_take_that_clicked(); - void on_custom_objection_clicked(); + void on_hold_it_clicked(); + void on_objection_clicked(); + void on_take_that_clicked(); + void on_custom_objection_clicked(); - void on_realization_clicked(); - void on_screenshake_clicked(); + void on_realization_clicked(); + void on_screenshake_clicked(); - void on_mute_clicked(); - void on_pair_clicked(); - void on_pair_order_dropdown_changed(int p_index); + void on_mute_clicked(); + void on_pair_clicked(); + void on_pair_order_dropdown_changed(int p_index); - void on_defense_minus_clicked(); - void on_defense_plus_clicked(); - void on_prosecution_minus_clicked(); - void on_prosecution_plus_clicked(); + void on_defense_minus_clicked(); + void on_defense_plus_clicked(); + void on_prosecution_minus_clicked(); + void on_prosecution_plus_clicked(); - void on_text_color_changed(int p_color); - void set_text_color_dropdown(); + void on_text_color_changed(int p_color); + void set_text_color_dropdown(); - void on_music_slider_moved(int p_value); - void on_sfx_slider_moved(int p_value); - void on_blip_slider_moved(int p_value); + void on_music_slider_moved(int p_value); + void on_sfx_slider_moved(int p_value); + void on_blip_slider_moved(int p_value); - void on_log_limit_changed(int value); - void on_pair_offset_changed(int value); + void on_log_limit_changed(int value); + void on_pair_offset_changed(int value); - void on_ooc_toggle_clicked(); + void on_ooc_toggle_clicked(); - void on_witness_testimony_clicked(); - void on_cross_examination_clicked(); - void on_not_guilty_clicked(); - void on_guilty_clicked(); + void on_witness_testimony_clicked(); + void on_cross_examination_clicked(); + void on_not_guilty_clicked(); + void on_guilty_clicked(); - void on_change_character_clicked(); - void on_reload_theme_clicked(); - void on_call_mod_clicked(); - void on_settings_clicked(); - void on_announce_casing_clicked(); + void on_change_character_clicked(); + void on_reload_theme_clicked(); + void on_call_mod_clicked(); + void on_settings_clicked(); + void on_announce_casing_clicked(); - void on_pre_clicked(); - void on_flip_clicked(); - void on_additive_clicked(); - void on_guard_clicked(); + void on_pre_clicked(); + void on_flip_clicked(); + void on_additive_clicked(); + void on_guard_clicked(); - void on_showname_enable_clicked(); + void on_showname_enable_clicked(); - void on_evidence_name_double_clicked(); - void on_evidence_image_name_double_clicked(); - void on_evidence_button_clicked(); + void on_evidence_name_double_clicked(); + void on_evidence_image_name_double_clicked(); + void on_evidence_button_clicked(); - void on_evidence_delete_clicked(); - void on_evidence_x_clicked(); - void on_evidence_ok_clicked(); - void on_evidence_switch_clicked(); - void on_evidence_transfer_clicked(); + void on_evidence_delete_clicked(); + void on_evidence_x_clicked(); + void on_evidence_ok_clicked(); + void on_evidence_switch_clicked(); + void on_evidence_transfer_clicked(); - void on_evidence_edited(); + void on_evidence_edited(); - void evidence_close(); - void evidence_switch(bool global); - void on_evidence_save_clicked(); - void on_evidence_load_clicked(); - bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); + void evidence_close(); + void evidence_switch(bool global); + void on_evidence_save_clicked(); + void on_evidence_load_clicked(); + bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); - void on_back_to_lobby_clicked(); + void on_back_to_lobby_clicked(); - void on_char_select_left_clicked(); - void on_char_select_right_clicked(); - void on_char_search_changed(); - void on_char_taken_clicked(); - void on_char_passworded_clicked(); + void on_char_select_left_clicked(); + void on_char_select_right_clicked(); + void on_char_search_changed(); + void on_char_taken_clicked(); + void on_char_passworded_clicked(); - void on_spectator_clicked(); + void on_spectator_clicked(); - void on_switch_area_music_clicked(); + void on_switch_area_music_clicked(); - void on_casing_clicked(); + void on_casing_clicked(); - void ping_server(); + void ping_server(); - void load_bass_opus_plugin(); + void load_bass_opus_plugin(); }; #endif // COURTROOM_H diff --git a/include/datatypes.h b/include/datatypes.h index 715bb3e0..21ade040 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -4,107 +4,103 @@ #include struct server_type { - QString name; - QString desc; - QString ip; - int port; + QString name; + QString desc; + QString ip; + int port; }; struct emote_type { - QString comment; - QString preanim; - QString anim; - int mod; - QString sfx_name; - int sfx_delay; - int sfx_duration; + QString comment; + QString preanim; + QString anim; + int mod; + QString sfx_name; + int sfx_delay; + int sfx_duration; }; struct char_type { - QString name; - QString description; - QString evidence_string; - bool taken; + QString name; + QString description; + QString evidence_string; + bool taken; }; struct evi_type { - QString name; - QString description; - QString image; + QString name; + QString description; + QString image; }; struct chatmessage_type { - QString message; - QString character; - QString side; - QString sfx_name; - QString pre_emote; - QString emote; - int emote_modifier; - int objection_modifier; - int realization; - int text_color; - int evidence; - int cid; - int sfx_delay; - int flip; + QString message; + QString character; + QString side; + QString sfx_name; + QString pre_emote; + QString emote; + int emote_modifier; + int objection_modifier; + int realization; + int text_color; + int evidence; + int cid; + int sfx_delay; + int flip; }; struct area_type { - QString name; - QString background; - bool passworded; + QString name; + QString background; + bool passworded; }; struct pos_type { - int x; - int y; + int x; + int y; }; struct pos_size_type { - int x = 0; - int y = 0; - int width = 0; - int height = 0; + int x = 0; + int y = 0; + int width = 0; + int height = 0; }; enum CHAT_MESSAGE { - DESK_MOD = 0, - PRE_EMOTE, - CHAR_NAME, - EMOTE, - MESSAGE, - SIDE, - SFX_NAME, - EMOTE_MOD, - CHAR_ID, - SFX_DELAY, - OBJECTION_MOD, - EVIDENCE_ID, - FLIP, - REALIZATION, - TEXT_COLOR, - SHOWNAME, - OTHER_CHARID, - OTHER_NAME, - OTHER_EMOTE, - SELF_OFFSET, - OTHER_OFFSET, - OTHER_FLIP, - NONINTERRUPTING_PRE, - LOOPING_SFX, - SCREENSHAKE, - FRAME_SCREENSHAKE, - FRAME_REALIZATION, - FRAME_SFX, - ADDITIVE, - EFFECTS + DESK_MOD = 0, + PRE_EMOTE, + CHAR_NAME, + EMOTE, + MESSAGE, + SIDE, + SFX_NAME, + EMOTE_MOD, + CHAR_ID, + SFX_DELAY, + OBJECTION_MOD, + EVIDENCE_ID, + FLIP, + REALIZATION, + TEXT_COLOR, + SHOWNAME, + OTHER_CHARID, + OTHER_NAME, + OTHER_EMOTE, + SELF_OFFSET, + OTHER_OFFSET, + OTHER_FLIP, + NONINTERRUPTING_PRE, + LOOPING_SFX, + SCREENSHAKE, + FRAME_SCREENSHAKE, + FRAME_REALIZATION, + FRAME_SFX, + ADDITIVE, + EFFECTS }; -enum MUSIC_EFFECT { - FADE_IN = 1, - FADE_OUT = 2, - SYNC_POS = 4 -}; +enum MUSIC_EFFECT { FADE_IN = 1, FADE_OUT = 2, SYNC_POS = 4 }; #endif // DATATYPES_H diff --git a/include/discord-rpc.h b/include/discord-rpc.h index 24885430..455f62aa 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -24,37 +24,37 @@ extern "C" { #endif typedef struct DiscordRichPresence { - const char *state; /* max 128 bytes */ - const char *details; /* max 128 bytes */ - int64_t startTimestamp; - int64_t endTimestamp; - const char *largeImageKey; /* max 32 bytes */ - const char *largeImageText; /* max 128 bytes */ - const char *smallImageKey; /* max 32 bytes */ - const char *smallImageText; /* max 128 bytes */ - const char *partyId; /* max 128 bytes */ - int partySize; - int partyMax; - const char *matchSecret; /* max 128 bytes */ - const char *joinSecret; /* max 128 bytes */ - const char *spectateSecret; /* max 128 bytes */ - int8_t instance; + const char *state; /* max 128 bytes */ + const char *details; /* max 128 bytes */ + int64_t startTimestamp; + int64_t endTimestamp; + const char *largeImageKey; /* max 32 bytes */ + const char *largeImageText; /* max 128 bytes */ + const char *smallImageKey; /* max 32 bytes */ + const char *smallImageText; /* max 128 bytes */ + const char *partyId; /* max 128 bytes */ + int partySize; + int partyMax; + const char *matchSecret; /* max 128 bytes */ + const char *joinSecret; /* max 128 bytes */ + const char *spectateSecret; /* max 128 bytes */ + int8_t instance; } DiscordRichPresence; typedef struct DiscordJoinRequest { - const char *userId; - const char *username; - const char *discriminator; - const char *avatar; + const char *userId; + const char *username; + const char *discriminator; + const char *avatar; } DiscordJoinRequest; typedef struct DiscordEventHandlers { - void (*ready)(void); - void (*disconnected)(int errorCode, const char *message); - void (*errored)(int errorCode, const char *message); - void (*joinGame)(const char *joinSecret); - void (*spectateGame)(const char *spectateSecret); - void (*joinRequest)(const DiscordJoinRequest *request); + void (*ready)(void); + void (*disconnected)(int errorCode, const char *message); + void (*errored)(int errorCode, const char *message); + void (*joinGame)(const char *joinSecret); + void (*spectateGame)(const char *spectateSecret); + void (*joinRequest)(const DiscordJoinRequest *request); } DiscordEventHandlers; #define DISCORD_REPLY_NO 0 @@ -70,7 +70,8 @@ DISCORD_EXPORT void Discord_Shutdown(void); /* checks for incoming messages, dispatches callbacks */ DISCORD_EXPORT void Discord_RunCallbacks(void); -/* If you disable the lib starting its own io thread, you'll need to call this from your own */ +/* If you disable the lib starting its own io thread, you'll need to call this + * from your own */ #ifdef DISCORD_DISABLE_IO_THREAD DISCORD_EXPORT void Discord_UpdateConnection(void); #endif @@ -78,7 +79,8 @@ DISCORD_EXPORT void Discord_UpdateConnection(void); DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence *presence); DISCORD_EXPORT void Discord_ClearPresence(void); -DISCORD_EXPORT void Discord_Respond(const char *userid, /* DISCORD_REPLY_ */ int reply); +DISCORD_EXPORT void Discord_Respond(const char *userid, + /* DISCORD_REPLY_ */ int reply); #ifdef __cplusplus } /* extern "C" */ diff --git a/include/discord_register.h b/include/discord_register.h index 71e856a5..655a3dfb 100644 --- a/include/discord_register.h +++ b/include/discord_register.h @@ -18,8 +18,10 @@ extern "C" { #endif -DISCORD_EXPORT void Discord_Register(const char *applicationId, const char *command); -DISCORD_EXPORT void Discord_RegisterSteamGame(const char *applicationId, const char *steamId); +DISCORD_EXPORT void Discord_Register(const char *applicationId, + const char *command); +DISCORD_EXPORT void Discord_RegisterSteamGame(const char *applicationId, + const char *steamId); #ifdef __cplusplus } diff --git a/include/discord_rich_presence.h b/include/discord_rich_presence.h index 1949d248..71c85e25 100644 --- a/include/discord_rich_presence.h +++ b/include/discord_rich_presence.h @@ -16,23 +16,23 @@ namespace AttorneyOnline { - class Discord { - Q_DECLARE_TR_FUNCTIONS(Discord) - - private: - const char *APPLICATION_ID = "399779271737868288"; - std::string server_name, server_id; - int64_t timestamp; - - public: - Discord(); - ~Discord(); - - void state_lobby(); - void state_server(std::string name, std::string server_id); - void state_character(std::string name); - void state_spectate(); - }; +class Discord { + Q_DECLARE_TR_FUNCTIONS(Discord) + +private: + const char *APPLICATION_ID = "399779271737868288"; + std::string server_name, server_id; + int64_t timestamp; + +public: + Discord(); + ~Discord(); + + void state_lobby(); + void state_server(std::string name, std::string server_id); + void state_character(std::string name); + void state_spectate(); +}; } // namespace AttorneyOnline #endif // DISCORD_RICH_PRESENCE_H diff --git a/include/discord_rpc.h b/include/discord_rpc.h index 737f2f66..6bd44041 100644 --- a/include/discord_rpc.h +++ b/include/discord_rpc.h @@ -24,37 +24,37 @@ extern "C" { #endif typedef struct DiscordRichPresence { - const char *state; /* max 128 bytes */ - const char *details; /* max 128 bytes */ - int64_t startTimestamp; - int64_t endTimestamp; - const char *largeImageKey; /* max 32 bytes */ - const char *largeImageText; /* max 128 bytes */ - const char *smallImageKey; /* max 32 bytes */ - const char *smallImageText; /* max 128 bytes */ - const char *partyId; /* max 128 bytes */ - int partySize; - int partyMax; - const char *matchSecret; /* max 128 bytes */ - const char *joinSecret; /* max 128 bytes */ - const char *spectateSecret; /* max 128 bytes */ - int8_t instance; + const char *state; /* max 128 bytes */ + const char *details; /* max 128 bytes */ + int64_t startTimestamp; + int64_t endTimestamp; + const char *largeImageKey; /* max 32 bytes */ + const char *largeImageText; /* max 128 bytes */ + const char *smallImageKey; /* max 32 bytes */ + const char *smallImageText; /* max 128 bytes */ + const char *partyId; /* max 128 bytes */ + int partySize; + int partyMax; + const char *matchSecret; /* max 128 bytes */ + const char *joinSecret; /* max 128 bytes */ + const char *spectateSecret; /* max 128 bytes */ + int8_t instance; } DiscordRichPresence; typedef struct DiscordUser { - const char *userId; - const char *username; - const char *discriminator; - const char *avatar; + const char *userId; + const char *username; + const char *discriminator; + const char *avatar; } DiscordUser; typedef struct DiscordEventHandlers { - void (*ready)(const DiscordUser *request); - void (*disconnected)(int errorCode, const char *message); - void (*errored)(int errorCode, const char *message); - void (*joinGame)(const char *joinSecret); - void (*spectateGame)(const char *spectateSecret); - void (*joinRequest)(const DiscordUser *request); + void (*ready)(const DiscordUser *request); + void (*disconnected)(int errorCode, const char *message); + void (*errored)(int errorCode, const char *message); + void (*joinGame)(const char *joinSecret); + void (*spectateGame)(const char *spectateSecret); + void (*joinRequest)(const DiscordUser *request); } DiscordEventHandlers; #define DISCORD_REPLY_NO 0 @@ -70,7 +70,8 @@ DISCORD_EXPORT void Discord_Shutdown(void); /* checks for incoming messages, dispatches callbacks */ DISCORD_EXPORT void Discord_RunCallbacks(void); -/* If you disable the lib starting its own io thread, you'll need to call this from your own */ +/* If you disable the lib starting its own io thread, you'll need to call this + * from your own */ #ifdef DISCORD_DISABLE_IO_THREAD DISCORD_EXPORT void Discord_UpdateConnection(void); #endif @@ -78,7 +79,8 @@ DISCORD_EXPORT void Discord_UpdateConnection(void); DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence *presence); DISCORD_EXPORT void Discord_ClearPresence(void); -DISCORD_EXPORT void Discord_Respond(const char *userid, /* DISCORD_REPLY_ */ int reply); +DISCORD_EXPORT void Discord_Respond(const char *userid, + /* DISCORD_REPLY_ */ int reply); DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers *handlers); diff --git a/include/hex_functions.h b/include/hex_functions.h index 429bdb14..d178ba1b 100644 --- a/include/hex_functions.h +++ b/include/hex_functions.h @@ -10,7 +10,7 @@ #include namespace omni { - std::string int_to_hex(unsigned int input); +std::string int_to_hex(unsigned int input); } -#endif //HEX_OPERATIONS_H +#endif // HEX_OPERATIONS_H diff --git a/include/lobby.h b/include/lobby.h index 7b978d32..42f52977 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -21,87 +21,87 @@ class AOApplication; class Lobby : public QMainWindow { - Q_OBJECT + Q_OBJECT public: - Lobby(AOApplication *p_ao_app); - - void set_widgets(); - void list_servers(); - void list_favorites(); - void append_chatmessage(QString f_name, QString f_message); - void append_error(QString f_message); - void set_player_count(int players_online, int max_players); - void set_stylesheet(QWidget *widget, QString target_tag); - void set_stylesheets(); - void set_fonts(); - void set_font(QWidget *widget, QString p_identifier); - void set_loading_text(QString p_text); - void show_loading_overlay() { ui_loading_background->show(); } - void hide_loading_overlay() { ui_loading_background->hide(); } - QString get_chatlog(); - int get_selected_server(); - void enable_connect_button(); - - void set_loading_value(int p_value); - - bool public_servers_selected = true; - - ~Lobby(); + Lobby(AOApplication *p_ao_app); + + void set_widgets(); + void list_servers(); + void list_favorites(); + void append_chatmessage(QString f_name, QString f_message); + void append_error(QString f_message); + void set_player_count(int players_online, int max_players); + void set_stylesheet(QWidget *widget, QString target_tag); + void set_stylesheets(); + void set_fonts(); + void set_font(QWidget *widget, QString p_identifier); + void set_loading_text(QString p_text); + void show_loading_overlay() { ui_loading_background->show(); } + void hide_loading_overlay() { ui_loading_background->hide(); } + QString get_chatlog(); + int get_selected_server(); + void enable_connect_button(); + + void set_loading_value(int p_value); + + bool public_servers_selected = true; + + ~Lobby(); private: - AOApplication *ao_app; + AOApplication *ao_app; - AOImage *ui_background; + AOImage *ui_background; - AOButton *ui_public_servers; - AOButton *ui_favorites; + AOButton *ui_public_servers; + AOButton *ui_favorites; - AOButton *ui_refresh; - AOButton *ui_add_to_fav; - AOButton *ui_connect; + AOButton *ui_refresh; + AOButton *ui_add_to_fav; + AOButton *ui_connect; - QLabel *ui_version; - AOButton *ui_about; + QLabel *ui_version; + AOButton *ui_about; - AOButton *ui_settings; + AOButton *ui_settings; - QTreeWidget *ui_server_list; - QLineEdit *ui_server_search; + QTreeWidget *ui_server_list; + QLineEdit *ui_server_search; - QLabel *ui_player_count; - AOTextArea *ui_description; + QLabel *ui_player_count; + AOTextArea *ui_description; - AOTextArea *ui_chatbox; + AOTextArea *ui_chatbox; - QLineEdit *ui_chatname; - QLineEdit *ui_chatmessage; + QLineEdit *ui_chatname; + QLineEdit *ui_chatmessage; - AOImage *ui_loading_background; - QTextEdit *ui_loading_text; - QProgressBar *ui_progress_bar; - AOButton *ui_cancel; + AOImage *ui_loading_background; + QTextEdit *ui_loading_text; + QProgressBar *ui_progress_bar; + AOButton *ui_cancel; - int last_index; + int last_index; - void set_size_and_pos(QWidget *p_widget, QString p_identifier); + void set_size_and_pos(QWidget *p_widget, QString p_identifier); private slots: - void on_public_servers_clicked(); - void on_favorites_clicked(); - - void on_refresh_pressed(); - void on_refresh_released(); - void on_add_to_fav_pressed(); - void on_add_to_fav_released(); - void on_connect_pressed(); - void on_connect_released(); - void on_about_clicked(); - void on_settings_clicked(); - void on_server_list_clicked(QTreeWidgetItem *p_item, int column); - void on_server_list_doubleclicked(QTreeWidgetItem *p_item, int column); - void on_server_search_edited(QString p_text); - void on_chatfield_return_pressed(); + void on_public_servers_clicked(); + void on_favorites_clicked(); + + void on_refresh_pressed(); + void on_refresh_released(); + void on_add_to_fav_pressed(); + void on_add_to_fav_released(); + void on_connect_pressed(); + void on_connect_released(); + void on_about_clicked(); + void on_settings_clicked(); + void on_server_list_clicked(QTreeWidgetItem *p_item, int column); + void on_server_list_doubleclicked(QTreeWidgetItem *p_item, int column); + void on_server_search_edited(QString p_text); + void on_chatfield_return_pressed(); }; #endif // LOBBY_H diff --git a/include/networkmanager.h b/include/networkmanager.h index 4d9d401d..ed57a956 100644 --- a/include/networkmanager.h +++ b/include/networkmanager.h @@ -1,8 +1,8 @@ #ifndef NETWORKMANAGER_H #define NETWORKMANAGER_H -// Qt for Android has stubbed QDnsLookup. This is not documented in any part of their wiki. -// This prevents SRV lookup/failover behavior from functioning. +// Qt for Android has stubbed QDnsLookup. This is not documented in any part of +// their wiki. This prevents SRV lookup/failover behavior from functioning. // https://bugreports.qt.io/browse/QTBUG-56143 #ifndef ANDROID #define MS_FAILOVER_SUPPORTED @@ -24,60 +24,60 @@ #include class NetworkManager : public QObject { - Q_OBJECT + Q_OBJECT public: - NetworkManager(AOApplication *parent); - ~NetworkManager(); + NetworkManager(AOApplication *parent); + ~NetworkManager(); - AOApplication *ao_app; - QTcpSocket *ms_socket; - QTcpSocket *server_socket; - QDnsLookup *ms_dns; - QTimer *ms_reconnect_timer; + AOApplication *ao_app; + QTcpSocket *ms_socket; + QTcpSocket *server_socket; + QDnsLookup *ms_dns; + QTimer *ms_reconnect_timer; - const QString ms_srv_hostname = "_aoms._tcp.aceattorneyonline.com"; + const QString ms_srv_hostname = "_aoms._tcp.aceattorneyonline.com"; #ifdef LOCAL_MS - QString ms_nosrv_hostname = "localhost"; + QString ms_nosrv_hostname = "localhost"; #else - QString ms_nosrv_hostname = "master.aceattorneyonline.com"; + QString ms_nosrv_hostname = "master.aceattorneyonline.com"; #endif - const quint16 ms_port = 27016; - const int timeout_milliseconds = 2000; + const quint16 ms_port = 27016; + const int timeout_milliseconds = 2000; - // in seconds - const int ms_reconnect_delay = 7; + // in seconds + const int ms_reconnect_delay = 7; - bool ms_partial_packet = false; - QString ms_temp_packet = ""; + bool ms_partial_packet = false; + QString ms_temp_packet = ""; - bool partial_packet = false; - QString temp_packet = ""; + bool partial_packet = false; + QString temp_packet = ""; - unsigned int s_decryptor = 5; + unsigned int s_decryptor = 5; - void connect_to_master(); - void connect_to_master_nosrv(); - void connect_to_server(server_type p_server); + void connect_to_master(); + void connect_to_master_nosrv(); + void connect_to_server(server_type p_server); public slots: - void ship_ms_packet(QString p_packet); - void ship_server_packet(QString p_packet); + void ship_ms_packet(QString p_packet); + void ship_server_packet(QString p_packet); signals: - void ms_connect_finished(bool success, bool will_retry); + void ms_connect_finished(bool success, bool will_retry); private: - void perform_srv_lookup(); + void perform_srv_lookup(); private slots: - void on_srv_lookup(); - void handle_ms_packet(); - void handle_server_packet(); - void on_ms_nosrv_connect_success(); - void on_ms_socket_error(QAbstractSocket::SocketError error); - void retry_ms_connect(); + void on_srv_lookup(); + void handle_ms_packet(); + void handle_server_packet(); + void on_ms_nosrv_connect_success(); + void on_ms_socket_error(QAbstractSocket::SocketError error); + void retry_ms_connect(); }; #endif // NETWORKMANAGER_H diff --git a/include/scrolltext.h b/include/scrolltext.h index 1455762f..9ed5ff77 100644 --- a/include/scrolltext.h +++ b/include/scrolltext.h @@ -8,40 +8,40 @@ #include class ScrollText : public QWidget { - Q_OBJECT - Q_PROPERTY(QString text READ text WRITE setText) - Q_PROPERTY(QString separator READ separator WRITE setSeparator) + Q_OBJECT + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QString separator READ separator WRITE setSeparator) public: - explicit ScrollText(QWidget *parent = nullptr); + explicit ScrollText(QWidget *parent = nullptr); public slots: - QString text() const; - void setText(QString text); + QString text() const; + void setText(QString text); - QString separator() const; - void setSeparator(QString separator); + QString separator() const; + void setSeparator(QString separator); protected: - virtual void paintEvent(QPaintEvent *); - virtual void resizeEvent(QResizeEvent *); + virtual void paintEvent(QPaintEvent *); + virtual void resizeEvent(QResizeEvent *); private: - void updateText(); - QString _text; - QString _separator; - QStaticText staticText; - int singleTextWidth; - QSize wholeTextSize; - int leftMargin; - bool scrollEnabled; - int scrollPos; - QImage alphaChannel; - QImage buffer; - QTimer timer; + void updateText(); + QString _text; + QString _separator; + QStaticText staticText; + int singleTextWidth; + QSize wholeTextSize; + int leftMargin; + bool scrollEnabled; + int scrollPos; + QImage alphaChannel; + QImage buffer; + QTimer timer; private slots: - virtual void timer_timeout(); + virtual void timer_timeout(); }; #endif // SCROLLTEXT_H -- cgit From a5868aa3800de43ce6f6aee903bb0fecf2fe105b Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 04:53:19 +0300 Subject: Fix looping frame SFX not working w/ AOV's definitions --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index d9e84fa8..471fc46e 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -371,7 +371,7 @@ public: QString get_emote_blip(QString p_char, int p_emote); // Returns if the sfx is defined as looping in char.ini - QString get_sfx_looping(QString p_char, QString p_sfx); + QString get_sfx_looping(QString p_char, int p_emote); // Returns if an emote has a frame specific SFX for it QString get_sfx_frame(QString p_char, QString p_emote, int n_frame); -- cgit From 4617e3135ed14a28c4129154486022947fda9d82 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 15:28:33 +0300 Subject: Change version number to 2.8.4 --- include/aoapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index 471fc46e..18f6ef24 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -428,7 +428,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 8; - const int MINOR_VERSION = 3; + const int MINOR_VERSION = 4; QString current_theme = "default"; -- cgit