diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 11 | ||||
| -rw-r--r-- | include/aoblipplayer.h | 16 | ||||
| -rw-r--r-- | include/aoevidencebutton.h | 2 | ||||
| -rw-r--r-- | include/aomusicplayer.h | 36 | ||||
| -rw-r--r-- | include/aooptionsdialog.h | 8 | ||||
| -rw-r--r-- | include/aosfxplayer.h | 18 | ||||
| -rw-r--r-- | include/courtroom.h | 13 | ||||
| -rw-r--r-- | include/discord_rich_presence.h | 4 | ||||
| -rw-r--r-- | include/lobby.h | 3 | ||||
| -rw-r--r-- | include/networkmanager.h | 8 |
10 files changed, 102 insertions, 17 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index f1c41907..280b7314 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -22,6 +22,10 @@ #include <QTextStream> #include <QStringList> #include <QColor> +#include <QScreen> +#ifdef QTAUDIO +#include <QAudioDeviceInfo> +#endif #include <QtConcurrent/QtConcurrent> #include <QThread> @@ -189,6 +193,9 @@ public: // 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(); @@ -211,6 +218,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 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); @@ -332,7 +342,6 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 7; - const int MINOR_VERSION = 2; QString current_theme = "default"; diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h index aebba77d..44ca48bb 100644 --- a/include/aoblipplayer.h +++ b/include/aoblipplayer.h @@ -1,13 +1,19 @@ #ifndef AOBLIPPLAYER_H #define AOBLIPPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include <QSoundEffect> +#endif + #include "aoapplication.h" #include <QWidget> #include <string.h> #include <QDebug> + class AOBlipPlayer { public: @@ -15,16 +21,22 @@ public: void set_blips(QString p_sfx); void blip_tick(); - void set_volume(int p_volume); + void set_volume(qreal p_volume); int m_cycle = 0; private: QWidget *m_parent; AOApplication *ao_app; + qreal m_volume; + + void set_volume_internal(qreal p_volume); - int m_volume; + #if defined(BASSAUDIO) HSTREAM m_stream_list[5]; + #elif defined(QTAUDIO) + QSoundEffect m_blips; + #endif }; #endif // AOBLIPPLAYER_H diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h index 27fb84b3..80b747cd 100644 --- a/include/aoevidencebutton.h +++ b/include/aoevidencebutton.h @@ -35,8 +35,10 @@ protected: 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); diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index a88cb79b..71ae6045 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -1,7 +1,11 @@ #ifndef AOMUSICPLAYER_H #define AOMUSICPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include <QMediaPlayer> +#endif #include "aoapplication.h" #include <QWidget> @@ -32,5 +36,37 @@ private: HSTREAM m_stream; }; +#elif defined(QTAUDIO) +class AOMusicPlayer : public QObject +{ +public: + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); + + void play(QString p_song); + void set_volume(int p_value); + +private: + QMediaPlayer m_player; + QWidget *m_parent; + AOApplication *ao_app; + + int m_volume = 0; +}; +#else +class AOMusicPlayer : public QObject +{ +public: + AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); + ~AOMusicPlayer(); + + void play(QString p_song); + void set_volume(int p_value); + +private: + QWidget *m_parent; + AOApplication *ao_app; +}; +#endif #endif // AOMUSICPLAYER_H diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 53bd3096..233d079a 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -2,7 +2,13 @@ #define AOOPTIONSDIALOG_H #include "aoapplication.h" + +#ifdef BASSAUDIO #include "bass.h" +#elif defined QTAUDIO +#include <QAudio> +#include <QAudioDeviceInfo> +#endif #include <QtCore/QVariant> #include <QtWidgets/QApplication> @@ -57,6 +63,8 @@ private: QCheckBox *ui_discord_cb; QLabel *ui_epilepsy_lbl; QCheckBox *ui_epilepsy_cb; + QLabel *ui_language_label; + QComboBox *ui_language_combobox; QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 39bea0d4..5b4d2ece 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -1,7 +1,12 @@ #ifndef AOSFXPLAYER_H #define AOSFXPLAYER_H +#if defined(BASSAUDIO) #include "bass.h" +#elif defined(QTAUDIO) +#include <QSoundEffect> +#endif + #include "aoapplication.h" #include <QWidget> @@ -17,15 +22,22 @@ public: void play(QString p_sfx, QString p_char = "", QString shout = ""); void stop(); - void set_volume(int p_volume); + void set_volume(qreal p_volume); void setLooping(bool is_looping); + private: QWidget *m_parent; AOApplication *ao_app; - - int m_volume = 0; + qreal m_volume = 0; bool looping_sfx = false; + + void set_volume_internal(qreal p_volume); + + #if defined(BASSAUDIO) HSTREAM m_stream; + #elif defined(QTAUDIO) + QSoundEffect m_sfx; + #endif }; #endif // AOSFXPLAYER_H diff --git a/include/courtroom.h b/include/courtroom.h index e00e454c..587d9630 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -10,6 +10,7 @@ #include "aomovie.h" #include "aocharmovie.h" #include "aomusicplayer.h" +#include "aooptionsdialog.h" #include "aosfxplayer.h" #include "aoblipplayer.h" #include "aoevidencebutton.h" @@ -36,7 +37,6 @@ #include <QSlider> #include <QVector> #include <QCloseEvent> -#include <QSignalMapper> #include <QMap> #include <QTextBrowser> #include <QSpinBox> @@ -60,6 +60,8 @@ #include <QFuture> #include <QMetaObject> #include <QLayout> +#include <QTextBoundaryFinder> + #include <stack> class AOApplication; @@ -558,6 +560,7 @@ private: 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(); @@ -673,14 +676,12 @@ private slots: void on_char_select_left_clicked(); void on_char_select_right_clicked(); - void on_char_search_changed(const QString& newtext); - void on_char_taken_clicked(int newstate); - void on_char_passworded_clicked(int newstate); + void on_char_search_changed(); + void on_char_taken_clicked(); + void on_char_passworded_clicked(); void on_spectator_clicked(); - void char_clicked(int n_char); - void on_switch_area_music_clicked(); void on_casing_clicked(); diff --git a/include/discord_rich_presence.h b/include/discord_rich_presence.h index e7ecc6ef..4115b516 100644 --- a/include/discord_rich_presence.h +++ b/include/discord_rich_presence.h @@ -5,6 +5,8 @@ #include <ctime> #include <QDebug> #include <string> +#include <QCoreApplication> + #include <discord-rpc.h> #include <cstring> @@ -16,6 +18,8 @@ namespace AttorneyOnline { class Discord { + Q_DECLARE_TR_FUNCTIONS(Discord) + private: const char* APPLICATION_ID = "399779271737868288"; std::string server_name, server_id; diff --git a/include/lobby.h b/include/lobby.h index 3a34fb8e..06cd798b 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -75,6 +75,8 @@ private: QProgressBar *ui_progress_bar; AOButton *ui_cancel; + QModelIndex last_model; + void set_size_and_pos(QWidget *p_widget, QString p_identifier); public slots: void fucking_threading_goddamn_it(QString fuckshitassgoddamnfuck); @@ -90,6 +92,7 @@ private slots: 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_chatfield_return_pressed(); }; diff --git a/include/networkmanager.h b/include/networkmanager.h index e28abfda..08b10db8 100644 --- a/include/networkmanager.h +++ b/include/networkmanager.h @@ -44,13 +44,11 @@ public: QString ms_nosrv_hostname = "master.aceattorneyonline.com"; #endif - const int ms_port = 27016; + const quint16 ms_port = 27016; const int timeout_milliseconds = 2000; - const int ms_reconnect_delay_ms = 7000; - - // kind of arbitrary max buffer size - const size_t buffer_max_size = 16384; + // in seconds + const int ms_reconnect_delay = 7; bool ms_partial_packet = false; QString ms_temp_packet = ""; |
