From b9a5d95635a2f0094cd919f0b11f37336012dc24 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 14 Nov 2020 06:15:06 +0100 Subject: Resume video when navigating back from related/channel videos --- include/VideoPlayer.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 86410da..abd715a 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -36,7 +36,7 @@ namespace QuickMedia { }; // @event_callback is called from another thread - VideoPlayer(bool use_tor, bool no_video, bool use_system_mpv_config, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root); + VideoPlayer(bool use_tor, bool no_video, bool use_system_mpv_config, bool resume_playback, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root); ~VideoPlayer(); VideoPlayer(const VideoPlayer&) = delete; VideoPlayer& operator=(const VideoPlayer&) = delete; @@ -60,12 +60,15 @@ namespace QuickMedia { Error is_seekable(bool *result); + Error quit_and_save_watch_later(); + bool is_connected() const { return connected_to_ipc; } - int exit_status; - private: 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); + + int exit_status; + private: Error send_command(const char *cmd, size_t size); Error launch_video_process(const char *path, sf::WindowHandle parent_window, const std::string &plugin_name); VideoPlayer::Error read_ipc_func(); @@ -73,6 +76,7 @@ namespace QuickMedia { bool use_tor; bool no_video; bool use_system_mpv_config; + bool resume_playback; pid_t video_process_id; int ipc_socket; bool connected_to_ipc; -- cgit v1.2.3-70-g09d2