From 02e029ed40f801e0710b09062069e7083cd30b93 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 17 Feb 2022 19:18:19 +0100 Subject: Add local anime tracking. Check readme for more info about local_anime config --- include/BodyItem.hpp | 15 +++++++++++++++ include/Config.hpp | 1 - include/Path.hpp | 2 +- include/VideoPlayer.hpp | 5 +++-- 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/BodyItem.hpp b/include/BodyItem.hpp index eef674e..2e7dad4 100644 --- a/include/BodyItem.hpp +++ b/include/BodyItem.hpp @@ -2,6 +2,7 @@ #include "Text.hpp" #include +#include #include namespace mgl { @@ -30,10 +31,24 @@ namespace QuickMedia { BODY_THEME_MODERN_SPACIOUS }; + struct ThumbnailWidget { + mgl::vec2f position; + mgl::vec2f size; + }; + + struct Widgets { + std::optional thumbnail; + }; + // TODO: Remove and create an Userdata class instead to replace the void* userdata in BodyItem class BodyItemExtra { public: virtual ~BodyItemExtra() = default; + + virtual void draw_overlay(mgl::Window &window, const Widgets &widgets) { + (void)window; + (void)widgets; + } }; struct Reaction { diff --git a/include/Config.hpp b/include/Config.hpp index ee9e190..b191c96 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -39,7 +39,6 @@ namespace QuickMedia { struct LocalAnimeConfig { std::string directory; bool sort_by_name = false; - bool sort_episodes_by_name = true; }; struct Config { diff --git a/include/Path.hpp b/include/Path.hpp index 67e6942..a881a53 100644 --- a/include/Path.hpp +++ b/include/Path.hpp @@ -39,7 +39,7 @@ namespace QuickMedia { return data.substr(name - data.data(), extension - name); } - // Returns empty string if no extension + // Returns extension with the dot. Returns empty string if no extension const char* ext() const { size_t slash_index = data.rfind('/'); size_t index = data.rfind('.'); diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 989bfd2..feede37 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -39,8 +39,9 @@ namespace QuickMedia { mgl::WindowHandle parent_window; bool no_video = false; bool use_system_mpv_config = false; - bool use_system_input_config = false; // use_system_mpv_config has to be true for this + bool use_system_input_config = false; // |use_system_mpv_config| has to be true if this is set to true bool keep_open = false; + bool resume = false; std::string resource_root; int monitor_height = 1080; bool use_youtube_dl = false; @@ -50,7 +51,7 @@ namespace QuickMedia { std::string plugin_name; }; - // @event_callback is called from another thread + // Important: do not call |get_time_in_file| or |add_subtitle| from the |event_callback| callback VideoPlayer(StartupArgs startup_args, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback); ~VideoPlayer(); VideoPlayer(const VideoPlayer&) = delete; -- cgit v1.2.3