aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-16 20:47:24 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-16 20:47:24 +0100
commit257cb6d783ab96f77f187ead1b6032cd4b660a0e (patch)
tree65fd8f1f1255eb611e5d522a631a599bc4e56eae /include
parent34828885b99a808a09bb05820faa3f10a5025a47 (diff)
Temporary add --low-cpu-mode to reduce cpu usage when idle
Diffstat (limited to 'include')
-rw-r--r--include/QuickMedia.hpp5
1 files changed, 5 insertions, 0 deletions
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<Tab> &tabs, int selected_tab, TabAssociatedData &tab_associated_data, const Json::Value *json_chapters);
using PageLoopSubmitHandler = std::function<void(const std::vector<Tab> &new_tabs)>;
void page_loop(std::vector<Tab> &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