summaryrefslogtreecommitdiff
path: root/libs/evoral/src/Note.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
commitc1cfa12d6e5136d2e3e5501e83ff74c5009a9e60 (patch)
tree56d2811bc8b9d6f2a5accfa8e497ddd5976c7c7a /libs/evoral/src/Note.cpp
parentcae74309a583c29dd6cc2081425c2e7b673ea13e (diff)
Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
Diffstat (limited to 'libs/evoral/src/Note.cpp')
-rw-r--r--libs/evoral/src/Note.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/evoral/src/Note.cpp b/libs/evoral/src/Note.cpp
index 8ff3ccaff1..918727ef50 100644
--- a/libs/evoral/src/Note.cpp
+++ b/libs/evoral/src/Note.cpp
@@ -39,8 +39,8 @@ Note<Time>::Note(uint8_t chan, Time t, Time l, uint8_t n, uint8_t v)
_off_event.buffer()[1] = n;
_off_event.buffer()[2] = 0x40;
- assert(musical_time_equal (time(),t));
- assert(musical_time_equal (length(), l));
+ assert(time() == t);
+ assert(length() == l);
assert(note() == n);
assert(velocity() == v);
assert(_on_event.channel() == _off_event.channel());
@@ -67,9 +67,9 @@ Note<Time>::Note(const Note<Time>& copy)
memcpy(_off_event_buffer, copy._off_event_buffer, 3);
*/
- assert(musical_time_equal (time(),copy.time()));
- assert(musical_time_equal (end_time(), copy.end_time()));
- assert(musical_time_equal (length(), copy.length()));
+ assert(time() == copy.time());
+ assert(end_time() == copy.end_time());
+ assert(length() == copy.length());
assert(note() == copy.note());
assert(velocity() == copy.velocity());
assert(_on_event.channel() == _off_event.channel());
@@ -95,9 +95,9 @@ Note<Time>::operator=(const Note<Time>& other)
_on_event = other._on_event;
_off_event = other._off_event;
- assert(musical_time_equal (time(),other.time()));
- assert(musical_time_equal (end_time(), other.end_time()));
- assert(musical_time_equal (length(), other.length()));
+ assert(time() == other.time());
+ assert(end_time() == other.end_time());
+ assert(length() == other.length());
assert(note() == other.note());
assert(velocity() == other.velocity());
assert(_on_event.channel() == _off_event.channel());