aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-17 19:18:19 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-17 19:18:34 +0100
commit02e029ed40f801e0710b09062069e7083cd30b93 (patch)
treeb3bd567ad0c03074064d62d32a876920aa58fab4 /include
parentd4cd63129ae5dff8fd69525424e0f8cb9ae1a905 (diff)
Add local anime tracking. Check readme for more info about local_anime config
Diffstat (limited to 'include')
-rw-r--r--include/BodyItem.hpp15
-rw-r--r--include/Config.hpp1
-rw-r--r--include/Path.hpp2
-rw-r--r--include/VideoPlayer.hpp5
4 files changed, 19 insertions, 4 deletions
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 <memory>
+#include <optional>
#include <mglpp/graphics/Text.hpp>
namespace mgl {
@@ -30,10 +31,24 @@ namespace QuickMedia {
BODY_THEME_MODERN_SPACIOUS
};
+ struct ThumbnailWidget {
+ mgl::vec2f position;
+ mgl::vec2f size;
+ };
+
+ struct Widgets {
+ std::optional<ThumbnailWidget> 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;