aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-19 13:13:59 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-19 13:13:59 +0200
commit85c6c916541968f298badb391b718cdf6d81d332 (patch)
treebf69ea6c1d3a67ec7d41786b5cf883f93b3b87c6 /include
parent3f66a053942be531fe124cc16bb6b2e0eb94934e (diff)
Support youtube description chapters
Diffstat (limited to 'include')
-rw-r--r--include/MediaChapter.hpp10
-rw-r--r--include/VideoPlayer.hpp7
2 files changed, 13 insertions, 4 deletions
diff --git a/include/MediaChapter.hpp b/include/MediaChapter.hpp
new file mode 100644
index 0000000..f90493b
--- /dev/null
+++ b/include/MediaChapter.hpp
@@ -0,0 +1,10 @@
+#pragma once
+
+#include <string>
+
+namespace QuickMedia {
+ struct MediaChapter {
+ int start_seconds = 0;
+ std::string title; // newlines will be replaced by spaces
+ };
+} \ No newline at end of file
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp
index a7906a2..1a1e418 100644
--- a/include/VideoPlayer.hpp
+++ b/include/VideoPlayer.hpp
@@ -1,12 +1,10 @@
#pragma once
+#include "MediaChapter.hpp"
#include <SFML/Window/WindowHandle.hpp>
#include <SFML/System/Clock.hpp>
-#include <stdio.h>
#include <functional>
#include <json/value.h>
-
-#include <sys/un.h>
#include <X11/Xlib.h>
namespace QuickMedia {
@@ -41,7 +39,7 @@ namespace QuickMedia {
VideoPlayer& operator=(const VideoPlayer&) = delete;
// |audio_path| is only set when video and audio are separate files/urls.
- Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = "");
+ Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = "", const std::vector<MediaChapter> &chapters = {});
// Should be called every update frame
Error update();
@@ -83,5 +81,6 @@ namespace QuickMedia {
};
ResponseDataStatus response_data_status;
std::string resource_root;
+ char tmp_chapters_filepath[27];
};
}