From 257cb6d783ab96f77f187ead1b6032cd4b660a0e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Mar 2021 20:47:24 +0100 Subject: Temporary add --low-cpu-mode to reduce cpu usage when idle --- include/QuickMedia.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/QuickMedia.hpp') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 512a722..4142a27 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -95,6 +95,8 @@ namespace QuickMedia { void youtube_get_watch_history(BodyItems &history_items); private: void base_event_handler(sf::Event &event, PageType previous_page, Body *body, SearchBar *search_bar, bool handle_key_press = true, bool handle_searchbar = true); + void event_idle_handler(const sf::Event &event); + void update_idle_state(); void page_loop_render(sf::RenderWindow &window, std::vector &tabs, int selected_tab, TabAssociatedData &tab_associated_data, const Json::Value *json_chapters); using PageLoopSubmitHandler = std::function &new_tabs)>; void page_loop(std::vector &tabs, int start_tab_index = 0, PageLoopSubmitHandler after_submit_handler = nullptr); @@ -179,5 +181,8 @@ namespace QuickMedia { sf::Vector2f body_size; bool show_room_side_panel = true; std::thread::id main_thread_id; + sf::Clock idle_timer; + bool idle = true; + bool low_cpu_mode = false; }; } \ No newline at end of file -- cgit v1.2.3