aboutsummaryrefslogtreecommitdiff
path: root/include/VideoPlayer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/VideoPlayer.hpp')
-rw-r--r--include/VideoPlayer.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp
index e98221e..9fbad33 100644
--- a/include/VideoPlayer.hpp
+++ b/include/VideoPlayer.hpp
@@ -3,11 +3,13 @@
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Sprite.hpp>
+#include <SFML/Graphics/RectangleShape.hpp>
#include <SFML/Window/Context.hpp>
#include <thread>
#include <mutex>
#include <atomic>
#include <stdexcept>
+#include <functional>
class mpv_handle;
class mpv_opengl_cb_context;
@@ -17,6 +19,8 @@ namespace QuickMedia {
public:
VideoInitializationException(const std::string &errMsg) : std::runtime_error(errMsg) {}
};
+
+ using PlaybackEndedCallback = std::function<void()>;
class VideoPlayer {
public:
@@ -27,11 +31,14 @@ namespace QuickMedia {
void setPosition(float x, float y);
bool resize(const sf::Vector2i &size);
void draw(sf::RenderWindow &window);
+
+ void load_file(const std::string &path);
// This counter is incremented when mpv wants to redraw content
std::atomic_int redrawCounter;
- private:
sf::Context context;
+ PlaybackEndedCallback onPlaybackEndedCallback;
+ private:
mpv_handle *mpv;
mpv_opengl_cb_context *mpvGl;
std::thread renderThread;
@@ -42,5 +49,7 @@ namespace QuickMedia {
bool alive;
sf::Vector2i video_size;
sf::Vector2i desired_size;
+ sf::RectangleShape seekbar;
+ sf::RectangleShape seekbar_background;
};
}