diff options
author | Robin Gareus <robin@gareus.org> | 2014-10-25 19:21:15 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-10-25 19:21:15 +0200 |
commit | baea04713f6a4f96e42bb8f3ed80446cd722f253 (patch) | |
tree | c2d54b5f98469d089db301502a73fe287244428d /gtk2_ardour/ardour_ui_dialogs.cc | |
parent | e02efddb219df379869a4362fa939be36b2aa1f1 (diff) |
combine short periodic timeout functions for windows.
Fixes excessive CPU usage (spinlock instead of sleep/WaitForSingleObject)
MS Windows has a scheduler time-slice of 15ms.
Ardour has two fast timeout functions: The FPS timeout (20-60Hz, clock
video-monitor) and a fast-screen-update (25Hz, meters etc).
They are loosely coupled (async) and scheduled from the main application
thread (gtk main).
Since they're async, gtk schedules them as needed. Even though the actual
period of the separate timeouts is larger. The effective period between
all timeout callbacks is <15ms and the main application thread never idles.
Diffstat (limited to 'gtk2_ardour/ardour_ui_dialogs.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 8cd65ef378..6545253582 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -184,7 +184,9 @@ ARDOUR_UI::set_session (Session *s) second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second), 1000); point_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds), 100); +#ifndef PLATFORM_WINDOWS point_zero_something_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_something_seconds), 40); +#endif set_fps_timeout_connection(); update_format (); @@ -286,7 +288,9 @@ ARDOUR_UI::unload_session (bool hide_stuff) second_connection.disconnect (); point_one_second_connection.disconnect (); +#ifndef PLATFORM_WINDOWS point_zero_something_second_connection.disconnect(); +#endif fps_connection.disconnect(); if (editor_meter) { |