ardour
|
#include <timer_test.h>
Public Member Functions | |
TimerTest () | |
void | _testGlibTimeoutSources () |
void | _testGlibmmSignalTimeouts () |
void | _testGlibmmTimeoutSources () |
void | _testTimers () |
void | _testTimersIdleFrequency () |
void | _testTimersBlockIdle () |
void | testGlibTimeoutSources () |
void | testGlibmmSignalTimeouts () |
void | testGlibmmTimeoutSources () |
void | testTimers () |
void | testTimersIdleFrequency () |
void | testTimersBlockIdle () |
Private Member Functions | |
CPPUNIT_TEST_SUITE (TimerTest) | |
CPPUNIT_TEST (testGlibTimeoutSources) | |
CPPUNIT_TEST (testGlibmmSignalTimeouts) | |
CPPUNIT_TEST (testGlibmmTimeoutSources) | |
CPPUNIT_TEST (testTimers) | |
CPPUNIT_TEST (testTimersIdleFrequency) | |
CPPUNIT_TEST (testTimersBlockIdle) | |
CPPUNIT_TEST_SUITE_END () | |
bool | on_idle_handler () |
bool | on_quit_handler () |
void | on_second_timeout () |
void | on_fast_timeout () |
void | on_rapid1_timeout () |
void | on_rapid2_timeout () |
bool | on_second_timeout_glibmm () |
bool | on_fast_timeout_glibmm () |
bool | on_rapid1_timeout_glibmm () |
bool | on_rapid2_timeout_glibmm () |
void | start_timing () |
void | reset_timing () |
void | reset_timing_run_main () |
void | connect_idle_handler () |
void | connect_quit_timeout () |
Static Private Member Functions | |
static guint64 | second_timer_usecs () |
static guint64 | fast_timer_usecs () |
static guint64 | rapid1_timer_usecs () |
static guint64 | rapid2_timer_usecs () |
static guint64 | second_timer_ms () |
static guint64 | fast_timer_ms () |
static guint64 | rapid1_timer_ms () |
static guint64 | rapid2_timer_ms () |
static guint64 | test_length_ms () |
static gboolean | _second_timeout_handler (void *) |
static gboolean | _fast_timeout_handler (void *) |
static gboolean | _rapid1_timeout_handler (void *) |
static gboolean | _rapid2_timeout_handler (void *) |
static void | simulate_load (const std::string &name, guint64 time_usecs) |
Private Attributes | |
std::string | m_current_test_name |
bool | m_connect_idle |
bool | m_block_idle |
Glib::RefPtr< Glib::MainLoop > | m_main |
Glib::RefPtr< Glib::MainContext > | m_context |
PBD::TimingData | m_idle_timing_data |
PBD::TimingData | m_second_timing_data |
PBD::TimingData | m_fast_timing_data |
PBD::TimingData | m_rapid1_timing_data |
PBD::TimingData | m_rapid2_timing_data |
The main point of this test is to the compare the different ways of setting a timeout with glib and glibmm and the PBD::Timers class and then to test them all again with the maximum multimedia timer resolution(1ms) set with timeBeginPeriod on Windows.
The test demonstrates that when using Glibmm TimeoutSources the frequency of the timers is different that using Glib based timeouts. In Ardour that resulted in a noticable increase in CPU Usage, but behaviour may vary.
The other thing being tested is what effect adding two short timeouts(<40ms) to a glib context has on the idle timeout on Windows.
Glib Timeout sources run at a higher priority than the idle handler, so the more work performed in the timeout handlers the less frequent the idle handler will run until doesn't get scheduled at all. The consequence of this is blocking the UI.
Similarily because timeout sources and UI updates/rendering occur in the same context in Gtk the length of expose/draw operations will affect the accuracy of the timeouts.
Definition at line 33 of file timer_test.h.
|
inline |
Definition at line 54 of file timer_test.h.
|
staticprivate |
Definition at line 215 of file timer_test.cc.
|
staticprivate |
Definition at line 223 of file timer_test.cc.
|
staticprivate |
Definition at line 231 of file timer_test.cc.
|
staticprivate |
Definition at line 207 of file timer_test.cc.
void TimerTest::_testGlibmmSignalTimeouts | ( | ) |
Definition at line 322 of file timer_test.cc.
void TimerTest::_testGlibmmTimeoutSources | ( | ) |
Definition at line 354 of file timer_test.cc.
void TimerTest::_testGlibTimeoutSources | ( | ) |
Definition at line 258 of file timer_test.cc.
void TimerTest::_testTimers | ( | ) |
Definition at line 416 of file timer_test.cc.
void TimerTest::_testTimersBlockIdle | ( | ) |
Definition at line 472 of file timer_test.cc.
void TimerTest::_testTimersIdleFrequency | ( | ) |
Definition at line 453 of file timer_test.cc.
|
private |
Definition at line 391 of file timer_test.cc.
|
private |
Definition at line 400 of file timer_test.cc.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inlinestaticprivate |
Definition at line 99 of file timer_test.h.
|
inlinestaticprivate |
Definition at line 87 of file timer_test.h.
|
private |
Definition at line 117 of file timer_test.cc.
|
private |
Definition at line 128 of file timer_test.cc.
|
private |
Definition at line 171 of file timer_test.cc.
|
private |
Definition at line 181 of file timer_test.cc.
|
private |
Definition at line 135 of file timer_test.cc.
|
private |
Definition at line 146 of file timer_test.cc.
|
private |
Definition at line 153 of file timer_test.cc.
|
private |
Definition at line 164 of file timer_test.cc.
|
private |
Definition at line 89 of file timer_test.cc.
|
private |
Definition at line 110 of file timer_test.cc.
|
inlinestaticprivate |
Definition at line 102 of file timer_test.h.
|
inlinestaticprivate |
Definition at line 90 of file timer_test.h.
|
inlinestaticprivate |
Definition at line 105 of file timer_test.h.
|
inlinestaticprivate |
Definition at line 93 of file timer_test.h.
|
private |
Definition at line 189 of file timer_test.cc.
|
private |
Definition at line 239 of file timer_test.cc.
|
inlinestaticprivate |
Definition at line 96 of file timer_test.h.
|
inlinestaticprivate |
Definition at line 84 of file timer_test.h.
|
staticprivate |
Definition at line 64 of file timer_test.cc.
|
private |
Definition at line 198 of file timer_test.cc.
|
inlinestaticprivate |
Definition at line 108 of file timer_test.h.
void TimerTest::testGlibmmSignalTimeouts | ( | ) |
Definition at line 315 of file timer_test.cc.
void TimerTest::testGlibmmTimeoutSources | ( | ) |
Definition at line 347 of file timer_test.cc.
void TimerTest::testGlibTimeoutSources | ( | ) |
Definition at line 251 of file timer_test.cc.
void TimerTest::testTimers | ( | ) |
Definition at line 409 of file timer_test.cc.
void TimerTest::testTimersBlockIdle | ( | ) |
Definition at line 465 of file timer_test.cc.
void TimerTest::testTimersIdleFrequency | ( | ) |
Definition at line 446 of file timer_test.cc.
|
private |
Definition at line 114 of file timer_test.h.
|
private |
Definition at line 113 of file timer_test.h.
|
private |
Definition at line 142 of file timer_test.h.
|
private |
Definition at line 111 of file timer_test.h.
|
private |
Definition at line 149 of file timer_test.h.
|
private |
Definition at line 147 of file timer_test.h.
|
private |
Definition at line 141 of file timer_test.h.
|
private |
Definition at line 150 of file timer_test.h.
|
private |
Definition at line 151 of file timer_test.h.
|
private |
Definition at line 148 of file timer_test.h.