// SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL #ifndef CHIAKI_GUI_H #define CHIAKI_GUI_H #include #include #include "nanovg.h" #include "nanovg_gl.h" #include "nanovg_gl_utils.h" #include #include #include #include "host.h" #include "settings.h" #include "discoverymanager.h" #include "io.h" class HostInterface : public brls::List { private: IO * io; Host * host; Settings * settings; bool connected = false; public: HostInterface(IO * io, Host * host, Settings * settings); ~HostInterface(); static void Register(IO * io, Host * host, Settings * settings, std::function success_cb = nullptr); void Register(); void Wakeup(brls::View * view); void Connect(brls::View * view); void ConnectSession(); void Disconnect(); bool Stream(); bool CloseStream(ChiakiQuitEvent * quit); }; class MainApplication { private: Settings * settings; ChiakiLog * log; DiscoveryManager * discoverymanager; IO * io; brls::TabFrame * rootFrame; std::map host_menuitems; // add_host local settings std::string remote_display_name = ""; std::string remote_addr = ""; ChiakiTarget remote_ps_version = CHIAKI_TARGET_PS5_1; bool BuildConfigurationMenu(brls::List *, Host * host = nullptr); void BuildAddHostConfigurationMenu(brls::List *); public: MainApplication(DiscoveryManager * discoverymanager, IO * io); ~MainApplication(); bool Load(); }; class PSRemotePlay : public brls::View { private: brls::AppletFrame * frame; // to display stream on screen IO * io; // to send gamepad inputs Host * host; brls::Label * label; ChiakiControllerState state = { 0 }; // FPS calculation // double base_time; // int frame_counter = 0; // int fps = 0; public: PSRemotePlay(IO * io, Host * host); ~PSRemotePlay(); void draw(NVGcontext * vg, int x, int y, unsigned width, unsigned height, brls::Style * style, brls::FrameContext * ctx) override; }; #endif // CHIAKI_GUI_H