diff options
author | David Robillard <d@drobilla.net> | 2017-02-18 18:32:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-18 19:38:13 +0100 |
commit | f240b08a1799b3aa6a29701c90388d51c0c1b2ce (patch) | |
tree | 28ec7429aa10f28710023fdcc43d07a4f0b4ebc9 /tests | |
parent | 6141b832946006a6ec3c1a3a70bd729c0404771e (diff) | |
download | ingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.tar.gz ingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.tar.bz2 ingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.zip |
Add experimental PortAudio driver
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ingen_test.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index 1ac2e383..f5ba45c6 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -133,28 +133,11 @@ ingen_try(bool cond, const char* msg) } } -static uint32_t -flush_events(Ingen::World* world, const uint32_t start) -{ - static const uint32_t block_length = 4096; - int count = 0; - uint32_t offset = start; - while (world->engine()->pending_events()) { - world->engine()->locate(offset, block_length); - world->engine()->run(block_length); - world->engine()->main_iteration(); - g_usleep(1000); - ++count; - offset += block_length; - } - return offset; -} - int main(int argc, char** argv) { Glib::thread_init(); - set_bundle_path_from_code((void*)&flush_events); + set_bundle_path_from_code((void*)&ingen_try); // Create world try { @@ -194,12 +177,12 @@ main(int argc, char** argv) world->engine()->init(48000.0, 4096, 4096); world->engine()->activate(); - // Load patch + // Load graph if (!world->parser()->parse_file(world, world->interface().get(), start_graph)) { cerr << "error: failed to load initial graph " << start_graph << endl; return EXIT_FAILURE; } - uint32_t time = flush_events(world, 0); + world->engine()->flush_events(std::chrono::milliseconds(20)); // Read commands @@ -262,7 +245,7 @@ main(int argc, char** argv) return EXIT_FAILURE; } - time = flush_events(world, time); + world->engine()->flush_events(std::chrono::milliseconds(20)); } delete cmds; @@ -277,7 +260,7 @@ main(int argc, char** argv) // Undo every event (should result in a graph identical to the original) for (int i = 0; i < n_events; ++i) { world->interface()->undo(); - time = flush_events(world, time); + world->engine()->flush_events(std::chrono::milliseconds(20)); } // Save completely undone graph @@ -289,7 +272,7 @@ main(int argc, char** argv) // Redo every event (should result in a graph identical to the pre-undo output) for (int i = 0; i < n_events; ++i) { world->interface()->redo(); - time = flush_events(world, time); + world->engine()->flush_events(std::chrono::milliseconds(20)); } // Save completely redone graph |