diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-08 04:58:17 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-08-08 04:58:20 +0200 |
commit | 0943801f321216dabe9f45593f608a222c0d4310 (patch) | |
tree | b74f2980628a19ae6bbe8e74b41b6cd665453cc9 /include | |
parent | 3c9ca2c97ae7a2b39bfe5c5e8a9d7941f9fb1525 (diff) |
Add video controls
Diffstat (limited to 'include')
-rw-r--r-- | include/VideoPlayer.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 0ae05b0..4f60883 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -26,10 +26,10 @@ namespace QuickMedia { class VideoPlayer { public: // Throws VideoInitializationException on error - VideoPlayer(sf::RenderWindow &window, unsigned int width, unsigned int height, const char *file, bool loop = false); + VideoPlayer(sf::RenderWindow *window, unsigned int width, unsigned int height, const char *file, bool loop = false); ~VideoPlayer(); - void handleEvent(sf::Event &event); + void handle_event(sf::Event &event); void setPosition(float x, float y); void resize(const sf::Vector2f &size); void draw(sf::RenderWindow &window); @@ -42,6 +42,7 @@ namespace QuickMedia { std::atomic_bool event_update; PlaybackEndedCallback onPlaybackEndedCallback; private: + void on_doubleclick(); void handle_mpv_events(); private: mpv_handle *mpv; @@ -55,5 +56,9 @@ namespace QuickMedia { sf::RectangleShape seekbar; sf::RectangleShape seekbar_background; sf::Clock cursor_last_active_timer; + sf::Clock time_since_last_left_click; + int left_click_counter; + sf::RenderWindow *window; + bool video_is_fullscreen; }; } |