From 2030684b16004a4f6c60f499584366ae5ad57bc9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 15 Feb 2022 21:52:40 +0100 Subject: Finish video player --- include/VideoPlayer.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 2ccd280..f75d76f 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -5,7 +5,6 @@ #include #include #include -#include #include namespace QuickMedia { @@ -47,15 +46,12 @@ namespace QuickMedia { // Returns time in seconds Error get_time_in_file(double *result); - - Error set_property(const std::string &property_name, const Json::Value &value); - Error get_property(const std::string &property_name, Json::Value *result, Json::ValueType result_type); - Error add_subtitle(const std::string &url, const std::string &title, const std::string &lang); int exit_status; private: - Error send_command(const char *cmd, size_t size); + uint32_t get_next_request_id(); + Error send_command(Json::Value &json_root, Json::Value *result, Json::ValueType result_type); Error launch_video_process(const char *path, const char *audio_path, mgl::WindowHandle parent_window, const std::string &title, const std::string &start_time); VideoPlayer::Error read_ipc_func(); private: @@ -65,20 +61,17 @@ namespace QuickMedia { bool keep_open; bool use_youtube_dl; pid_t video_process_id; - bool connected_to_ipc; mgl::Clock retry_timer; int connect_tries; int find_window_tries; int monitor_height; int ipc_socket = -1; - struct sockaddr_un ipc_addr; - char ipc_server_path[L_tmpnam]; EventCallbackFunc event_callback; VideoPlayerWindowCreateCallback window_create_callback; mgl::WindowHandle window_handle; mgl::WindowHandle parent_window; Display *display; - unsigned int request_id; + unsigned int request_id_counter; unsigned int expected_request_id; Json::Value request_response_data; -- cgit v1.2.3