aboutsummaryrefslogtreecommitdiff
path: root/include/VideoPlayer.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-17 09:47:45 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-17 09:59:29 +0100
commit453eac7f1f5ef70390ec51087fc1f190811a7507 (patch)
tree21a32ef6de9a3d7c29562484104b56c12518a6f0 /include/VideoPlayer.hpp
parentfc49d40c0d2f6edbbe9dde1f1b53d6a17e9d9f7d (diff)
Replace sfml with mgl
Diffstat (limited to 'include/VideoPlayer.hpp')
-rw-r--r--include/VideoPlayer.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp
index 4eab812..2ccd280 100644
--- a/include/VideoPlayer.hpp
+++ b/include/VideoPlayer.hpp
@@ -1,8 +1,8 @@
#pragma once
#include "MediaChapter.hpp"
-#include <SFML/Window/WindowHandle.hpp>
-#include <SFML/System/Clock.hpp>
+#include <mglpp/window/Window.hpp>
+#include <mglpp/system/Clock.hpp>
#include <functional>
#include <json/value.h>
#include <sys/un.h>
@@ -10,7 +10,7 @@
namespace QuickMedia {
using EventCallbackFunc = std::function<void(const char *event_name)>;
- using VideoPlayerWindowCreateCallback = std::function<void(sf::WindowHandle window)>;
+ using VideoPlayerWindowCreateCallback = std::function<void(mgl::WindowHandle window)>;
// Currently this video player launches mpv and embeds it into the QuickMedia window
class VideoPlayer {
@@ -41,7 +41,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 use_youtube_dl, const std::string &title, const std::string &start_time = "", const std::vector<MediaChapter> &chapters = {});
+ Error load_video(const char *path, const char *audio_path, mgl::WindowHandle parent_window, bool use_youtube_dl, const std::string &title, const std::string &start_time = "", const std::vector<MediaChapter> &chapters = {});
// Should be called every update frame
Error update();
@@ -56,7 +56,7 @@ namespace QuickMedia {
int exit_status;
private:
Error send_command(const char *cmd, size_t size);
- Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, const std::string &title, const std::string &start_time);
+ 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:
std::string plugin_name;
@@ -66,7 +66,7 @@ namespace QuickMedia {
bool use_youtube_dl;
pid_t video_process_id;
bool connected_to_ipc;
- sf::Clock retry_timer;
+ mgl::Clock retry_timer;
int connect_tries;
int find_window_tries;
int monitor_height;
@@ -75,8 +75,8 @@ namespace QuickMedia {
char ipc_server_path[L_tmpnam];
EventCallbackFunc event_callback;
VideoPlayerWindowCreateCallback window_create_callback;
- sf::WindowHandle window_handle;
- sf::WindowHandle parent_window;
+ mgl::WindowHandle window_handle;
+ mgl::WindowHandle parent_window;
Display *display;
unsigned int request_id;
unsigned int expected_request_id;