summaryrefslogtreecommitdiffstats
path: root/tests/time_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/time_test.cpp')
-rw-r--r--tests/time_test.cpp16
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;