From 81f335330c209359ef1d2b3bdedc5c19790d2eba Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Feb 2008 18:23:57 +0000 Subject: Use Raul::TimeStamp (LV2 compatible typed 32:32 fixed timestamp) everywhere. Fix initial size of Patchage messages window. Machina disabled for now (transitioning to generic timestamps). git-svn-id: http://svn.drobilla.net/lad/raul@1133 a436a847-0d15-0410-975c-d299462d15a1 --- tests/time_test.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'tests/time_test.cpp') diff --git a/tests/time_test.cpp b/tests/time_test.cpp index c5c89b7..2f87f87 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -1,5 +1,6 @@ -#include +#include #include +#include using namespace std; using namespace Raul; @@ -8,19 +9,22 @@ using namespace Raul; int main() { - TimeSlice ts(1/48000.0, 120); - - double in_double = 0; + TimeUnit unit(TimeUnit::BEATS, 19200); + TimeSlice ts(48000, 120); + double in_double; cout << "Beats: "; cin >> in_double; + + TimeStamp t(unit, (uint32_t)in_double, + (uint32_t)((in_double - (uint32_t)in_double) * unit.ppt())); cout << "\tSeconds: "; - cout << ts.beats_to_seconds(in_double); + cout << ts.beats_to_seconds(t); cout << endl; cout << "\tTicks: "; - cout << ts.beats_to_ticks(in_double); + cout << ts.beats_to_ticks(t); cout << endl; return 0; -- cgit v1.2.1