diff options
Diffstat (limited to 'include')
45 files changed, 0 insertions, 5459 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 29ad4fe7..00000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -target_sources(Attorney_Online PRIVATE -aoapplication.h -aoblipplayer.h -aobutton.h -aocaseannouncerdialog.h -aocharbutton.h -aoclocklabel.h -aoemotebutton.h -aoemotepreview.h -aoevidencebutton.h -aoevidencedisplay.h -aoimage.h -aolayer.h -aomusicplayer.h -aooptionsdialog.h -aopacket.h -aosfxplayer.h -aotextarea.h -aoutils.h -bass.h -bassmidi.h -bassopus.h -chatlogpiece.h -courtroom.h -datatypes.h -debug_functions.h -demoserver.h -discord-rpc.h -discord_register.h -discord_rich_presence.h -discord_rpc.h -eventfilters.h -file_functions.h -hardware_functions.h -lobby.h -misc_functions.h -networkmanager.h -scrolltext.h -text_file_functions.h -) diff --git a/include/aoapplication.h b/include/aoapplication.h deleted file mode 100644 index 2b79f6ef..00000000 --- a/include/aoapplication.h +++ /dev/null @@ -1,373 +0,0 @@ -#ifndef AOAPPLICATION_H -#define AOAPPLICATION_H - -#include "aopacket.h" -#include "datatypes.h" -#include "demoserver.h" -#include "discord_rich_presence.h" -#include "serverdata.h" -#include "widgets/aooptionsdialog.h" - -#include "bass.h" - -#include <QApplication> -#include <QFile> -#include <QSettings> -#include <QVector> - -#include <QDebug> -#include <QRect> - -#include <QCryptographicHash> - -#include <QDir> -#include <QStandardPaths> - -#include <QColor> -#include <QScreen> -#include <QStringList> -#include <QTextStream> -#include <QTime> - -#include <QElapsedTimer> - -class NetworkManager; -class Lobby; -class Courtroom; -class Options; - -class VPath : QString { - using QString::QString; - -public: - explicit VPath(const QString &str) : QString(str) {} - inline QString const &toQString() const { return *this; } - inline bool operator==(const VPath &str) const { - return this->toQString() == str.toQString(); - } - inline VPath operator+(const VPath &str) const { - return VPath(this->toQString() + str.toQString()); - } -}; - -inline uint qHash(const VPath &key, uint seed = qGlobalQHashSeed()) -{ - return qHash(key.toQString(), seed); -} - -class AOApplication : public QApplication { - Q_OBJECT - -public: - AOApplication(int &argc, char **argv); - ~AOApplication(); - - NetworkManager *net_manager; - Lobby *w_lobby; - Courtroom *w_courtroom; - AttorneyOnline::Discord *discord; - - QFont default_font; - - bool lobby_constructed = false; - bool courtroom_constructed = false; - - void construct_lobby(); - void destruct_lobby(); - - void construct_courtroom(); - void destruct_courtroom(); - - void server_packet_received(AOPacket *p_packet); - - void send_server_packet(AOPacket *p_packet); - - void call_settings_menu(); - void call_announce_menu(Courtroom *court); - - qint64 latency = 0; - QString window_title; - - /// Stores everything related to the server the client is connected to, if - /// any. - server::ServerData m_serverdata; - - ///////////////loading info/////////////////// - - // client ID. Not useful, to be removed eventually - int client_id = 0; - - /// Used for a fancy loading bar upon joining a server. - int generated_chars = 0; - - bool courtroom_loaded = false; - - /** - * @brief Returns the version string of the software. - * - * @return The string "X.Y.Z", where X is the release of the software (usually - * '2'), Y is the major version, and Z is the minor version. - */ - static QString get_version_string(); - - static const int RELEASE = 2; - static const int MAJOR_VERSION = 10; - static const int MINOR_VERSION = 1; - - // Adds the server to favorite_servers.ini - void add_favorite_server(int p_server); - void remove_favorite_server(int p_server); - - void set_server_list(QVector<server_type> &servers) { server_list = servers; } - QVector<server_type> &get_server_list() { return server_list; } - - // Returns the character the player has currently selected - QString get_current_char(); - - // implementation in path_functions.cpp - VPath get_theme_path(QString p_file, QString p_theme=""); - VPath get_character_path(QString p_char, QString p_file); - VPath get_misc_path(QString p_misc, QString p_file); - VPath get_sounds_path(QString p_file); - VPath get_music_path(QString p_song); - VPath get_background_path(QString p_file); - VPath get_default_background_path(QString p_file); - VPath get_evidence_path(QString p_file); - QVector<VPath> get_asset_paths(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); - QString get_asset_path(QVector<VPath> pathlist); - QString get_image_path(QVector<VPath> pathlist, bool static_image=false); - QString get_sfx_path(QVector<VPath> pathlist); - QString get_config_value(QString p_identifier, QString p_config, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc=""); - QString get_asset(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder=""); - QString get_image(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder="", bool static_image=false); - QString get_sfx(QString p_sfx, QString p_misc="", QString p_character=""); - QString get_pos_path(const QString& pos, bool desk = false); - QString get_case_sensitive_path(QString p_file); - QString get_real_path(const VPath &vpath, const QStringList &suffixes={""}); - void invalidate_lookup_cache(); - - ////// Functions for reading and writing files ////// - // Implementations file_functions.cpp - - // returns all of the file's lines in a QStringList - QStringList get_list_file(VPath path); - QStringList get_list_file(QString p_file); - - // 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); - - // Append to the currently open demo file if there is one - void append_to_demofile(QString packet_string); - - /** - * @brief Reads the clients log folder and locates potential demo files to populate the demoserver list. - * - * @return A seperated list of servernames and demo logfile filenames. - * - * @details This is to remove the need of delimiters or deal with potential - * harmfully encoding or plattform differences. We always get a combo of servername and filename. - * - * Do note this function assumes all demo files have the .demo extension. - * - */ - QMultiMap<QString, QString> load_demo_logs_list() const; - - // Returns the value of p_identifier in the design.ini file in p_design_path - QString read_design_ini(QString p_identifier, VPath 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 dimensions of widget with specified identifier from p_file - pos_size_type get_element_dimensions(QString p_identifier, QString p_file, - QString p_misc = ""); - - // Returns the value to you - QString get_design_element(QString p_identifier, QString p_file, - QString p_misc = ""); - - // 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 markup symbol used for specified p_identifier such as colors - QString get_chat_markup(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 value with p_identifier from penalty/penalty.ini in the current - // theme path - QString get_penalty_value(QString p_identifier); - - // Returns the sfx with p_identifier from courtroom_sounds.ini in the current theme path - QString get_court_sfx(QString p_identifier, QString p_misc=""); - - // Figure out if we can opus this or if we should fall back to wav - QString get_sfx_suffix(VPath 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(VPath path_to_check, bool static_image=false); - - // 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(VPath 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); - - // 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 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, int p_emote = -1); - - // Returns the category of this character - QString get_category(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 size from the specific p_char's ini file - int get_chat_size(QString p_char); - - // Returns the preanim duration of p_char's p_emote - int get_preanim_duration(QString p_char, QString p_emote); - - // Not in use - int get_text_delay(QString p_char, QString p_emote); - - // 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 correct effect image - QString get_effect(QString effect, QString p_char, QString p_folder); - - // Return p_property of fx_name. If p_property is "sound", return - // the value associated with fx_name, otherwise use fx_name + '_' + p_property. - QString get_effect_property(QString fx_name, QString p_char, QString p_folder, QString p_property); - - // Returns the custom realisation used by the character. - QString get_custom_realization(QString p_char); - - // Returns whether the given pos is a judge position - bool get_pos_is_judge(const QString &p_pos); - - // 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 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 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, 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); - - // 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); - - // 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 p_char's blipname by reading char.ini for blips (previously called "gender") - QString get_blipname(QString p_char, int p_emote = -1); - - // Returns p_blipname's sound(path) to play in the client - QString get_blips(QString p_blipname); - - // Get a property of a given emote, or get it from "options" if emote doesn't have it - QString get_emote_property(QString p_char, QString p_emote, QString p_property); - - // Return a transformation mode from a string ("smooth" for smooth, anything else for fast) - Qt::TransformationMode get_scaling(QString p_scaling); - - // Returns the scaling type for p_miscname - Qt::TransformationMode get_misc_scaling(QString p_miscname); - - // ====== - // These are all casing-related settings. - // ====== - - // Currently defined subtheme - QString subtheme; - - //Default is always default. - const QString default_theme = "default"; - - // The file name of the log file in base/logs. - QString log_filename; - - void initBASS(); - static void load_bass_plugins(); - static void CALLBACK BASSreset(HSTREAM handle, DWORD channel, DWORD data, - void *user); - static void doBASSreset(); - - QElapsedTimer demo_timer; - DemoServer* demo_server = nullptr; - -private: - QVector<server_type> server_list; - QHash<uint, QString> asset_lookup_cache; - QHash<uint, QString> dir_listing_cache; - QSet<uint> dir_listing_exist_cache; - -public slots: - void server_disconnected(); - void loading_cancelled(); - -signals: - void qt_log_message(QtMsgType type, const QMessageLogContext &context, - const QString &msg); -}; - -#endif // AOAPPLICATION_H diff --git a/include/aoblipplayer.h b/include/aoblipplayer.h deleted file mode 100644 index ea2dcd38..00000000 --- a/include/aoblipplayer.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef AOBLIPPLAYER_H -#define AOBLIPPLAYER_H - -#include "bass.h" -#include "bassopus.h" - -#include "aoapplication.h" - -#include <QDebug> -#include <QElapsedTimer> -#include <QWidget> -#include <string.h> - -class AOBlipPlayer { -public: - AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app); - - void set_blips(QString p_sfx); - void blip_tick(); - void set_volume(int p_volume); - void set_muted(bool toggle); - - int m_cycle = 0; - -private: - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume; - - bool m_muted = false; - - void set_volume_internal(qreal p_volume); - - HSTREAM m_stream_list[5]; -}; - -#endif // AOBLIPPLAYER_H diff --git a/include/aobutton.h b/include/aobutton.h deleted file mode 100644 index f1ae8b7f..00000000 --- a/include/aobutton.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef AOBUTTON_H -#define AOBUTTON_H - -#include "aoapplication.h" - -#include <QDebug> -#include <QPushButton> -#include <QMovie> - -class AOButton : public QPushButton { - Q_OBJECT - -public: - AOButton(QWidget *parent, AOApplication *p_ao_app); - ~AOButton(); - - AOApplication *ao_app; - QMovie *movie; - - void set_image(QString p_image, QString p_misc=""); -}; - -#endif // AOBUTTON_H diff --git a/include/aocharbutton.h b/include/aocharbutton.h deleted file mode 100644 index 688d52d6..00000000 --- a/include/aocharbutton.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef AOCHARBUTTON_H -#define AOCHARBUTTON_H - -#include "aoapplication.h" -#include "aoimage.h" - -#include <QFile> -#include <QPushButton> -#include <QEnterEvent> -#include <QString> -#include <QWidget> - -class AOCharButton : public QPushButton { - Q_OBJECT - -public: - AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, - bool is_taken); - - AOApplication *ao_app; - - void refresh(); - void reset(); - void set_taken(bool is_taken); - void set_passworded(); - - void apply_taken_image(); - - void set_image(QString p_character); - -private: - bool taken; - - QWidget *m_parent; - - AOImage *ui_taken; - AOImage *ui_passworded; - AOImage *ui_selector; - -protected: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void enterEvent(QEvent *e) override; -#else - void enterEvent(QEnterEvent *e) override; -#endif - void leaveEvent(QEvent *e) override; -}; - -#endif // AOCHARBUTTON_H diff --git a/include/aoclocklabel.h b/include/aoclocklabel.h deleted file mode 100644 index 830fb527..00000000 --- a/include/aoclocklabel.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef AOCLOCKLABEL_H -#define AOCLOCKLABEL_H - -#include <QLabel> -#include <QBasicTimer> -#include <QTimerEvent> -#include <QDateTime> -#include <QDebug> - -class AOClockLabel : public QLabel { - Q_OBJECT - -public: - AOClockLabel(QWidget *parent); - void start(); - void start(qint64 msecs); - void set(qint64 msecs, bool update_text = false); - void pause(); - void stop(); - void skip(qint64 msecs); - bool active(); - -protected: - void timerEvent(QTimerEvent *event) override; - -private: - QBasicTimer timer; - QDateTime target_time; -}; - -#endif // AOCLOCKLABEL_H diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h deleted file mode 100644 index edabfb65..00000000 --- a/include/aoemotebutton.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef AOEMOTEBUTTON_H -#define AOEMOTEBUTTON_H - -#include "aoapplication.h" -#include <QPainter> -#include <QDebug> -#include <QPushButton> -#include <QLabel> - -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); - - void set_image(QString p_image, QString p_emote_comment); - void set_char_image(QString p_char, int p_emote, bool on); - - void set_selected_image(QString p_image); - - void set_id(int p_id) { m_id = p_id; } - int get_id() { return m_id; } - -private: - QWidget *parent; - AOApplication *ao_app; - QLabel *ui_selected = nullptr; - - int m_id = 0; -signals: - void emote_clicked(int p_id); - -private slots: - void on_clicked(); -}; - -#endif // AOEMOTEBUTTON_H diff --git a/include/aoemotepreview.h b/include/aoemotepreview.h deleted file mode 100644 index 315371b3..00000000 --- a/include/aoemotepreview.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef AOEMOTEPREVIEW_H -#define AOEMOTEPREVIEW_H - -#include "aolayer.h" -#include <QWidget> - -class AOEmotePreview : public QWidget -{ - Q_OBJECT -public: - AOEmotePreview(QWidget *parent = nullptr, - AOApplication *p_ao_app = nullptr); - - void set_widgets(); - void play(QString emote, QString char_name, bool flipped = false, int self_offset = 0, int self_offset_v = 0); -private: - AOApplication *ao_app; - QWidget *ui_viewport; - BackgroundLayer *ui_vp_background; - SplashLayer *ui_vp_speedlines; - CharLayer *ui_vp_player_char; - BackgroundLayer *ui_vp_desk; - - QLabel *ui_size_label; - - QString m_emote = ""; - QString m_char = ""; -protected: - void resizeEvent(QResizeEvent *); -}; - -#endif // AOEMOTEPREVIEW_H diff --git a/include/aoevidencebutton.h b/include/aoevidencebutton.h deleted file mode 100644 index f0e13531..00000000 --- a/include/aoevidencebutton.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef AOEVIDENCEBUTTON_H -#define AOEVIDENCEBUTTON_H - -#include "aoapplication.h" -#include "aoimage.h" - -#include <QDebug> -#include <QPushButton> -#include <QEnterEvent> -#include <QString> - -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); - - 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); - -private: - AOApplication *ao_app; - QWidget *m_parent; - - AOImage *ui_selected; - AOImage *ui_selector; - - int m_id = 0; - -protected: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void enterEvent(QEvent *e) override; -#else - void enterEvent(QEnterEvent *e) override; -#endif - void leaveEvent(QEvent *e) override; - void mouseDoubleClickEvent(QMouseEvent *e) override; - /* -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); - -private slots: - void on_clicked(); -}; - -#endif // AOEVIDENCEBUTTON_H diff --git a/include/aoevidencedisplay.h b/include/aoevidencedisplay.h deleted file mode 100644 index df4a0377..00000000 --- a/include/aoevidencedisplay.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef AOEVIDENCEDISPLAY_H -#define AOEVIDENCEDISPLAY_H - -#include "aoapplication.h" -#include "aolayer.h" -#include "aosfxplayer.h" - -#include <QDebug> -#include <QLabel> -#include <QPushButton> - -class AOEvidenceDisplay : public QLabel { - Q_OBJECT - -public: - AOEvidenceDisplay(QWidget *p_parent, AOApplication *p_ao_app); - - void show_evidence(int p_index, QString p_evidence_image, bool is_left_side, int p_volume); - void reset(); - void combo_resize(int w, int h); - -signals: - void show_evidence_details(int index); - -private: - AOApplication *ao_app; - InterfaceLayer *evidence_movie; - QPushButton *evidence_icon; - AOSfxPlayer *sfx_player; - int last_evidence_index = -1; - -private slots: - void show_done(); - void icon_clicked(); -}; - -#endif // AOEVIDENCEDISPLAY_H diff --git a/include/aoimage.h b/include/aoimage.h deleted file mode 100644 index 38729d70..00000000 --- a/include/aoimage.h +++ /dev/null @@ -1,31 +0,0 @@ -// This class represents a static theme-dependent image - -#ifndef AOIMAGE_H -#define AOIMAGE_H - -#include "aoapplication.h" - -#include <QDebug> -#include <QLabel> -#include <QMovie> - -class AOImage : public QLabel { -public: - AOImage(QWidget *parent, AOApplication *p_ao_app, bool make_static = false); - ~AOImage(); - - QWidget *m_parent; - AOApplication *ao_app; - QMovie *movie; - - QString path; - - bool is_static = false; - - bool masked = false; - - bool set_image(QString p_image, QString p_misc = ""); - void set_size_and_pos(QString identifier); -}; - -#endif // AOIMAGE_H diff --git a/include/aolayer.h b/include/aolayer.h deleted file mode 100644 index 19dce38b..00000000 --- a/include/aolayer.h +++ /dev/null @@ -1,255 +0,0 @@ -#ifndef AOLAYER_H -#define AOLAYER_H - -#include <QDebug> -#include <QElapsedTimer> -#include <QImageReader> -#include <QLabel> -#include <QTimer> -#include <QBitmap> -#include <QtConcurrent/QtConcurrentRun> -#include <QMutex> -#include <QWaitCondition> - -class AOApplication; -class VPath; - -// "Brief" explanation of what the hell this is: -// -// AOLayer handles all animations both inside and outside -// the viewport. It was originally devised as a layering -// system, but turned into a full refactor of the existing -// animation code. -// -// AOLayer has six subclasses, all of which differ mainly in -// how they handle path resolution. -// -// - BackgroundLayer: self-explanatory, handles files found in base/background -// - CharLayer: handles all the "wonderful" quirks of character path resolution -// - SplashLayer: handles elements that can either be provided by a misc/ directory -// or by the theme - speedlines, shouts, WT/CE, et cetera -// - EffectLayer: this is basically a dummy layer since effects do their own wonky -// path resolution in a different file -// - InterfaceLayer: handles UI elements like the chat arrow and the music display -// - StickerLayer: Crystalwarrior really wanted this. Handles "stickers," whatever those are. -// -// For questions comments or concerns, bother someone else - -class AOLayer : public QLabel { - Q_OBJECT - -public: - AOLayer(QWidget *p_parent, AOApplication *p_ao_app); - - QString filename; // file name without extension, i.e. "witnesstestimony" - int static_duration; // time in ms for static images to be displayed, if - // applicable. set to 0 for infinite - int max_duration; // maximum duration in ms, image will be culled if it is - // exceeded. set this to 0 for infinite duration - bool play_once = false; // Whether to loop this animation or not - bool cull_image = true; // if we're done playing this animation, should we - // hide it? also controls durational culling - // Are we loading this from the same frame we left off on? - bool continuous = false; - // Whether or not to forcibly bypass the simple check done by start_playback - // and use the existent value of continuous instead - bool force_continuous = false; - Qt::TransformationMode transform_mode = Qt::FastTransformation; // transformation mode to use for this image - bool stretch = false; // Should we stretch/squash this image to fill the screen? - bool masked = true; // Set a mask to the dimensions of the widget? - - // Set the movie's image to provided paths, preparing for playback. - void start_playback(QString p_image); - - void set_play_once(bool p_play_once); - void set_cull_image(bool p_cull_image); - void set_static_duration(int p_static_duration); - void set_max_duration(int p_max_duration); - - // Stop the movie, clearing the image - void stop(); - - // Stop the movie and clear all vectors - void kill(); - - // 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); - - // Move the label and center it - void move_and_center(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); - - // iterate through a list of paths and return the first entry that exists. if - // none exist, return NULL (safe because we check again for existence later) - QString find_image(QStringList p_list); - -protected: - AOApplication *ao_app; - QVector<QPixmap> movie_frames; - QVector<int> movie_delays; - - QTimer *preanim_timer; - QTimer *shfx_timer; - QTimer *ticker; - QString last_path; - QImageReader m_reader; - - QElapsedTimer actual_time; - - // 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 last_max_frames = 0; - - int speed = 100; - - bool m_flipped = false; - - int duration = 0; - - // Start playback of the movie (if animated). - void play(); - - // Freeze the movie at the current frame. - void freeze(); - - // 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); - // Center the QLabel in the viewport based on the dimensions of f_pixmap - void center_pixmap(QPixmap f_pixmap); - -private: - // Populates the frame and delay vectors. - void populate_vectors(); - - // used in populate_vectors - void load_next_frame(); - std::atomic_bool exit_loop { false }; //awful solution but i'm not fucking using QThread - QFuture<void> frame_loader; - QMutex mutex; - QWaitCondition frameAdded; - - -signals: - void done(); - -protected slots: - virtual void preanim_done(); - void shfx_timer_done(); - virtual void movie_ticker(); -}; - -class BackgroundLayer : public AOLayer { - Q_OBJECT -public: - BackgroundLayer(QWidget *p_parent, AOApplication *p_ao_app); - void load_image(QString p_filename); -}; - -class CharLayer : public AOLayer { - Q_OBJECT -public: - CharLayer(QWidget *p_parent, AOApplication *p_ao_app); - QString current_emote = ""; // name of the emote we're using - bool is_preanim; // equivalent to the old play_once, if true we don't want - // to loop this - QString prefix = ""; // prefix, left blank if it's a preanim - - void load_image(QString p_filename, QString p_charname, int p_duration, bool p_is_preanim); - void play(); // overloaded so we can play effects - - // networked frame fx string - QStringList network_strings; - -private: - QString last_char; // name of the last character we used - QString last_emote; // name of the last animation we used - QString last_prefix; // prefix of the last animation we played - bool was_preanim = false; // whether is_preanim was true last time - - // 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<QVector<QString>> movie_effects; - - // used for effect loading - QString m_char = ""; - QString m_emote = ""; - - // overloaded for effects reasons - void start_playback(QString p_image); - - // 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(); - - // Play a frame-specific effect, if there's any defined for that specific - // frame. - void play_frame_effect(int p_frame); - -private slots: - void preanim_done() override; // overridden so we don't accidentally cull characters - void movie_ticker() override; // overridden so we can play effects - -signals: - void shake(); - void flash(); - void play_sfx(QString sfx); -}; - -class SplashLayer : public AOLayer { - Q_OBJECT -public: - SplashLayer(QWidget *p_parent, AOApplication *p_ao_app); - void load_image(QString p_filename, QString p_charname, QString p_miscname); -}; - -class EffectLayer : public AOLayer { - Q_OBJECT -public: - EffectLayer(QWidget *p_parent, AOApplication *p_ao_app); - void load_image(QString p_filename, bool p_looping); -}; - -class InterfaceLayer : public AOLayer { - Q_OBJECT -public: - InterfaceLayer(QWidget *p_parent, AOApplication *p_ao_app); - void load_image(QString p_filename, QString p_miscname); -}; - -class StickerLayer : public AOLayer { - Q_OBJECT -public: - StickerLayer(QWidget *p_parent, AOApplication *p_ao_app); - void load_image(QString p_charname); -}; - -#endif // AOLAYER_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h deleted file mode 100644 index d0288443..00000000 --- a/include/aomusicplayer.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef AOMUSICPLAYER_H -#define AOMUSICPLAYER_H -#include "aoapplication.h" - -#include <QDebug> -#include <QWidget> -#include <string.h> -#include <QFuture> -#include <QFutureWatcher> - -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 loop_song, int channel = 0); - void set_muted(bool toggle); - - const int m_channelmax = 4; - - QFutureWatcher<QString> music_watcher; - -public slots: - QString 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; - - bool m_muted = 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]; - - /** - * @brief The starting sample of the AB-Loop. - */ - unsigned int loop_start[4] = {0, 0, 0, 0}; - - /** - * @brief The end sample of the AB-Loop. - */ - unsigned int loop_end[4] = {0, 0, 0, 0}; -}; - -#endif // AOMUSICPLAYER_H diff --git a/include/aopacket.h b/include/aopacket.h deleted file mode 100644 index d5baccb5..00000000 --- a/include/aopacket.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef AOPACKET_H -#define AOPACKET_H - -#include <QDebug> -#include <QString> -#include <QStringList> - -class AOPacket { -public: - AOPacket(QString header) : m_header(header){} - AOPacket(QString header, QStringList p_contents) : m_header(header), m_contents(p_contents){} - - QString get_header() { return m_header; } - QStringList &get_contents() { return m_contents; } - QString to_string(bool encoded = false); - - void net_encode(); - void net_decode(); - - static void escape(QStringList &contents); - static void unescape(QStringList &contents); -private: - - QString m_header; - QStringList m_contents; -}; - -#endif // AOPACKET_H diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h deleted file mode 100644 index 077a7efd..00000000 --- a/include/aosfxplayer.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef AOSFXPLAYER_H -#define AOSFXPLAYER_H - -#include "bass.h" -#include "bassopus.h" - -#include "aoapplication.h" - -#include <QDebug> -#include <QWidget> -#include <string.h> - -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 = ""); - void stop(int channel = -1); - void set_volume(qreal p_volume); - void set_looping(bool toggle, int channel = -1); - void set_muted(bool toggle); - int m_channel = 0; - int get_volume() { return m_volume * 100; }; -private: - QWidget *m_parent; - AOApplication *ao_app; - qreal m_volume = 0; - - bool m_looping = true; - bool m_muted = false; - void set_volume_internal(qreal p_volume); - - const int m_channelmax = 5; - - HSTREAM m_stream_list[5]; -}; - -#endif // AOSFXPLAYER_H diff --git a/include/aotextarea.h b/include/aotextarea.h deleted file mode 100644 index 405f4eb4..00000000 --- a/include/aotextarea.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef AOTEXTAREA_H -#define AOTEXTAREA_H - -#include <QDebug> -#include <QRegularExpression> -#include <QScrollBar> -#include <QTextBrowser> -#include <QTextCursor> - -class AOTextArea : public QTextBrowser { -public: - AOTextArea(QWidget *p_parent = nullptr, int p_log_length = 5000); - - void append_linked(QString p_message); - void append_chatmessage(QString p_name, QString p_message, - QString p_name_colour, QString p_color = QString()); - void append_error(QString p_message); - -private: - const QRegularExpression url_parser_regex = QRegularExpression("\\b(https?://\\S+\\.\\S+)\\b"); - - void auto_scroll(QTextCursor old_cursor, int scrollbar_value, - bool is_scrolled_down); -}; - -#endif // AOTEXTAREA_H diff --git a/include/aotextboxwidgets.h b/include/aotextboxwidgets.h deleted file mode 100644 index 39bf4062..00000000 --- a/include/aotextboxwidgets.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef AOTEXTBOXWIDGETS_H -#define AOTEXTBOXWIDGETS_H - -#include <QAbstractTextDocumentLayout> -#include <QDebug> -#include <QLabel> -#include <QPaintEvent> -#include <QPainter> -#include <QPainterPath> -#include <QTextEdit> - -class AOChatboxLabel : public QLabel { - Q_OBJECT - -public: - AOChatboxLabel(QWidget *parent); - void paintEvent(QPaintEvent *event); - - void setOutlineColor(QColor color) { outline_color = color; }; - void setOutlineWidth(int width) { outline_width = width; }; - void setTextColor(QColor color) { text_color = color; }; - void setIsOutlined(bool outlined) { is_outlined = outlined; }; - -protected: -private: - QColor outline_color; - QColor text_color; - int outline_width = 1; - bool is_outlined = false; -}; - -#endif // AOTEXTBOXWIDGETS_H diff --git a/include/aoutils.h b/include/aoutils.h deleted file mode 100644 index a4fd7bb8..00000000 --- a/include/aoutils.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef AOUTILS_H -#define AOUTILS_H - -#include <QSettings> - -namespace AOUtils -{ -/** - * @brief Migrates the effects from the old format to version 2. - * @param QSettings object reference of the old effects.ini - */ -void migrateEffects(QSettings &p_fileName); -}; - -#endif // AOUTILS_H diff --git a/include/bass.h b/include/bass.h deleted file mode 100644 index ec2c7a29..00000000 --- a/include/bass.h +++ /dev/null @@ -1,1227 +0,0 @@ -/* - BASS 2.4 C/C++ header file - Copyright (c) 1999-2019 Un4seen Developments Ltd. - - See the BASS.CHM file for more detailed documentation -*/ - -#ifndef BASS_H -#define BASS_H - -#ifdef _WIN32 -#include <wtypes.h> -typedef unsigned __int64 QWORD; -#else -#include <stdint.h> -#define WINAPI -#define CALLBACK -typedef uint8_t BYTE; -typedef uint16_t WORD; -typedef uint32_t DWORD; -typedef uint64_t QWORD; -#ifndef __OBJC__ -typedef int BOOL; -#endif -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif -#define LOBYTE(a) (BYTE)(a) -#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)) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define BASSVERSION 0x204 // API version -#define BASSVERSIONTEXT "2.4" - -#ifndef BASSDEF -#define BASSDEF(f) WINAPI f -#else -#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 - -// 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 - -// 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 - -// 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 -#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 - -// 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 -#else - const char *name; // description - const char *driver; // driver -#endif - 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 - -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 -} 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 - -// 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 -} 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 - -// 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 */ -#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) -} 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 - -// 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 - -// 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 - -// 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 -} BASS_CHANNELINFO; - -#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 - -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...) -#else - 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 -} 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){}; -#endif - 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 - -// 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 - -// 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 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); -/* 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 - -// 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 - -// BASS_StreamCreateFileUser file systems -#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 struct { - FILECLOSEPROC *close; - FILELENPROC *length; - FILEREADPROC *read; - FILESEEKPROC *seek; -} BASS_FILEPROCS; - -// BASS_StreamPutFileData options -#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); -/* 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); -/* 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 -it's finished either. -handle : The sync that has occured -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); -/* 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. -handle : The DSP handle -channel: Channel that the DSP is being applied to -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); -/* Recording callback function. -handle : The recording handle -buffer : Buffer containing the recorded sample data -length : Number of bytes -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 - -// 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_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 # - -// BASS_ChannelSlideAttribute flags -#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 - -// BASS_ChannelGetLevelEx flags -#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 - -// 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; -} TAG_ID3; - -// Binary APE 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) -#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]; -#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 -#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 - -// CoreAudio codec info structure -typedef struct { - 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 - -// 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 - -// BASS_ChannelSetDevice/GetDevice option -#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 - -// 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 - -typedef struct { - 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; -} BASS_DX8_COMPRESSOR; - -typedef struct { - 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; -} 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 -} BASS_DX8_FLANGER; - -typedef struct { - 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 -} BASS_DX8_I3DL2REVERB; - -typedef struct { - 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 -} 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 - -typedef struct { - 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 - -BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value); -DWORD BASSDEF(BASS_GetConfig)(DWORD option); -BOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value); -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); -#else -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) -void *BASSDEF(BASS_GetDSoundObject)(DWORD object); -#endif -BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); -BOOL BASSDEF(BASS_Update)(DWORD length); -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)(); - -HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); -BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle); -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); -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); -#endif - -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); -BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle); -BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer); -BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer); -BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info); -BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info); -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); -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); - -BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); -BOOL BASSDEF(BASS_RecordInit)(int device); -BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device); -DWORD BASSDEF(BASS_RecordGetDevice)(); -BOOL BASSDEF(BASS_RecordFree)(); -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); - -double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos); -QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos); -DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle); -BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device); -DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle); -BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info); -const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags); -DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask); -BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length); -BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock); -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_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); -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); -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); -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); -HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority); -BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx); - -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 -#endif - -#endif diff --git a/include/bassmidi.h b/include/bassmidi.h deleted file mode 100644 index 72ebe9c0..00000000 --- a/include/bassmidi.h +++ /dev/null @@ -1,380 +0,0 @@ -/* - BASSMIDI 2.4 C/C++ header file - Copyright (c) 2006-2020 Un4seen Developments Ltd. - - See the BASSMIDI.CHM file for more detailed documentation -*/ - -#ifndef BASSMIDI_H -#define BASSMIDI_H - -#include "bass.h" - -#if BASSVERSION!=0x204 -#error conflicting BASS and BASSMIDI versions -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef BASSMIDIDEF -#define BASSMIDIDEF(f) WINAPI f -#endif - -typedef DWORD HSOUNDFONT; // soundfont handle - -// Additional error codes returned by BASS_ErrorGetCode -#define BASS_ERROR_MIDI_INCLUDE 7000 // SFZ include file could not be opened - -// Additional BASS_SetConfig options -#define BASS_CONFIG_MIDI_COMPACT 0x10400 -#define BASS_CONFIG_MIDI_VOICES 0x10401 -#define BASS_CONFIG_MIDI_AUTOFONT 0x10402 -#define BASS_CONFIG_MIDI_IN_PORTS 0x10404 -#define BASS_CONFIG_MIDI_SAMPLETHREADS 0x10406 -#define BASS_CONFIG_MIDI_SAMPLEMEM 0x10407 -#define BASS_CONFIG_MIDI_SAMPLEREAD 0x10408 - -// Additional BASS_SetConfigPtr options -#define BASS_CONFIG_MIDI_DEFFONT 0x10403 -#define BASS_CONFIG_MIDI_SFZHEAD 0x10408 - -// Additional sync types -#define BASS_SYNC_MIDI_MARK 0x10000 -#define BASS_SYNC_MIDI_MARKER 0x10000 -#define BASS_SYNC_MIDI_CUE 0x10001 -#define BASS_SYNC_MIDI_LYRIC 0x10002 -#define BASS_SYNC_MIDI_TEXT 0x10003 -#define BASS_SYNC_MIDI_EVENT 0x10004 -#define BASS_SYNC_MIDI_TICK 0x10005 -#define BASS_SYNC_MIDI_TIMESIG 0x10006 -#define BASS_SYNC_MIDI_KEYSIG 0x10007 - -// Additional BASS_MIDI_StreamCreateFile/etc flags -#define BASS_MIDI_NOSYSRESET 0x800 -#define BASS_MIDI_DECAYEND 0x1000 -#define BASS_MIDI_NOFX 0x2000 -#define BASS_MIDI_DECAYSEEK 0x4000 -#define BASS_MIDI_NOCROP 0x8000 -#define BASS_MIDI_NOTEOFF1 0x10000 -#define BASS_MIDI_SINCINTER 0x800000 - -// BASS_MIDI_FontInit flags -#define BASS_MIDI_FONT_MEM 0x10000 -#define BASS_MIDI_FONT_MMAP 0x20000 -#define BASS_MIDI_FONT_XGDRUMS 0x40000 -#define BASS_MIDI_FONT_NOFX 0x80000 -#define BASS_MIDI_FONT_LINATTMOD 0x100000 -#define BASS_MIDI_FONT_LINDECVOL 0x200000 -#define BASS_MIDI_FONT_NORAMPIN 0x400000 -#define BASS_MIDI_FONT_NOLIMITS 0x800000 - -typedef struct { - HSOUNDFONT font; // soundfont - int preset; // preset number (-1=all) - int bank; -} BASS_MIDI_FONT; - -typedef struct { - HSOUNDFONT font; // soundfont - int spreset; // source preset number - int sbank; // source bank number - int dpreset; // destination preset/program number - int dbank; // destination bank number - int dbanklsb; // destination bank number LSB -} BASS_MIDI_FONTEX; - -// BASS_MIDI_StreamSet/GetFonts flag -#define BASS_MIDI_FONT_EX 0x1000000 // BASS_MIDI_FONTEX - -typedef struct { - const char *name; - const char *copyright; - const char *comment; - DWORD presets; // number of presets/instruments - DWORD samsize; // total size (in bytes) of the sample data - DWORD samload; // amount of sample data currently loaded - DWORD samtype; // sample format (CTYPE) if packed -} BASS_MIDI_FONTINFO; - -typedef struct { - DWORD track; // track containing marker - DWORD pos; // marker position - const char *text; // marker text -} BASS_MIDI_MARK; - -// Marker types -#define BASS_MIDI_MARK_MARKER 0 // marker -#define BASS_MIDI_MARK_CUE 1 // cue point -#define BASS_MIDI_MARK_LYRIC 2 // lyric -#define BASS_MIDI_MARK_TEXT 3 // text -#define BASS_MIDI_MARK_TIMESIG 4 // time signature -#define BASS_MIDI_MARK_KEYSIG 5 // key signature -#define BASS_MIDI_MARK_COPY 6 // copyright notice -#define BASS_MIDI_MARK_TRACK 7 // track name -#define BASS_MIDI_MARK_INST 8 // instrument name -#define BASS_MIDI_MARK_TRACKSTART 9 // track start (SMF2) -#define BASS_MIDI_MARK_TICK 0x10000 // flag: get position in ticks (otherwise bytes) - -// MIDI events -#define MIDI_EVENT_NOTE 1 -#define MIDI_EVENT_PROGRAM 2 -#define MIDI_EVENT_CHANPRES 3 -#define MIDI_EVENT_PITCH 4 -#define MIDI_EVENT_PITCHRANGE 5 -#define MIDI_EVENT_DRUMS 6 -#define MIDI_EVENT_FINETUNE 7 -#define MIDI_EVENT_COARSETUNE 8 -#define MIDI_EVENT_MASTERVOL 9 -#define MIDI_EVENT_BANK 10 -#define MIDI_EVENT_MODULATION 11 -#define MIDI_EVENT_VOLUME 12 -#define MIDI_EVENT_PAN 13 -#define MIDI_EVENT_EXPRESSION 14 -#define MIDI_EVENT_SUSTAIN 15 -#define MIDI_EVENT_SOUNDOFF 16 -#define MIDI_EVENT_RESET 17 -#define MIDI_EVENT_NOTESOFF 18 -#define MIDI_EVENT_PORTAMENTO 19 -#define MIDI_EVENT_PORTATIME 20 -#define MIDI_EVENT_PORTANOTE 21 -#define MIDI_EVENT_MODE 22 -#define MIDI_EVENT_REVERB 23 -#define MIDI_EVENT_CHORUS 24 -#define MIDI_EVENT_CUTOFF 25 -#define MIDI_EVENT_RESONANCE 26 -#define MIDI_EVENT_RELEASE 27 -#define MIDI_EVENT_ATTACK 28 -#define MIDI_EVENT_DECAY 29 -#define MIDI_EVENT_REVERB_MACRO 30 -#define MIDI_EVENT_CHORUS_MACRO 31 -#define MIDI_EVENT_REVERB_TIME 32 -#define MIDI_EVENT_REVERB_DELAY 33 -#define MIDI_EVENT_REVERB_LOCUTOFF 34 -#define MIDI_EVENT_REVERB_HICUTOFF 35 -#define MIDI_EVENT_REVERB_LEVEL 36 -#define MIDI_EVENT_CHORUS_DELAY 37 -#define MIDI_EVENT_CHORUS_DEPTH 38 -#define MIDI_EVENT_CHORUS_RATE 39 -#define MIDI_EVENT_CHORUS_FEEDBACK 40 -#define MIDI_EVENT_CHORUS_LEVEL 41 -#define MIDI_EVENT_CHORUS_REVERB 42 -#define MIDI_EVENT_USERFX 43 -#define MIDI_EVENT_USERFX_LEVEL 44 -#define MIDI_EVENT_USERFX_REVERB 45 -#define MIDI_EVENT_USERFX_CHORUS 46 -#define MIDI_EVENT_DRUM_FINETUNE 50 -#define MIDI_EVENT_DRUM_COARSETUNE 51 -#define MIDI_EVENT_DRUM_PAN 52 -#define MIDI_EVENT_DRUM_REVERB 53 -#define MIDI_EVENT_DRUM_CHORUS 54 -#define MIDI_EVENT_DRUM_CUTOFF 55 -#define MIDI_EVENT_DRUM_RESONANCE 56 -#define MIDI_EVENT_DRUM_LEVEL 57 -#define MIDI_EVENT_DRUM_USERFX 58 -#define MIDI_EVENT_SOFT 60 -#define MIDI_EVENT_SYSTEM 61 -#define MIDI_EVENT_TEMPO 62 -#define MIDI_EVENT_SCALETUNING 63 -#define MIDI_EVENT_CONTROL 64 -#define MIDI_EVENT_CHANPRES_VIBRATO 65 -#define MIDI_EVENT_CHANPRES_PITCH 66 -#define MIDI_EVENT_CHANPRES_FILTER 67 -#define MIDI_EVENT_CHANPRES_VOLUME 68 -#define MIDI_EVENT_MOD_VIBRATO 69 -#define MIDI_EVENT_MODRANGE 69 -#define MIDI_EVENT_BANK_LSB 70 -#define MIDI_EVENT_KEYPRES 71 -#define MIDI_EVENT_KEYPRES_VIBRATO 72 -#define MIDI_EVENT_KEYPRES_PITCH 73 -#define MIDI_EVENT_KEYPRES_FILTER 74 -#define MIDI_EVENT_KEYPRES_VOLUME 75 -#define MIDI_EVENT_SOSTENUTO 76 -#define MIDI_EVENT_MOD_PITCH 77 -#define MIDI_EVENT_MOD_FILTER 78 -#define MIDI_EVENT_MOD_VOLUME 79 -#define MIDI_EVENT_VIBRATO_RATE 80 -#define MIDI_EVENT_VIBRATO_DEPTH 81 -#define MIDI_EVENT_VIBRATO_DELAY 82 -#define MIDI_EVENT_MIXLEVEL 0x10000 -#define MIDI_EVENT_TRANSPOSE 0x10001 -#define MIDI_EVENT_SYSTEMEX 0x10002 -#define MIDI_EVENT_SPEED 0x10004 - -#define MIDI_EVENT_END 0 -#define MIDI_EVENT_END_TRACK 0x10003 - -#define MIDI_EVENT_NOTES 0x20000 -#define MIDI_EVENT_VOICES 0x20001 - -#define MIDI_SYSTEM_DEFAULT 0 -#define MIDI_SYSTEM_GM1 1 -#define MIDI_SYSTEM_GM2 2 -#define MIDI_SYSTEM_XG 3 -#define MIDI_SYSTEM_GS 4 - -typedef struct { - DWORD event; // MIDI_EVENT_xxx - DWORD param; - DWORD chan; - DWORD tick; // event position (ticks) - DWORD pos; // event position (bytes) -} BASS_MIDI_EVENT; - -// BASS_MIDI_StreamEvents modes -#define BASS_MIDI_EVENTS_STRUCT 0 // BASS_MIDI_EVENT structures -#define BASS_MIDI_EVENTS_RAW 0x10000 // raw MIDI event data -#define BASS_MIDI_EVENTS_SYNC 0x1000000 // flag: trigger event syncs -#define BASS_MIDI_EVENTS_NORSTATUS 0x2000000 // flag: no running status -#define BASS_MIDI_EVENTS_CANCEL 0x4000000 // flag: cancel pending events -#define BASS_MIDI_EVENTS_TIME 0x8000000 // flag: delta-time info is present -#define BASS_MIDI_EVENTS_ABSTIME 0x10000000 // flag: absolute time info is present - -// BASS_MIDI_StreamGetChannel special channels -#define BASS_MIDI_CHAN_CHORUS (DWORD)-1 -#define BASS_MIDI_CHAN_REVERB (DWORD)-2 -#define BASS_MIDI_CHAN_USERFX (DWORD)-3 - -// BASS_CHANNELINFO type -#define BASS_CTYPE_STREAM_MIDI 0x10d00 - -// Additional attributes -#define BASS_ATTRIB_MIDI_PPQN 0x12000 -#define BASS_ATTRIB_MIDI_CPU 0x12001 -#define BASS_ATTRIB_MIDI_CHANS 0x12002 -#define BASS_ATTRIB_MIDI_VOICES 0x12003 -#define BASS_ATTRIB_MIDI_VOICES_ACTIVE 0x12004 -#define BASS_ATTRIB_MIDI_STATE 0x12005 -#define BASS_ATTRIB_MIDI_SRC 0x12006 -#define BASS_ATTRIB_MIDI_KILL 0x12007 -#define BASS_ATTRIB_MIDI_SPEED 0x12008 -#define BASS_ATTRIB_MIDI_REVERB 0x12009 -#define BASS_ATTRIB_MIDI_VOL 0x1200a -#define BASS_ATTRIB_MIDI_TRACK_VOL 0x12100 // + track # - -// Additional tag type -#define BASS_TAG_MIDI_TRACK 0x11000 // + track #, track text : array of null-terminated ANSI strings - -// BASS_ChannelGetLength/GetPosition/SetPosition mode -#define BASS_POS_MIDI_TICK 2 // tick position - -typedef BOOL (CALLBACK MIDIFILTERPROC)(HSTREAM handle, DWORD track, BASS_MIDI_EVENT *event, BOOL seeking, void *user); -/* Event filtering callback function. -handle : MIDI stream handle -track : Track containing the event -event : The event -seeking: TRUE = the event is being processed while seeking, FALSE = it is being played -user : The 'user' parameter value given when calling BASS_MIDI_StreamSetFilter -RETURN : TRUE = process the event, FALSE = drop the event */ - -// BASS_MIDI_FontLoadEx flags -#define BASS_MIDI_FONTLOAD_NOWAIT 1 // don't want for the samples to load -#define BASS_MIDI_FONTLOAD_COMPACT 2 // compact samples -#define BASS_MIDI_FONTLOAD_NOLOAD 4 // don't load (only compact) -#define BASS_MIDI_FONTLOAD_TIME 8 // length is in milliseconds -#define BASS_MIDI_FONTLOAD_KEEPDEC 16 // keep decoders - -// BASS_MIDI_FontPack flags -#define BASS_MIDI_PACK_NOHEAD 1 // don't send a WAV header to the encoder -#define BASS_MIDI_PACK_16BIT 2 // discard low 8 bits of 24-bit sample data -#define BASS_MIDI_PACK_48KHZ 4 // set encoding rate to 48000 Hz (else 44100 Hz) - -typedef struct { - const char *name; // description - DWORD id; - DWORD flags; -} BASS_MIDI_DEVICEINFO; - -typedef void (CALLBACK MIDIINPROC)(DWORD device, double time, const BYTE *buffer, DWORD length, void *user); -/* MIDI input callback function. -device : MIDI input device -time : Timestamp -buffer : Buffer containing MIDI data -length : Number of bytes of data -user : The 'user' parameter value given when calling BASS_MIDI_InInit */ - -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamCreate)(DWORD channels, DWORD flags, DWORD freq); -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags, DWORD freq); -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user, DWORD freq); -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *procs, void *user, DWORD freq); -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamCreateEvents)(const BASS_MIDI_EVENT *events, DWORD ppqn, DWORD flags, DWORD freq); -BOOL BASSMIDIDEF(BASS_MIDI_StreamGetMark)(HSTREAM handle, DWORD type, DWORD index, BASS_MIDI_MARK *mark); -DWORD BASSMIDIDEF(BASS_MIDI_StreamGetMarks)(HSTREAM handle, int track, DWORD type, BASS_MIDI_MARK *marks); -BOOL BASSMIDIDEF(BASS_MIDI_StreamSetFonts)(HSTREAM handle, const void *fonts, DWORD count); -DWORD BASSMIDIDEF(BASS_MIDI_StreamGetFonts)(HSTREAM handle, void *fonts, DWORD count); -BOOL BASSMIDIDEF(BASS_MIDI_StreamLoadSamples)(HSTREAM handle); -BOOL BASSMIDIDEF(BASS_MIDI_StreamEvent)(HSTREAM handle, DWORD chan, DWORD event, DWORD param); -DWORD BASSMIDIDEF(BASS_MIDI_StreamEvents)(HSTREAM handle, DWORD mode, const void *events, DWORD length); -DWORD BASSMIDIDEF(BASS_MIDI_StreamGetEvent)(HSTREAM handle, DWORD chan, DWORD event); -DWORD BASSMIDIDEF(BASS_MIDI_StreamGetEvents)(HSTREAM handle, int track, DWORD filter, BASS_MIDI_EVENT *events); -DWORD BASSMIDIDEF(BASS_MIDI_StreamGetEventsEx)(HSTREAM handle, int track, DWORD filter, BASS_MIDI_EVENT *events, DWORD start, DWORD count); -BOOL BASSMIDIDEF(BASS_MIDI_StreamGetPreset)(HSTREAM handle, DWORD chan, BASS_MIDI_FONT *font); -HSTREAM BASSMIDIDEF(BASS_MIDI_StreamGetChannel)(HSTREAM handle, DWORD chan); -BOOL BASSMIDIDEF(BASS_MIDI_StreamSetFilter)(HSTREAM handle, BOOL seeking, MIDIFILTERPROC *proc, void *user); - -HSOUNDFONT BASSMIDIDEF(BASS_MIDI_FontInit)(const void *file, DWORD flags); -HSOUNDFONT BASSMIDIDEF(BASS_MIDI_FontInitUser)(const BASS_FILEPROCS *procs, void *user, DWORD flags); -BOOL BASSMIDIDEF(BASS_MIDI_FontFree)(HSOUNDFONT handle); -BOOL BASSMIDIDEF(BASS_MIDI_FontGetInfo)(HSOUNDFONT handle, BASS_MIDI_FONTINFO *info); -BOOL BASSMIDIDEF(BASS_MIDI_FontGetPresets)(HSOUNDFONT handle, DWORD *presets); -const char *BASSMIDIDEF(BASS_MIDI_FontGetPreset)(HSOUNDFONT handle, int preset, int bank); -BOOL BASSMIDIDEF(BASS_MIDI_FontLoad)(HSOUNDFONT handle, int preset, int bank); -BOOL BASSMIDIDEF(BASS_MIDI_FontLoadEx)(HSOUNDFONT handle, int preset, int bank, DWORD length, DWORD flags); -BOOL BASSMIDIDEF(BASS_MIDI_FontUnload)(HSOUNDFONT handle, int preset, int bank); -BOOL BASSMIDIDEF(BASS_MIDI_FontCompact)(HSOUNDFONT handle); -BOOL BASSMIDIDEF(BASS_MIDI_FontPack)(HSOUNDFONT handle, const void *outfile, const void *encoder, DWORD flags); -BOOL BASSMIDIDEF(BASS_MIDI_FontUnpack)(HSOUNDFONT handle, const void *outfile, DWORD flags); -BOOL BASSMIDIDEF(BASS_MIDI_FontSetVolume)(HSOUNDFONT handle, float volume); -float BASSMIDIDEF(BASS_MIDI_FontGetVolume)(HSOUNDFONT handle); - -DWORD BASSMIDIDEF(BASS_MIDI_ConvertEvents)(const BYTE *data, DWORD length, BASS_MIDI_EVENT *events, DWORD count, DWORD flags); - -BOOL BASSMIDIDEF(BASS_MIDI_InGetDeviceInfo)(DWORD device, BASS_MIDI_DEVICEINFO *info); -BOOL BASSMIDIDEF(BASS_MIDI_InInit)(DWORD device, MIDIINPROC *proc, void *user); -BOOL BASSMIDIDEF(BASS_MIDI_InFree)(DWORD device); -BOOL BASSMIDIDEF(BASS_MIDI_InStart)(DWORD device); -BOOL BASSMIDIDEF(BASS_MIDI_InStop)(DWORD device); - -#ifdef __cplusplus -} - -static inline BOOL BASS_MIDI_StreamSetFonts(HSTREAM handle, const BASS_MIDI_FONTEX *fonts, DWORD count) -{ - return BASS_MIDI_StreamSetFonts(handle, (const void*)fonts, count|BASS_MIDI_FONT_EX); -} - -static inline DWORD BASS_MIDI_StreamGetFonts(HSTREAM handle, BASS_MIDI_FONTEX *fonts, DWORD count) -{ - return BASS_MIDI_StreamGetFonts(handle, (void*)fonts, count|BASS_MIDI_FONT_EX); -} - -#ifdef _WIN32 -static inline HSTREAM BASS_MIDI_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags, DWORD freq) -{ - return BASS_MIDI_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); -} - -static inline HSTREAM BASS_MIDI_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user, DWORD freq) -{ - return BASS_MIDI_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user, freq); -} - -static inline HSOUNDFONT BASS_MIDI_FontInit(const WCHAR *file, DWORD flags) -{ - return BASS_MIDI_FontInit((const void*)file, flags|BASS_UNICODE); -} - -static inline BOOL BASS_MIDI_FontPack(HSOUNDFONT handle, const WCHAR *outfile, const WCHAR *encoder, DWORD flags) -{ - return BASS_MIDI_FontPack(handle, (const void*)outfile, (const void*)encoder, flags|BASS_UNICODE); -} - -static inline BOOL BASS_MIDI_FontUnpack(HSOUNDFONT handle, const WCHAR *outfile, DWORD flags) -{ - return BASS_MIDI_FontUnpack(handle, (const void*)outfile, flags|BASS_UNICODE); -} -#endif -#endif - -#endif diff --git a/include/bassopus.h b/include/bassopus.h deleted file mode 100644 index 3d8b131d..00000000 --- a/include/bassopus.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - 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 diff --git a/include/chatlogpiece.h b/include/chatlogpiece.h deleted file mode 100644 index df6ccd0e..00000000 --- a/include/chatlogpiece.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef CHATLOGPIECE_H -#define CHATLOGPIECE_H - -#include <QtWidgets/QApplication> -#include <QDateTime> -#include <QString> - -class chatlogpiece { - Q_DECLARE_TR_FUNCTIONS(chatlogpiece) -public: - chatlogpiece(); - chatlogpiece(QString p_name, QString p_showname, QString p_message, - QString p_action,int color, bool selfname); - chatlogpiece(QString p_name, QString p_showname, QString p_message, - QString p_action, int color, bool selfname, QDateTime p_datetime); - - QString get_name() { return name; }; - QString get_showname() { return showname; }; - QString get_message() { return message; }; - QString get_action() { return action; }; - bool get_selfname() const { return selfname; }; - QDateTime get_datetime() { return datetime; }; - QString get_datetime_as_string() { return datetime.toString(); }; - int get_chat_color() const { return color; }; - QString get_full(); - -private: - QString name; - QString showname; - QString message; - QString action; - bool selfname; - QDateTime datetime; - int color; -}; - -#endif // CHATLOGPIECE_H diff --git a/include/courtroom.h b/include/courtroom.h deleted file mode 100644 index 20956d99..00000000 --- a/include/courtroom.h +++ /dev/null @@ -1,1026 +0,0 @@ -#ifndef COURTROOM_H -#define COURTROOM_H - -#include "aoapplication.h" -#include "aoblipplayer.h" -#include "aobutton.h" -#include "aocharbutton.h" -#include "aoclocklabel.h" -#include "aoemotebutton.h" -#include "aoemotepreview.h" -#include "aoevidencebutton.h" -#include "aoevidencedisplay.h" -#include "aoimage.h" -#include "aolayer.h" -#include "aomusicplayer.h" -#include "aopacket.h" -#include "aosfxplayer.h" -#include "aotextarea.h" -#include "aotextboxwidgets.h" -#include "chatlogpiece.h" -#include "datatypes.h" -#include "debug_functions.h" -#include "eventfilters.h" -#include "file_functions.h" -#include "hardware_functions.h" -#include "lobby.h" -#include "scrolltext.h" -#include "widgets/aooptionsdialog.h" - -#include <QCheckBox> -#include <QCloseEvent> -#include <QComboBox> -#include <QHeaderView> -#include <QLineEdit> -#include <QListWidget> -#include <QMainWindow> -#include <QMap> -#include <QPlainTextEdit> -#include <QSlider> -#include <QSpinBox> -#include <QTextBrowser> -#include <QTreeWidget> -#include <QVector> -#include <QQueue> - -#include <QBrush> -#include <QDebug> -#include <QDesktopServices> -#include <QFileDialog> -#include <QFont> -#include <QInputDialog> -#include <QMenu> -#include <QMessageBox> -#include <QParallelAnimationGroup> -#include <QPropertyAnimation> -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) -#include <QRandomGenerator> //added in Qt 5.10 -#endif -#include <QRegularExpression> -#include <QScrollBar> -#include <QTextBoundaryFinder> -#include <QTextCharFormat> -#include <QElapsedTimer> - -#include <QFuture> - -#include <algorithm> -#include <stack> - -class AOApplication; - -class Courtroom : public QMainWindow { - Q_OBJECT -public: - explicit Courtroom(AOApplication *p_ao_app); - - void update_audio_volume(); - - 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_chars() { char_list.clear(); } - 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_clear() { - arup_players.clear(); - arup_statuses.clear(); - arup_cms.clear(); - arup_locks.clear(); - } - - 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; - } - } - - void character_loading_finished(); - - // - void set_courtroom_size(); - - // 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, - QString p_char = "", QString font_name = "", - int f_pointsize = 0); - - // 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, - bool outlined = false, QColor outline_color = QColor(0, 0, 0), - int outline_width = 1); - - // helper function that calls above function on the relevant widgets - void set_fonts(QString p_char = ""); - - // sets dropdown menu stylesheet - void set_stylesheet(QWidget *widget); - - // helper funciton that call above function on the relevant widgets - void set_stylesheets(); - - void set_window_title(QString p_title); - - // reads theme and sets size and pos based on the identifier (using p_misc if provided) - void set_size_and_pos(QWidget *p_widget, QString p_identifier, QString p_misc=""); - - // 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 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 pos dropdown - void set_pos_dropdown(QStringList pos_dropdowns); - - // sets the evidence list member variable to argument - void set_evidence_list(QVector<evi_type> &p_evi_list); - - // 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 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(bool show_desk, QString f_side); - - // sets ui_vp_player_char according to SELF_OFFSET, only a function bc it's used with desk_mod 4 and 5 - void set_self_offset(const 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); - - // 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; } - - // updates character to p_cid and updates necessary ui elements - // Optional "char_name" is the iniswap we're using - void update_character(int p_cid, QString char_name = "", bool reset_emote = false); - - // 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(); - - // Debug log (formerly master server chat log) - void debug_message_handler(QtMsgType type, const QMessageLogContext &context, - const QString &msg); - void append_debug_message(QString f_message); - - // OOC chat log - void append_server_chatmessage(QString p_name, QString p_message, - QString p_color); - - // Add the message packet to the stack - void chatmessage_enqueue(QStringList p_contents); - - // Parse the chat message packet and unpack it into the m_chatmessage[ITEM] format - void unpack_chatmessage(QStringList p_contents); - - // Skip the current queue, adding all the queue messages to the logs if desynchronized logs are disabled - void skip_chatmessage_queue(); - - enum LogMode { - IO_ONLY, - DISPLAY_ONLY, - DISPLAY_AND_IO, - QUEUED, - }; - // Log the message contents and information such as evidence presenting etc. into the log file, the IC log, or both. - void log_chatmessage(QString f_message, int f_char_id, QString f_showname = "", QString f_char = "", QString f_objection_mod = "", int f_evi_id = 0, int f_color = 0, LogMode f_log_mode=IO_ONLY, bool sender = false); - - // Log the message contents and information such as evidence presenting etc. into the IC logs - void handle_callwords(); - - // Handle the objection logic, if it's interrupting the currently parsing message. - // Returns true if this message has an objection, otherwise returns false. The result decides when to call handle_ic_message() - bool handle_objection(); - - // Display the evidence image box when presenting evidence in IC - void display_evidence_image(); - - // Handle the stuff that comes when the character appears on screen and starts animating (preanims etc.) - void handle_ic_message(); - - // Display the character. - void display_character(); - - // Display the character's pair if present. - void display_pair_character(QString other_charid, QString other_offset); - - // Handle the emote modifier value and proceed through the logic accordingly. - void handle_emote_mod(int emote_mod, bool p_immediate); - - // Initialize the chatbox image, showname shenanigans, custom chatboxes, etc. - void initialize_chatbox(); - - // Finally start displaying the chatbox we initialized, display the evidence, and play the talking or idle emote for the character. - // Callwords are also handled here. - void handle_ic_speaking(); - - // 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); - - void log_ic_text(QString p_name, QString p_showname, QString p_message, - QString p_action = "", int p_color = 0, bool p_selfname = false); - - // 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 = "", - int color = 0, bool selfname = false, QDateTime timestamp = QDateTime::currentDateTime(), - bool ghost = false); - - // clear sent messages that appear on the IC log but haven't been delivered - // yet to other players - void pop_ic_ghost(); - - // 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 immediate); - - // 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); - - // Toggles the judge buttons, whether they should appear or not. - void show_judge_controls(bool visible); - - void check_connection_received(); - - void start_clock(int id); - void start_clock(int id, qint64 msecs); - void set_clock(int id, qint64 msecs); - void pause_clock(int id); - void stop_clock(int id); - void set_clock_visibility(int id, bool visible); - void skip_clocks(qint64 msecs); - - qint64 pong(); - // Truncates text so it fits within theme-specified boundaries and sets the tooltip to the full string - void truncate_label_text(QWidget* p_widget, QString p_identifier); - - void on_authentication_state_received(int p_state); - - enum JudgeState { - POS_DEPENDENT = -1, - HIDE_CONTROLS = 0, - SHOW_CONTROLS = 1 - }; - - JudgeState get_judge_state() { return judge_state; } - void set_judge_state(JudgeState new_state) { judge_state = new_state; } - void set_judge_buttons() { show_judge_controls(ao_app->get_pos_is_judge(current_side)); } - - ~Courtroom(); -private: - AOApplication *ao_app; - - // Percentage of audio that is suppressed when client is not in focus - int suppress_audio = 0; - - int m_courtroom_width = 714; - int m_courtroom_height = 668; - - int m_viewport_x = 0; - int m_viewport_y = 0; - - int m_viewport_width = 256; - int m_viewport_height = 192; - - int maximumMessages = 0; - - QParallelAnimationGroup *screenshake_animation_group = - new QParallelAnimationGroup; - - bool next_character_is_not_special = false; // If true, write the - // next character as it is. - - bool message_is_centered = false; - - int current_display_speed = 3; - int text_crawl = 40; - double message_display_mult[7] = {0, 0.25, 0.65, 1, 1.25, 1.75, 2.25}; - - // The character ID of the character this user wants to appear alongside with. - int other_charid = -1; - - // The horizontal offset this user has given if they want to appear alongside someone. - int char_offset = 0; - - // The vertical offset this user has given. - int char_vert_offset = 0; - - // 0 = in front, 1 = behind - int pair_order = 0; - - QVector<char_type> char_list; - QVector<evi_type> evidence_list; - QVector<QString> music_list; - QVector<QString> area_list; - - QVector<int> arup_players; - QVector<QString> arup_statuses; - QVector<QString> arup_cms; - QVector<QString> arup_locks; - - QVector<chatlogpiece> ic_chatlog_history; - QString last_ic_message = ""; - - QQueue<QStringList> chatmessage_queue; - - // triggers ping_server() every 45 seconds - QTimer *keepalive_timer; - - // determines how fast messages tick onto screen - QTimer *chat_tick_timer; - - // count up timer to check how long it took for us to get a response from ping_server() - QElapsedTimer ping_timer; - bool is_pinging = false; - - // 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 = 2; - int rainbow_counter = 0; - bool rainbow_appended = false; - bool blank_blip = false; - bool chatbox_always_show = false; - - // 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 = true; - - // True, if log should display colors. - bool log_colors = true; - - // True, if the log should display the message like name<br>text instead of - // name: text - bool log_newline = false; - - // True, if the log should include RP actions like interjections, showing evidence, etc. - bool log_ic_actions = true; - - // Margin in pixels between log entries for the IC log. - int log_margin = 0; - - // True, if the log should have a timestamp. - bool log_timestamp = false; - - // format string for aforementioned log timestamp - QString log_timestamp_format; - - // How long in miliseconds should the objection wait before appearing. - int objection_threshold = 1500; - - // delay before chat messages starts ticking - QTimer *text_delay_timer; - - // delay before the next queue entry is going to be processed - QTimer *text_queue_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; - - // the amount of time non-animated objection/hold it/takethat images stay - // onscreen for in ms, and the maximum amount of time any interjections are - // allowed to play - const int shout_static_time = 724; - const int shout_max_time = 1500; - - // the amount of time non-animated guilty/not guilty images stay onscreen for - // in ms, and the maximum amount of time g/ng images are allowed to play - const int verdict_static_time = 3000; - const int verdict_max_time = 4000; - - // the amount of time non-animated witness testimony/cross-examination images - // stay onscreen for in ms, and the maximum time any wt/ce image is allowed to - // play - const int wtce_static_time = 1500; - const int wtce_max_time = 4000; - - // 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 of ghost blocks - int ghost_blocks = 0; - - // Minumum and maximum number of parameters in the MS packet - static const int MS_MINIMUM = 15; - static const int MS_MAXIMUM = 31; - QString m_chatmessage[MS_MAXIMUM]; - - QString previous_ic_message = ""; - QString additive_previous = ""; - - // char id, muted or not - QMap<int, bool> mute_map; - - // QVector<int> muted_cids; - - bool is_muted = false; - - JudgeState judge_state = POS_DEPENDENT; - - // state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = - // noniterrupting preanim, 5 = (c) animation - 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; - - // 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; - QString objection_custom = ""; - struct CustomObjection { - QString name; - QString filename; - }; - QList<CustomObjection> custom_objections_list; - 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; - - // Text Color-related optimization: - // Current color list indexes to real color references - QVector<int> color_row_to_number; - - // List of associated RGB colors for this color index - QVector<QColor> color_rgb_list; - - // Same as above but populated from misc/default's config - QVector<QColor> default_color_rgb_list; - - // Get a color index from an arbitrary misc config - void gen_char_rgb_list(QString p_misc); - QVector<QColor> char_color_rgb_list; - - // Misc we used for the last message, and the one we're using now. Used to avoid loading assets when it's not needed - QString current_misc; - QString last_misc; - - // 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<bool> color_markdown_remove_list; - - // Whether or not this color allows us to play the talking animation - QVector<bool> color_markdown_talking_list; - // Text Color-related optimization END - - // List of all currently available pos - QStringList pos_dropdown_list; - - // Current list file sorted line by line - QStringList sound_list; - - // Current SFX the user put in for the sfx dropdown list - QString custom_sfx = ""; - - // is the message we're about to send supposed to present evidence? - bool is_presenting_evidence = false; - bool c_played = false; // whether we've played a (c)-style postanimation yet - - // have we already presented evidence for this message? - bool evidence_presented = false; - - QString effect = ""; - - // Music effect flags we want to send to server when we play music - int music_flags = FADE_OUT; - - 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; - - 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; - - QVector<evi_type> local_evidence_list; - QVector<evi_type> private_evidence_list; - QVector<evi_type> global_evidence_list; - - // 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; - - // whether the ooc chat is server or master chat, true is server - bool server_ooc = true; - - QString current_background = "default"; - QString current_side = ""; - - QString last_music_search = ""; - QString last_area_search = ""; - - QBrush free_brush; - QBrush lfp_brush; - QBrush casing_brush; - QBrush recess_brush; - QBrush rp_brush; - QBrush gaming_brush; - QBrush locked_brush; - - AOMusicPlayer *music_player; - AOSfxPlayer *sfx_player; - AOSfxPlayer *objection_player; - AOBlipPlayer *blip_player; - - AOSfxPlayer *modcall_player; - - AOImage *ui_background; - - QWidget *ui_viewport; - BackgroundLayer *ui_vp_background; - SplashLayer *ui_vp_speedlines; - CharLayer *ui_vp_player_char; - CharLayer *ui_vp_sideplayer_char; - BackgroundLayer *ui_vp_desk; - AOEvidenceDisplay *ui_vp_evidence_display; - AOImage *ui_vp_chatbox; - AOChatboxLabel *ui_vp_showname; - InterfaceLayer *ui_vp_chat_arrow; - QTextEdit *ui_vp_message; - SplashLayer *ui_vp_testimony; - SplashLayer *ui_vp_wtce; - EffectLayer *ui_vp_effect; - SplashLayer *ui_vp_objection; - - QTextEdit *ui_ic_chatlog; - - AOTextArea *ui_debug_log; - AOTextArea *ui_server_chatlog; - - QListWidget *ui_mute_list; - QTreeWidget *ui_area_list; - QTreeWidget *ui_music_list; - - ScrollText *ui_music_name; - InterfaceLayer *ui_music_display; - - StickerLayer *ui_vp_sticker; - - static const int max_clocks = 5; - AOClockLabel *ui_clock[max_clocks]; - - AOButton *ui_pair_button; - QListWidget *ui_pair_list; - QSpinBox *ui_pair_offset_spinbox; - QSpinBox *ui_pair_vert_offset_spinbox; - - QComboBox *ui_pair_order_dropdown; - - QLineEdit *ui_ic_chat_message; - AOLineEditFilter *ui_ic_chat_message_filter; - QLineEdit *ui_ic_chat_name; - QLineEdit *ui_custom_blips; - - QLineEdit *ui_ooc_chat_message; - QLineEdit *ui_ooc_chat_name; - - // QLineEdit *ui_area_password; - QLineEdit *ui_music_search; - - QWidget *ui_emotes; - QVector<AOEmoteButton *> ui_emote_list; - AOButton *ui_emote_left; - AOButton *ui_emote_right; - - QMenu *emote_menu; - AOEmotePreview *emote_preview; - - QComboBox *ui_emote_dropdown; - QComboBox *ui_pos_dropdown; - AOButton *ui_pos_remove; - - QComboBox *ui_iniswap_dropdown; - AOButton *ui_iniswap_remove; - - QComboBox *ui_sfx_dropdown; - AOButton *ui_sfx_remove; - - 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_ooc_toggle; - - 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_switch_area_music; - - QCheckBox *ui_pre; - QCheckBox *ui_flip; - QCheckBox *ui_additive; - QCheckBox *ui_guard; - - QCheckBox *ui_immediate; - QCheckBox *ui_showname_enable; - - AOButton *ui_custom_objection; - QMenu *custom_obj_menu; - 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; - - QSlider *ui_music_slider; - QSlider *ui_sfx_slider; - QSlider *ui_blip_slider; - - AOImage *ui_muted; - - AOButton *ui_evidence_button; - AOImage *ui_evidence; - QLineEdit *ui_evidence_name; - AOLineEditFilter *ui_evidence_name_filter; - QWidget *ui_evidence_buttons; - QVector<AOEvidenceButton *> ui_evidence_list; - AOButton *ui_evidence_left; - AOButton *ui_evidence_right; - AOButton *ui_evidence_present; - AOImage *ui_evidence_overlay; - AOButton *ui_evidence_delete; - QLineEdit *ui_evidence_image_name; - AOLineEditFilter *ui_evidence_image_name_filter; - 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; - QPlainTextEdit *ui_evidence_description; - - - AOImage *ui_char_select_background; - - // pretty list of characters - QTreeWidget *ui_char_list; - - // abstract widget to hold char buttons - QWidget *ui_char_buttons; - - QVector<AOCharButton *> ui_char_button_list; - QVector<AOCharButton *> ui_char_button_list_filtered; - - AOButton *ui_back_to_lobby; - - QLineEdit *ui_char_password; - - AOButton *ui_char_select_left; - AOButton *ui_char_select_right; - - AOButton *ui_spectator; - - 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 on_char_button_context_menu_requested(const QPoint &pos); - 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 show_evidence(int f_real_id); - void set_evidence_page(); - - void reset_ui(); - - void regenerate_ic_chatlog(); -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 mod_called(QString p_ip); - - void on_reload_theme_clicked(); - - void update_ui_music_name(); - -private slots: - void start_chat_ticking(); - void play_sfx(); - - void chat_tick(); - - void on_mute_list_clicked(QModelIndex p_index); - void on_pair_list_clicked(QModelIndex p_index); - - void on_chat_return_pressed(); - - void on_ooc_return_pressed(); - - void on_music_search_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_random(); - void music_list_expand_all(); - void music_list_collapse_all(); - void music_stop(bool no_effects = false); - void on_area_list_double_clicked(QTreeWidgetItem *p_item, int column); - - void select_emote(int p_id); - - void on_emote_clicked(int p_id); - - 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_pos_dropdown_changed(QString p_text); - void on_pos_dropdown_context_menu_requested(const QPoint &pos); - void on_pos_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 on_sfx_dropdown_custom(QString p_sfx); - void set_sfx_dropdown(); - void on_sfx_context_menu_requested(const QPoint &pos); - void on_sfx_play_clicked(); - 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); - - 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_hover(int p_id, bool p_state); - - 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 show_custom_objection_menu(const QPoint &pos); - - void show_emote_menu(const QPoint &pos); - - 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_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 on_text_color_context_menu_requested(const QPoint &pos); - 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_log_limit_changed(int value); - void on_pair_offset_changed(int value); - void on_pair_vert_offset_changed(int value); - - 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_change_character_clicked(); - void on_call_mod_clicked(); - void on_settings_clicked(); - - void on_pre_clicked(); - void on_flip_clicked(); - void on_additive_clicked(); - void on_guard_clicked(); - - void on_showname_enable_clicked(); - - void on_evidence_button_clicked(); - void on_evidence_context_menu_requested(const QPoint &pos); - - void on_evidence_delete_clicked(); - bool 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); - void on_evidence_save_clicked(); - void on_evidence_load_clicked(); - void evidence_save(QString filename); - void evidence_load(QString filename); - bool compare_evidence_changed(evi_type evi_a, evi_type evi_b); - - void on_back_to_lobby_clicked(); - - void on_char_list_double_clicked(QTreeWidgetItem *p_item, int column); - 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_switch_area_music_clicked(); - - void on_application_state_changed(Qt::ApplicationState state); - - void ping_server(); - - // Proceed to parse the oldest chatmessage and remove it from the stack - void chatmessage_dequeue(); - - void preview_emote(QString emote); - void update_emote_preview(); -}; - -#endif // COURTROOM_H diff --git a/include/datatypes.h b/include/datatypes.h deleted file mode 100644 index 32bff59e..00000000 --- a/include/datatypes.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef DATATYPES_H -#define DATATYPES_H - -#include <QMap> -#include <QString> - -enum connection_type { - TCP, - WEBSOCKETS, -}; - -static QMap<QString, connection_type> to_connection_type = { - {"tcp", connection_type::TCP}, - {"ws", connection_type::WEBSOCKETS} -}; - -struct server_type { - QString name; - QString desc; - QString ip; - int port; - connection_type socket_type; -}; - -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 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 area_type { - QString name; - QString background; - bool passworded; -}; - -struct pos_type { - int x; - int y; -}; - -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, - IMMEDIATE, - LOOPING_SFX, - SCREENSHAKE, - FRAME_SCREENSHAKE, - FRAME_REALIZATION, - FRAME_SFX, - ADDITIVE, - EFFECTS, - BLIPNAME, -}; - -enum EMOTE_MOD_TYPE { - IDLE = 0, - PREANIM = 1, - ZOOM = 5, - PREANIM_ZOOM = 6, -}; - -enum DESK_MOD_TYPE { - DESK_HIDE = 0, - DESK_SHOW, - DESK_EMOTE_ONLY, - DESK_PRE_ONLY, - DESK_EMOTE_ONLY_EX, - DESK_PRE_ONLY_EX, - //"EX" for "expanded" - //dumb, i know, but throw the first stone if you have a better idea -}; - -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 deleted file mode 100644 index 383431ab..00000000 --- a/include/debug_functions.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef DEBUG_FUNCTIONS_H -#define DEBUG_FUNCTIONS_H - -#include <QMessageBox> -#include <QString> - -void call_error(QString message); -void call_notice(QString message); - -#endif // DEBUG_FUNCTIONS_H diff --git a/include/demoserver.h b/include/demoserver.h deleted file mode 100644 index 877d5ccf..00000000 --- a/include/demoserver.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef DEMOSERVER_H -#define DEMOSERVER_H - -#include "aopacket.h" - -#include <QDebug> -#include <QObject> -#include <QQueue> -#include <QTcpServer> -#include <QTcpSocket> -#include <QTimer> -#include <QFileDialog> -#include <QMessageBox> - -class DemoServer : public QObject -{ - Q_OBJECT -public: - explicit DemoServer(QObject *parent = nullptr); - - bool server_started = false; - int port = 27088; - int max_wait = -1; - - void set_demo_file(QString filepath); - -private: - void handle_packet(AOPacket *packet); - void load_demo(QString filename); - void reset_state(); - - QTcpServer* tcp_server; - QTcpSocket* client_sock = nullptr; - bool client_connected = false; - bool partial_packet = false; - bool debug_mode = false; - QString temp_packet = ""; - QQueue<QString> demo_data; - QString sc_packet; - int num_chars = 0; - QString p_path; - QTimer *timer; - int elapsed_time = 0; - QString filename; - -private slots: - void accept_connection(); - void destroy_connection(); - void recv_data(); - void client_disconnect(); - void playback(); - -public slots: - void start_server(); - -signals: - void skip_timers(qint64 msecs); -}; - -#endif // DEMOSERVER_H diff --git a/include/discord-rpc.h b/include/discord-rpc.h deleted file mode 100644 index 455f62aa..00000000 --- a/include/discord-rpc.h +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once -#include <stdint.h> - -// clang-format off - -#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 -#else -# define DISCORD_EXPORT -#endif - -// clang-format on - -#ifdef __cplusplus -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; -} DiscordRichPresence; - -typedef struct DiscordJoinRequest { - 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); -} 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, - int autoRegister, - const char *optionalSteamId); -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 */ -#ifdef DISCORD_DISABLE_IO_THREAD -DISCORD_EXPORT void Discord_UpdateConnection(void); -#endif - -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); - -#ifdef __cplusplus -} /* extern "C" */ -#endif diff --git a/include/discord_register.h b/include/discord_register.h deleted file mode 100644 index 655a3dfb..00000000 --- a/include/discord_register.h +++ /dev/null @@ -1,28 +0,0 @@ -#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 -#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); - -#ifdef __cplusplus -} -#endif diff --git a/include/discord_rich_presence.h b/include/discord_rich_presence.h deleted file mode 100644 index 42de59e2..00000000 --- a/include/discord_rich_presence.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef DISCORD_RICH_PRESENCE_H -#define DISCORD_RICH_PRESENCE_H - -#include <QCoreApplication> -#include <QDebug> -#include <cstring> -#include <ctime> -#include <string> - -#include <discord-rpc.h> -#include <string> - -#include <cstring> -#include <ctime> - -#include <QDebug> - -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(); -}; - -} // namespace AttorneyOnline -#endif // DISCORD_RICH_PRESENCE_H diff --git a/include/discord_rpc.h b/include/discord_rpc.h deleted file mode 100644 index 6bd44041..00000000 --- a/include/discord_rpc.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once -#include <stdint.h> - -// clang-format off - -#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 -#else -# define DISCORD_EXPORT -#endif - -// clang-format on - -#ifdef __cplusplus -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; -} DiscordRichPresence; - -typedef struct DiscordUser { - 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); -} 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, - int autoRegister, - const char *optionalSteamId); -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 */ -#ifdef DISCORD_DISABLE_IO_THREAD -DISCORD_EXPORT void Discord_UpdateConnection(void); -#endif - -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_UpdateHandlers(DiscordEventHandlers *handlers); - -#ifdef __cplusplus -} /* extern "C" */ -#endif diff --git a/include/eventfilters.h b/include/eventfilters.h deleted file mode 100644 index 7847608d..00000000 --- a/include/eventfilters.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef EVENTFILTERS_H -#define EVENTFILTERS_H - -#include <QEvent> -#include <QLineEdit> - -class AOLineEditFilter : public QObject -{ - Q_OBJECT -public: - bool preserve_selection = false; - -protected: - bool eventFilter(QObject *obj, QEvent *event) override { - QLineEdit *lineEdit = qobject_cast<QLineEdit *>(obj); - if (event->type() == QEvent::FocusOut && lineEdit != nullptr && preserve_selection) { // lost focus - int start = lineEdit->selectionStart(); - #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) - int len = lineEdit->selectionLength(); - #else - int len = lineEdit->selectedText().length(); - #endif - if (start != -1 && len != -1) { - lineEdit->setSelection(start, len);\ - return true; - } - } - return false; - } -signals: - void double_clicked(); -}; - - - -#endif // EVENTFILTERS_H diff --git a/include/file_functions.h b/include/file_functions.h deleted file mode 100644 index 31e2e16c..00000000 --- a/include/file_functions.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef FILE_FUNCTIONS_H -#define FILE_FUNCTIONS_H - -#include <QDir> -#include <QFileInfo> -#include <QString> -#include <QCoreApplication> - -bool file_exists(QString file_path); -bool dir_exists(QString file_path); -bool exists(QString p_path); -QString get_base_path(); - -#endif // FILE_FUNCTIONS_H diff --git a/include/hardware_functions.h b/include/hardware_functions.h deleted file mode 100644 index 05d3f2af..00000000 --- a/include/hardware_functions.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HARDWARE_FUNCTIONS_H -#define HARDWARE_FUNCTIONS_H - -#include <QString> - -#include <stdio.h> - -#ifdef ANDROID -#include <QtAndroidExtras/QtAndroid> -#endif - -QString get_hdid(); - -#endif // HARDWARE_FUNCTIONS_H diff --git a/include/interfaces/server_dialog.h b/include/interfaces/server_dialog.h deleted file mode 100644 index 63817d09..00000000 --- a/include/interfaces/server_dialog.h +++ /dev/null @@ -1,21 +0,0 @@ -#include <QDialog> -#pragma once - -#ifndef AO_UI_FAVORITESERVERDIALOG -#define AO_UI_FAVORITESRRVERDIALOG -namespace AttorneyOnline { - namespace UI { - class FavoriteServerDialog : public QDialog { - public: - FavoriteServerDialog() = default; - ~FavoriteServerDialog() = default; - - const QString DEFAULT_UI = "favorite_server_dialog.ui"; - const int TCP_INDEX = 0; - private slots: - virtual void onSavePressed() = 0; - virtual void onCancelPressed() = 0; - }; - } // namespace UI -} // namespace AttorneyOnline -#endif // AO_UI_FAVORITESERVERDIALOG diff --git a/include/lobby.h b/include/lobby.h deleted file mode 100644 index e5d35766..00000000 --- a/include/lobby.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef LOBBY_H -#define LOBBY_H - -class QLabel; -class QLineEdit; -class QPushButton; -class QTextBrowser; -class QTreeWidget; -class QTreeWidgetItem; - -#include <QMainWindow> -#include "networkmanager.h" -#include "file_functions.h" - -#ifdef ANDROID -#include <QtAndroidExtras/QtAndroid> -#endif - -class AOApplication; - -class Lobby : public QMainWindow { - Q_OBJECT -public: - Lobby(AOApplication *p_ao_app, NetworkManager *p_net_man = nullptr); - ~Lobby(); - - void set_player_count(int players_online, int max_players); - void set_server_description(const QString &server_description); - void list_servers(); - int get_selected_server(); - int pageSelected(); - -private: - AOApplication *ao_app; - NetworkManager *net_manager; - - const QString DEFAULT_UI = "lobby.ui"; - - void list_favorites(); - void list_demos(); - void get_motd(); - void check_for_updates(); - void reset_selection(); - - int last_index = -1; - - enum TabPage { SERVER, FAVORITES, DEMOS }; - - // UI-file Lobby - - // Top Row - QLabel *ui_game_version_lbl; - QPushButton *ui_settings_button; - QPushButton *ui_about_button; - - // Server, Favs and Demo lists - QTabWidget *ui_connections_tabview; - - QTreeWidget *ui_serverlist_tree; - QLineEdit *ui_serverlist_search; - - QTreeWidget *ui_favorites_tree; - QLineEdit *ui_favorites_search; - - QTreeWidget *ui_demo_tree; - QLineEdit *ui_demo_search; - - QPushButton *ui_add_to_favorite_button; - QPushButton *ui_add_server_button; - QPushButton *ui_remove_from_favorites_button; - QPushButton *ui_edit_favorite_button; - QPushButton *ui_direct_connect_button; - QPushButton *ui_refresh_button; - - // Serverinfo / MOTD Horizontal Row - QTextBrowser *ui_motd_text; - - QLabel *ui_server_player_count_lbl; - QTextBrowser *ui_server_description_text; - QPushButton *ui_connect_button; - - // Optional Widget - QTextBrowser *ui_game_changelog_text; - - void loadUI(); - - TabPage current_page = SERVER; - -private slots: - void on_tab_changed(int index); - void on_refresh_released(); - void on_direct_connect_released(); - void on_add_to_fav_released(); - void on_add_server_to_fave_released(); - void on_edit_favorite_released(); - void on_remove_from_fav_released(); - void on_about_clicked(); - void on_server_list_clicked(QTreeWidgetItem *p_item, int column); - void on_list_doubleclicked(QTreeWidgetItem *p_item, int column); - void on_favorite_tree_clicked(QTreeWidgetItem *p_item, int column); - void on_server_search_edited(QString p_text); - void on_demo_clicked(QTreeWidgetItem *item, int column); - void onReloadThemeRequested(); // Oh boy. - void onSettingsRequested(); -}; - -#endif // LOBBY_H diff --git a/include/misc_functions.h b/include/misc_functions.h deleted file mode 100644 index 5287bee8..00000000 --- a/include/misc_functions.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef MISC_FUNCTIONS_H -#define MISC_FUNCTIONS_H - -#include <QCoreApplication> -#include <QTime> - -void delay(int p_milliseconds); - -#endif // MISC_FUNCTIONS_H diff --git a/include/networkmanager.h b/include/networkmanager.h deleted file mode 100644 index 3e37222b..00000000 --- a/include/networkmanager.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef NETWORKMANAGER_H -#define NETWORKMANAGER_H - -#include "aoapplication.h" -#include "aopacket.h" - -#include <QDnsLookup> -#include <QNetworkAccessManager> -#include <QtWebSockets/QWebSocket> -#include <QTime> -#include <QTimer> - -#include <cstring> - -enum MSDocumentType { - PrivacyPolicy, - Motd, - ClientVersion -}; - -class NetworkManager : public QObject { - Q_OBJECT - -private: - AOApplication *ao_app; - QNetworkAccessManager *http; - - union { - QWebSocket *ws; - QTcpSocket *tcp; - } server_socket; - connection_type active_connection_type; - bool connected = false; - - QTimer *heartbeat_timer; - - const QString DEFAULT_MS_BASEURL = "http://servers.aceattorneyonline.com"; - QString ms_baseurl = DEFAULT_MS_BASEURL; - - const int heartbeat_interval = 60 * 5 * 1000; - - bool partial_packet = false; - QString temp_packet = ""; - - unsigned int s_decryptor = 5; - -public: - explicit NetworkManager(AOApplication *parent); - ~NetworkManager() = default; - - void connect_to_server(server_type p_server); - void disconnect_from_server(); - -signals: - void server_connected(bool state); - -public slots: - void get_server_list(); - void ship_server_packet(QString p_packet); - void join_to_server(); - void handle_server_packet(const QString& p_data); - - void request_document(MSDocumentType document_type, - const std::function<void(QString)> &cb); - void send_heartbeat(); -private slots: - void ms_request_finished(QNetworkReply *reply); - -private: - QString get_user_agent() const { - return QStringLiteral("AttorneyOnline/%1 (Desktop)") - .arg(ao_app->get_version_string()); - } -}; - -#endif // NETWORKMANAGER_H diff --git a/include/options.h b/include/options.h deleted file mode 100644 index 2beae230..00000000 --- a/include/options.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef OPTIONS_H -#define OPTIONS_H - - -#include <QCoreApplication> -#include <QSettings> -#include <datatypes.h> - -class Options { -private: - /** - * @brief QSettings object for config.ini - */ - QSettings config; - - /** - * @brief QSettings object for favorite_servers.ini - */ - QSettings favorite; - - - void migrateCallwords(); - - /** - * @brief Constructor for options class. - */ - Options(); - - QString m_server_subtheme; - -public: - Options(Options const &) = delete; - void operator=(Options const &) = delete; - - static Options &getInstance() - { - static Options instance; - return instance; - } - - /** - * @brief Migrates old configuration files to the most recent format. - */ - void migrate(); - - // Reads the theme from config.ini and loads it into the currenttheme - // variable - QString theme() const; - void setTheme(QString value); - - int themeScalingFactor() const; - void setThemeScalingFactor(int value); - - // Returns the value of oocname in config.ini - QString oocName() const; - void setOocName(QString value); - - // Returns the blip rate from config.ini (once per X symbols) - int blipRate() const; - void setBlipRate(int value); - - // Returns true if blank blips is enabled in config.ini and false otherwise - bool blankBlip() const; - void setBlankBlip(bool value); - - // Returns true if looping sound effects are enabled in the config.ini - bool loopingSfx() const; - void setLoopingSfx(bool value); - - // Returns true if stop music on objection is enabled in the config.ini - bool objectionStopMusic() const; - void setObjectionStopMusic(bool value); - - // Returns true if streaming is enabled in the config.ini - bool streamingEnabled() const; - void setStreamingEnabled(bool value); - - // Returns the value of defaultmusic in config.ini - int musicVolume() const; - void setMusicVolume(int value); - - // Returns the value of defaultsfx in config.ini - int sfxVolume() const; - void setSfxVolume(int value); - - // Returns the value of defaultblip in config.ini - int blipVolume() const; - void setBlipVolume(int value); - - // Returns the value of suppressaudio in config.ini - int defaultSuppressAudio() const; - void setDefaultSupressedAudio(int value); - - // Returns the value if objections interrupt and skip the message queue - // from the config.ini. - bool objectionSkipQueueEnabled() const; - void setObjectionSkipQueueEnabled(bool value); - - // returns if log will show messages as-received, while viewport will parse - // according to the queue (Text Stay Time) from the config.ini - bool desynchronisedLogsEnabled() const; - void setDesynchronisedLogsEnabled(bool value); - - // Returns the value of whether Discord should be enabled on startup - // from the config.ini. - bool discordEnabled() const; - void setDiscordEnabled(bool value); - - // Returns the value of whether shaking should be enabled. - // from the config.ini. - bool shakeEnabled() const; - void setShakeEnabled(bool value); - - // Returns the value of whether effects should be Enabled. - // from the config.ini. - bool effectsEnabled() const; - void setEffectsEnabled(bool value); - - // Returns the value of whether frame-specific effects defined in char.ini - // should be sent/received over the network. from the config.ini. - bool networkedFrameSfxEnabled() const; - void setNetworkedFrameSfxEnabled(bool value); - - // Returns the value of whether colored ic log should be a thing. - // from the config.ini. - bool colorLogEnabled() const; - void setColorLogEnabled(bool value); - - // Returns the value of whether sticky sounds should be a thing. - // from the config.ini. - bool clearSoundsDropdownOnPlayEnabled() const; - void setClearSoundsDropdownOnPlayEnabled(bool value); - - // Returns the value of whether sticky effects should be a thing. - // from the config.ini. - bool clearEffectsDropdownOnPlayEnabled() const; - void setClearEffectsDropdownOnPlayEnabled(bool value); - - // Returns the value of whether sticky preanims should be a thing. - // from the config.ini. - bool clearPreOnPlayEnabled() const; - void setClearPreOnPlayEnabled(bool value); - - // Returns the value of whether custom chatboxes should be a thing. - // from the config.ini. - // I am increasingly maddened by the lack of dynamic auto-generation system - // for settings. - bool customChatboxEnabled() const; - void setCustomChatboxEnabled(bool value); - - // Returns the value of characer sticker (avatar) setting - bool characterStickerEnabled() const; - void setCharacterStickerEnabled(bool value); - - // Returns the value of whether continuous playback should be used - // from the config.ini. - bool continuousPlaybackEnabled() const; - void setContinuousPlaybackEnabled(bool value); - - // Returns the value of whether stopping music by double clicking category - // should be used from the config.ini. - bool stopMusicOnCategoryEnabled() const; - void setStopMusicOnCategoryEnabled(bool value); - - // Returns the value of the maximum amount of lines the IC chatlog - // may contain, from config.ini. - int maxLogSize() const; - void setMaxLogSize(int value); - - // Current wait time between messages for the queue system - int textStayTime() const; - void setTextStayTime(int value); - - // Returns the letter display speed during text crawl in in-character messages - int textCrawlSpeed() const; - void setTextCrawlSpeed(int value); - - // Returns Minimum amount of time (in miliseconds) that must pass before the - // next Enter key press will send your IC message. (new behaviour) - int chatRateLimit() const; - void setChatRateLimit(int value); - - // Returns whether the log should go upwards (new behaviour) - // or downwards (vanilla behaviour). - bool logDirectionDownwards() const; - void setLogDirectionDownwards(bool value); - - // Returns whether the log should separate name from text via newline or : - bool logNewline() const; - void setLogNewline(bool value); - - // Get spacing between IC log entries. - int logMargin() const; - void setLogMargin(int value); - - // Returns whether the log should have a timestamp. - bool logTimestampEnabled() const; - void setLogTimestampEnabled(bool value); - - // Returns the format string for the log timestamp - QString logTimestampFormat() const; - void setLogTimestampFormat(QString value); - - // Returns whether to log IC actions. - bool logIcActions() const; - void setLogIcActions(bool value); - - // Returns the username the user may have set in config.ini. - QString username() const; - void setUsername(QString value); - - // Returns the audio device used for the client. - QString audioOutputDevice() const; - void setAudioOutputDevice(QString value); - - // Returns whether the user would like to have custom shownames on by default. - bool customShownameEnabled() const; - void setCustomShownameEnabled(bool value); - - // Returns the showname the user may have set in config.ini. - QString shownameOnJoin() const; - void setShownameOnJoin(QString value); - - // Get if text file logging is Enabled - bool logToTextFileEnabled() const; - void setLogToTextFileEnabled(bool value); - - // Get if demo logging is Enabled - bool logToDemoFileEnabled() const; - void setLogToDemoFileEnabled(bool value); - - // Get the subtheme from settings - QString subTheme() const; - QString settingsSubTheme() const; - void setSettingsSubTheme(QString value); - - // Returns the server- - QString serverSubTheme() const; - void setServerSubTheme(QString value); - - // Get if the theme is animated - bool animatedThemeEnabled() const; - void setAnimatedThemeEnabled(bool value); - - // Get the default scaling method - QString defaultScalingMode() const; - void setDefaultScalingMode(QString value); - - // Get a list of custom mount paths - QStringList mountPaths() const; - void setMountPaths(QStringList value); - - // Get whether to opt out of player count metrics sent to the master server - bool playerCountOptout() const; - void setPlayerCountOptout(bool value); - - // Get if sfx can be sent to play on idle - bool playSelectedSFXOnIdle() const; - void setPlaySelectedSFXOnIdle(bool value); - - // Whether opening evidence requires a single or double click - bool evidenceDoubleClickEdit() const; - void setEvidenceDoubleClickEdit(bool value); - - // Supplies an alternative masterserver URL - QString alternativeMasterserver() const; - void setAlternativeMasterserver(QString value); - - // Language the client loads on start. - QString language() const; - void setLanguage(QString value); - - // Callwords notify the user when the word/words are used in a game message. - QStringList callwords() const; - void setCallwords(QStringList value); - - // Clears the configuration file. Essentially restoring it to default. - void clearConfig(); - - // Loads the favorite servers - QVector<server_type> favorites(); - void setFavorites(QVector<server_type> value); - - // Interactions with favorite servers - void removeFavorite(int index); - void addFavorite(server_type server); - void updateFavorite(server_type server, int index); - - // Theming Nonesense! - QString getUIAsset(QString f_asset_name); -}; - -#endif // OPTIONS_H diff --git a/include/scrolltext.h b/include/scrolltext.h deleted file mode 100644 index 9ed5ff77..00000000 --- a/include/scrolltext.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef SCROLLTEXT_H -#define SCROLLTEXT_H - -#include <QDebug> -#include <QPainter> -#include <QStaticText> -#include <QTimer> -#include <QWidget> - -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 diff --git a/include/serverdata.h b/include/serverdata.h deleted file mode 100644 index 0c342660..00000000 --- a/include/serverdata.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef SERVERDATA_H -#define SERVERDATA_H - -#include <QObject> -#include <QString> -#include <QStringList> - -namespace server { - Q_NAMESPACE - - /// The base feature set that almost all servers are supposed to support. - enum class BASE_FEATURE_SET { - YELLOWTEXT, ///< Yellow text in in-character messages. - ///< @since 2.1.0 - FLIPPING, ///< The ability to mirror a character in-game. - ///< @since 2.1.0 - CUSTOMOBJECTIONS, ///< Enables the use of a single custom objection named - ///< `custom`. - ///< @since 2.1.0 - FASTLOADING, ///< Enables the use of "fast loading" instead of the legacy - ///< loading protocol. - ///< @since 2.1.0 - NOENCRYPTION, ///< Disables "FantaCrypt" for the remainder of the session. - ///< @since 2.1.0 - DESKMOD, ///< Allows forcing the appearance or disappearance of the desk. - ///< @since 2.3 to 2.5 - EVIDENCE, ///< Allows creating and presenting evidence. - ///< @since 2.3 to 2.5 - CCCC_IC_SUPPORT, ///< The ability to pair up with another user's character, - ///< the ability to change one's displayed name - ///< in-character ("showname"), and the ability to perform - ///< "immediate" preanimations (ones that happen alongside - ///< text display). - ///< @since 2.6.0 - ARUP, ///< Areas have more data about them than just their name (including - ///< their status, their "lockedness", and who is the Case Master in - ///< the area), and sets the client up to receive and send ARUP - ///< packets. - ///< @since 2.6.0 - CASING_ALERTS, ///< The client gains a new window to announce cases with, - ///< and the settings to set itself up to receive case alerts - ///< based on casing preferences. No longer used. - ///< @since 2.6.0 - MODCALL_REASON, ///< Enables entering a custom reason for calling - ///< moderators. - ///< @since 2.6.0 - LOOPING_SFX, ///< Enables looping SFX extensions for the in-character - ///< command. - ///< @since 2.8.0 - ADDITIVE, ///< Enables "additive" text that allows in-character messages to - ///< concatenate to the previous one sent by the same character. - ///< @since 2.8.0 - EFFECTS, ///< Enables effect overlays. - ///< @since 2.8.0 - Y_OFFSET, ///< Enables support for vertical offsets. - ///< @since 2.9.0 - EXPANDED_DESK_MODS, ///< Enables desk modifiers 2 through 5. - ///< @since 2.9.0 - AUTH_PACKET, ///< Enables the use of the AUTH packet. - ///< @since 2.9.1 - PREZOOM, ///< Preanim zoom. - CUSTOM_BLIPS ///< Allows the in-character messages to contain data about - ///< what blips to use for the character's current message. - }; - Q_ENUM_NS(BASE_FEATURE_SET) - - /** - * @brief Arranges data about the server the client is connected to. - */ - class ServerData { - public: - /** - * @brief Returns true if one of the standard features exists on the server. - * - * @details Internally, this calls get_feature(const QString &f_feature) - * with the enum's value converted to string. - * - * @param f_feature The feature to check for. - * - * @return True if the feature exists on the server. - */ - bool get_feature(const BASE_FEATURE_SET &f_feature) const; - - /** - * @brief Returns true if the feature exists on the server. - * - * @param f_feature The feature to check for. Case insensitive. - * - * @return True if the feature exists on the server. - */ - bool get_feature(const QString &f_feature) const; - - /** - * @brief Sets the feature list, overwriting the existing one. - * - * @param f_feature_list The new feature list of the server. - */ - void set_features(const QStringList &f_feature_list); - - /** - * @brief Self-explanatory: gets the software the server is running on. - * - * @return As brief description. - */ - QString get_server_software() const; - - /** - * @brief Self-explanatory: setter for server software. - * - * @param f_software The new server software. - */ - void set_server_software(const QString &f_software); - - /** - * @brief Getter for the server's asset URL. - * - * @return As brief description. - * - * @see m_asset_url - */ - QString get_asset_url() const; - - /** - * @brief Attempts to set the new asset URL for the server. - * - * @details The function converts the sole parameter into UTF-8, then - * attempts to percent decode it. The URL is only set if all these steps - * successfully happen. - * - * @param f_asset_url A QString that contains the URL. - */ - void set_asset_url(const QString &f_asset_url); - - private: - /// The features available on the server. Determines what - QStringList m_features; - - /// The software the server is running. - QString m_server_software; - - /** - * @brief A QString of an URL that defines the content repository - * send by the server. - * - * @details Introduced in Version 2.9.2. - * Addresses the issue of contenturl devlivery for WebAO - * without relying on someone adding the link manually. - */ - QString m_asset_url; - }; -} // namespace server - -#endif // SERVERDATA_H diff --git a/include/text_file_functions.h b/include/text_file_functions.h deleted file mode 100644 index 1da4d925..00000000 --- a/include/text_file_functions.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef TEXT_FILE_FUNCTIONS_H -#define TEXT_FILE_FUNCTIONS_H - -#include "aoapplication.h" -#include "file_functions.h" -#include <QColor> -#include <QDebug> -#include <QSettings> -#include <QStringList> -#include <QTextStream> -#include <QVector> - -#endif // TEXT_FILE_FUNCTIONS_H diff --git a/include/widgets/add_server_dialog.h b/include/widgets/add_server_dialog.h deleted file mode 100644 index db999bfe..00000000 --- a/include/widgets/add_server_dialog.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#ifndef ADD_SERVER_DIALOG_H -#define ADD_SERVER_DIALOG_H - -#include "interfaces/server_dialog.h" - -class QComboBox; -class QDialogButton; -class QDialogButtonBox; -class QLabel; -class QLineEdit; -class QPlainTextEdit; -class QPushButton; -class QSpinBox; - -class AddServerDialog : public AttorneyOnline::UI::FavoriteServerDialog { - Q_OBJECT -public: - AddServerDialog(); - ~AddServerDialog() = default; - -private: - QWidget *ui_widget; - - QLineEdit *ui_server_display_name_edit; - QLineEdit *ui_server_hostname_edit; - QSpinBox *ui_server_port_box; - QComboBox *ui_server_protocol_box; - QPlainTextEdit *ui_server_description_edit; - QDialogButtonBox *ui_server_dialog_button; - - // Legacy Server UI - QLabel *ui_server_legacy_lbl; - QLineEdit *ui_server_legacy_edit; - QPushButton *ui_server_legacy_load_button; - -private slots: - void onSavePressed() override; - void onCancelPressed() override; - void parseLegacyServerEntry(); -}; - -#endif // ADD_SERVER_DIALOG_H diff --git a/include/widgets/aooptionsdialog.h b/include/widgets/aooptionsdialog.h deleted file mode 100644 index ab366528..00000000 --- a/include/widgets/aooptionsdialog.h +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef AOOPTIONSDIALOG_H -#define AOOPTIONSDIALOG_H - -#include "options.h" - -#include <QtCore/QVariant> -#include <QtWidgets/QApplication> - -class QCheckBox; -class QComboBox; -class QDialogButtonBox; -class QLineEdit; -class QPlainTextEdit; -class QScrollArea; -class QSpinBox; -class QTabWidget; -class QLabel; -class QAbstractButton; - - -#include <QtWidgets/QDialog> -#include <QDirIterator> -#include <QListWidget> -#include <QTextBrowser> -#include <QTextStream> - -class AOApplication; - -struct OptionEntry { - std::function<void()> load; - std::function<void()> save; -}; - -class AOOptionsDialog : public QDialog { - Q_OBJECT -public: - explicit AOOptionsDialog(QDialog *parent = nullptr, - AOApplication *p_ao_app = nullptr); - -private: - AOApplication *ao_app; - - // Dialog interaction buttons. Save/Discard/Restore Defaults - QDialogButtonBox *ui_settings_buttons; - - // The gameplay tab - QWidget *ui_settings_widget; - QComboBox *ui_theme_combobox; - QComboBox *ui_subtheme_combobox; - QSpinBox *ui_theme_scaling_factor_sb; - QPushButton *ui_theme_reload_button; - QPushButton *ui_theme_folder_button; - QCheckBox *ui_evidence_double_click_cb; - QCheckBox *ui_animated_theme_cb; - QSpinBox *ui_stay_time_spinbox; - QCheckBox *ui_instant_objection_cb; - QSpinBox *ui_text_crawl_spinbox; - QSpinBox *ui_chat_ratelimit_spinbox; - QFrame *ui_log_names_divider; - QLineEdit *ui_username_textbox; - QCheckBox *ui_showname_cb; - QLineEdit *ui_default_showname_textbox; - QFrame *ui_net_divider; - QLineEdit *ui_ms_textbox; - QCheckBox *ui_discord_cb; - QLabel *ui_language_label; - QComboBox *ui_language_combobox; - QLabel *ui_scaling_label; - QComboBox *ui_scaling_combobox; - QCheckBox *ui_shake_cb; - QCheckBox *ui_effects_cb; - QCheckBox *ui_framenetwork_cb; - QCheckBox *ui_colorlog_cb; - QCheckBox *ui_stickysounds_cb; - QCheckBox *ui_stickyeffects_cb; - QCheckBox *ui_stickypres_cb; - QCheckBox *ui_customchat_cb; - QCheckBox *ui_sticker_cb; - QCheckBox *ui_continuous_cb; - QCheckBox *ui_category_stop_cb; - QCheckBox *ui_sfx_on_idle_cb; - - // The callwords tab - QPlainTextEdit *ui_callwords_textbox; - QCheckBox *ui_callwords_char_textbox; - - // The audio tab - QWidget *ui_audio_tab; - QWidget *ui_audio_widget; - QComboBox *ui_audio_device_combobox; - QSpinBox *ui_suppress_audio_spinbox; - QFrame *ui_volume_blip_divider; - QSpinBox *ui_bliprate_spinbox; - QCheckBox *ui_blank_blips_cb; - QCheckBox *ui_loopsfx_cb; - QCheckBox *ui_objectmusic_cb; - QCheckBox *ui_disablestreams_cb; - - // The asset tab - QListWidget *ui_mount_list; - QPushButton *ui_mount_add; - QPushButton *ui_mount_remove; - QPushButton *ui_mount_up; - QPushButton *ui_mount_down; - QPushButton *ui_mount_clear_cache; - - // The logging tab - QCheckBox *ui_downwards_cb; - QSpinBox *ui_length_spinbox; - QCheckBox *ui_log_newline_cb; - QSpinBox *ui_log_margin_spinbox; - QLabel *ui_log_timestamp_format_lbl; - QCheckBox *ui_log_timestamp_cb; - QComboBox *ui_log_timestamp_format_combobox; - QCheckBox *ui_desync_logs_cb; - QCheckBox *ui_log_ic_actions_cb; - QCheckBox *ui_log_text_cb; - QCheckBox *ui_log_demo_cb; - - /** - * Allows the AO2 master server hoster to go broke. - */ - QWidget *ui_privacy_tab; - QCheckBox *ui_privacy_optout_cb; - QFrame *ui_privacy_separator; - QTextBrowser *ui_privacy_policy; - - bool asset_cache_dirty = false; - - bool needsDefaultAudioDevice(); - void populateAudioDevices(); - void updateValues(); - - QVector<OptionEntry> optionEntries; - - template <typename T, typename V> - void setWidgetData(T *widget, const V &value); - - template <typename T, typename V> V widgetData(T *widget) const; - - template <typename T, typename V> - void registerOption(const QString &widgetName, V (Options::*getter)() const, - void (Options::*setter)(V)); - -signals: - void reloadThemeRequest(); - -private slots: - void savePressed(); - void discardPressed(); - void buttonClicked(QAbstractButton *button); - void onTimestampFormatEdited(); - void timestampCbChanged(int state); - void onReloadThemeClicked(); - void themeChanged(int i); - void setupUI(); - -}; - -#endif // AOOPTIONSDIALOG_H diff --git a/include/widgets/direct_connect_dialog.h b/include/widgets/direct_connect_dialog.h deleted file mode 100644 index 93175249..00000000 --- a/include/widgets/direct_connect_dialog.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef DIRECT_CONNECT_DIALOG_H -#define DIRECT_CONNECT_DIALOG_H - -#include <QDialog> -#include <QTimer> -#include <QRegularExpression> - -class QLabel; -class QSpinBox; -class QLineEdit; -class QPushButton; -class QComboBox; -class QLabel; -class NetworkManager; - -class DirectConnectDialog : public QDialog { - Q_OBJECT -public: - DirectConnectDialog(NetworkManager* p_net_manager); - ~DirectConnectDialog() = default; - -private slots: - void onConnectPressed(); - void onServerConnected(); - void onConnectTimeout(); - -private: - NetworkManager* net_manager; - - QLineEdit* ui_direct_hostname_edit; - - QLabel* ui_direct_connection_status_lbl; - QPushButton* ui_direct_connect_button; - QPushButton* ui_direct_cancel_button; - - QWidget* ui_widget; - QTimer connect_timeout; - - const int TCP_INDEX = 0; - const QRegularExpression SCHEME_PATTERN{"^\\w+://.+$"}; - const int CONNECT_TIMEOUT = 5 * 1000; - const QString DEFAULT_UI = "direct_connect_dialog.ui";; - -}; - -#endif // DIRECT_CONNECT_DIALOG_H diff --git a/include/widgets/edit_server_dialog.h b/include/widgets/edit_server_dialog.h deleted file mode 100644 index 3c4595ec..00000000 --- a/include/widgets/edit_server_dialog.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#ifndef EDIT_SERVER_DIALOG_H -#define EDIT_SERVER_DIALOG_H - -#include "interfaces/server_dialog.h" - -class QPushButton; -class QDialogButton; -class QLabel; -class QLineEdit; -class QComboBox; -class QSpinBox; -class QPlainTextEdit; -class QDialogButtonBox; - -class EditServerDialog : public AttorneyOnline::UI::FavoriteServerDialog { - Q_OBJECT -public: - EditServerDialog(int index); - ~EditServerDialog() = default; - -private: - QWidget *ui_widget; - - QLineEdit *ui_server_display_name_edit; - QLineEdit *ui_server_hostname_edit; - QSpinBox *ui_server_port_box; - QComboBox *ui_server_protocol_box; - QPlainTextEdit *ui_server_description_edit; - QDialogButtonBox *ui_server_dialog_button; - - // Legacy Server UI - QLabel *ui_server_legacy_lbl; - QLineEdit *ui_server_legacy_edit; - QPushButton *ui_server_legacy_load_button; - - int index; - void loadEntry(); - -private slots: - void onSavePressed() override; - void onCancelPressed() override; -}; - -#endif // EDIT_SERVER_DIALOG_H |
