summaryrefslogtreecommitdiff
path: root/libs/evoral/src/Note.cpp
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-31 23:20:13 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-31 23:20:13 +0000
commit40af4b914f51f9662bcef806c9ac56ae709ac852 (patch)
treef884d8afa8d892ce0b6c2d2692d110144ab6c75f /libs/evoral/src/Note.cpp
parent34881407e7dd687623fbabfe0ae3aee7099eb352 (diff)
use musical_time_equal() test for equality when copying note data, not strict floating point equality. should fix #4609 (and maybe another one too)
git-svn-id: svn://localhost/ardour2/branches/3.0@11407 d708f5d6-7413-0410-9779-e7cbd77b26cf
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 01820b70e7..8ff3ccaff1 100644
--- a/libs/evoral/src/Note.cpp
+++ b/libs/evoral/src/Note.cpp
@@ -39,7 +39,7 @@ 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(time() == t);
+ assert(musical_time_equal (time(),t));
assert(musical_time_equal (length(), l));
assert(note() == n);
assert(velocity() == v);
@@ -66,12 +66,12 @@ Note<Time>::Note(const Note<Time>& copy)
_off_event.buffer = _off_event_buffer;
memcpy(_off_event_buffer, copy._off_event_buffer, 3);
*/
-
- assert(time() == copy.time());
- assert(end_time() == copy.end_time());
+
+ assert(musical_time_equal (time(),copy.time()));
+ assert(musical_time_equal (end_time(), copy.end_time()));
+ assert(musical_time_equal (length(), copy.length()));
assert(note() == copy.note());
assert(velocity() == copy.velocity());
- assert(length() == copy.length());
assert(_on_event.channel() == _off_event.channel());
assert(channel() == copy.channel());
}
@@ -95,11 +95,11 @@ Note<Time>::operator=(const Note<Time>& other)
_on_event = other._on_event;
_off_event = other._off_event;
- assert(time() == other.time());
- assert(end_time() == other.end_time());
+ assert(musical_time_equal (time(),other.time()));
+ assert(musical_time_equal (end_time(), other.end_time()));
+ assert(musical_time_equal (length(), other.length()));
assert(note() == other.note());
assert(velocity() == other.velocity());
- assert(length() == other.length());
assert(_on_event.channel() == _off_event.channel());
assert(channel() == other.channel());