1 #include <sigc++/sigc++.h>
2 #include "midi_clock_slave_test.h"
5 using namespace ARDOUR;
7 CPPUNIT_TEST_SUITE_REGISTRATION( MIDIClock_SlaveTest );
10 MIDIClock_SlaveTest::testStepResponse ()
13 framepos_t position = 0;
15 MIDI::Parser* parser = 0;
17 TestSlaveSessionProxy *sess = (TestSlaveSessionProxy *) session;
18 framecnt_t period_size = 4096;
19 sess->set_period_size (period_size);
21 bandwidth = 1.0 / 60.0;
23 framepos_t start_time = 1000000;
24 start (*parser, start_time);
26 update_midi_clock (*parser, start_time);
28 for (framecnt_t i = 1; i<= 100 * period_size; i++) {
30 framecnt_t input_delta = framecnt_t (one_ppqn_in_frames + 0.1 * (double(random()) / double (RAND_MAX)) * one_ppqn_in_frames);
32 if (i % input_delta == 0) {
33 update_midi_clock (*parser, start_time + i);
36 if (i % period_size == 0) {
38 speed_and_position (speed, position);
39 sess->request_transport_speed (speed);