diff options
author | David Robillard <d@drobilla.net> | 2008-02-09 18:23:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-09 18:23:57 +0000 |
commit | 81f335330c209359ef1d2b3bdedc5c19790d2eba (patch) | |
tree | 2262742e60b1360ecd66bf1f5be57e4df2b53de3 /tests/time_test.cpp | |
parent | 43dd122ffcdb6a0b40a56777245a870e411d439c (diff) | |
download | raul-81f335330c209359ef1d2b3bdedc5c19790d2eba.tar.gz raul-81f335330c209359ef1d2b3bdedc5c19790d2eba.tar.bz2 raul-81f335330c209359ef1d2b3bdedc5c19790d2eba.zip |
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
Diffstat (limited to 'tests/time_test.cpp')
-rw-r--r-- | tests/time_test.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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 <iostream> +#include <raul/TimeStamp.hpp> #include <raul/TimeSlice.hpp> +#include <iostream> 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; |