diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Body.hpp | 5 | ||||
-rw-r--r-- | include/QuickMedia.hpp | 2 | ||||
-rw-r--r-- | include/StringUtils.hpp | 11 | ||||
-rw-r--r-- | include/VideoPlayer.hpp | 3 |
4 files changed, 19 insertions, 2 deletions
diff --git a/include/Body.hpp b/include/Body.hpp index a2db62a..c394519 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -8,6 +8,8 @@ #include <thread> namespace QuickMedia { + class Program; + class BodyItem { public: BodyItem(const std::string &_title): title(_title), visible(true) { @@ -24,7 +26,7 @@ namespace QuickMedia { class Body { public: - Body(sf::Font &font); + Body(Program *program, sf::Font &font); // Select previous item, ignoring invisible items void select_previous_item(); @@ -56,6 +58,7 @@ namespace QuickMedia { std::string url; std::shared_ptr<sf::Texture> texture; }; + Program *program; std::shared_ptr<sf::Texture> load_thumbnail_from_url(const std::string &url); std::vector<ThumbnailData> item_thumbnail_textures; bool loading_thumbnail; diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 8479d58..6906036 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -21,6 +21,8 @@ namespace QuickMedia { Program(); ~Program(); int run(int argc, char **argv); + + Plugin* get_current_plugin() { return current_plugin; } private: void base_event_handler(sf::Event &event, Page previous_page); void search_suggestion_page(); diff --git a/include/StringUtils.hpp b/include/StringUtils.hpp new file mode 100644 index 0000000..72210c9 --- /dev/null +++ b/include/StringUtils.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include <string> +#include <functional> + +namespace QuickMedia { + // Return false to stop iterating + using StringSplitCallback = std::function<bool(const char *str, size_t size)>; + + void string_split(const std::string &str, char delimiter, StringSplitCallback callback_func); +}
\ No newline at end of file diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index 3839530..e1763f6 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -35,7 +35,7 @@ namespace QuickMedia { }; // @event_callback is called from another thread - VideoPlayer(EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback); + VideoPlayer(bool use_tor, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback); ~VideoPlayer(); VideoPlayer(const VideoPlayer&) = delete; VideoPlayer& operator=(const VideoPlayer&) = delete; @@ -65,6 +65,7 @@ namespace QuickMedia { Error launch_video_process(const char *path, sf::WindowHandle parent_window); VideoPlayer::Error read_ipc_func(); private: + bool use_tor; pid_t video_process_id; int ipc_socket; bool connected_to_ipc; |