aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-15 21:52:40 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-16 02:07:21 +0100
commit2030684b16004a4f6c60f499584366ae5ad57bc9 (patch)
treed22d30f8f41b05f75999369c05a6654fe87e5581 /include
parent4efce988240473a84a19dc2d378289b875d99a9e (diff)
Finish video player
Diffstat (limited to 'include')
-rw-r--r--include/VideoPlayer.hpp13
1 files changed, 3 insertions, 10 deletions
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 <mglpp/system/Clock.hpp>
#include <functional>
#include <json/value.h>
-#include <sys/un.h>
#include <X11/Xlib.h>
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;