summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-21 02:30:09 +0000
committerDavid Robillard <d@drobilla.net>2007-02-21 02:30:09 +0000
commit2cef260f92785971d7d61489c2278ad7afae0dd7 (patch)
tree308369a7102750714685d4e2d2351ec94e53898c /tests
parent58fa57acec95fc590fb2b53c512a5c300e6049a6 (diff)
downloadraul-2cef260f92785971d7d61489c2278ad7afae0dd7.tar.gz
raul-2cef260f92785971d7d61489c2278ad7afae0dd7.tar.bz2
raul-2cef260f92785971d7d61489c2278ad7afae0dd7.zip
Tempo based time in Machina (and related utilities added to Raul).
git-svn-id: http://svn.drobilla.net/lad/raul@324 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/time_test.cpp29
2 files changed, 32 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9ae9810..05b0f21 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,18 +3,20 @@ if BUILD_TESTS
AM_CXXFLAGS = -I.. -lpthread @RASQAL_CFLAGS@ @GLIBMM_CFLAGS@
ALL_LIBS = @RASQAL_LIBS@ @GLIBMM_LIBS@ ../src/libraul.la
-bin_PROGRAMS = path_test thread_test queue_test atomic_test list_test
+bin_PROGRAMS = path_test thread_test queue_test atomic_test list_test time_test
thread_test_LDADD = $(ALL_LIBS)
path_test_LDADD = $(ALL_LIBS)
queue_test_LDADD = $(ALL_LIBS)
atomic_test_LDADD = $(ALL_LIBS)
list_test_LDADD = $(ALL_LIBS)
+time_test_LDADD = $(ALL_LIBS)
path_test_SOURCES = path_test.cpp
thread_test_SOURCES = thread_test.cpp
queue_test_SOURCES = queue_test.cpp
atomic_test_SOURCES = atomic_test.cpp
list_test_SOURCES = list_test.cpp
+time_test_SOURCES = time_test.cpp
endif
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
new file mode 100644
index 0000000..0eb0a83
--- /dev/null
+++ b/tests/time_test.cpp
@@ -0,0 +1,29 @@
+#include <iostream>
+#include <raul/TimeSlice.h>
+
+using namespace std;
+using namespace Raul;
+
+
+int
+main()
+{
+ TimeSlice ts(1/48000.0, 120);
+
+ string in_string;
+ double in_double = 0;
+
+ cout << "Beats: ";
+ cin >> in_double;
+
+ cout << "\tSeconds: ";
+ cout << ts.beats_to_seconds(in_double);
+ cout << endl;
+
+ cout << "\tTicks: ";
+ cout << ts.beats_to_ticks(in_double);
+ cout << endl;
+
+ return 0;
+}
+