summaryrefslogtreecommitdiff
path: root/libs/evoral/src/Note.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-22 16:28:02 +0000
committerDavid Robillard <d@drobilla.net>2008-09-22 16:28:02 +0000
commita2d2f738cb63dbf0fb89e0a00c424ce883fb7888 (patch)
tree8ff8b9067a8884566b023de2dabedc2b57b856ab /libs/evoral/src/Note.cpp
parentff2d51ddd8288ec967efab2cb8192f43c893909e (diff)
Move event specific ringbuffer stuff to evoral.
Sane event type interface between evoral and libardour (no more shared magic numbers). Cleanup Evoral::Sequence iterator, fix bugs, probably introduce new ones. Move MIDI specific event functions to Evoral::MIDIEvent (is-a Evoral::Event). git-svn-id: svn://localhost/ardour2/branches/3.0@3785 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/src/Note.cpp')
-rw-r--r--libs/evoral/src/Note.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/libs/evoral/src/Note.cpp b/libs/evoral/src/Note.cpp
index 88be34fb36..894945c422 100644
--- a/libs/evoral/src/Note.cpp
+++ b/libs/evoral/src/Note.cpp
@@ -21,9 +21,10 @@
namespace Evoral {
-Note::Note(uint8_t chan, double t, double d, uint8_t n, uint8_t v)
- : _on_event(t, 3, NULL, true)
- , _off_event(t + d, 3, NULL, true)
+Note::Note(uint8_t chan, EventTime t, EventLength l, uint8_t n, uint8_t v)
+ // FIXME: types?
+ : _on_event(0xDE, t, 3, NULL, true)
+ , _off_event(0xAD, t + l, 3, NULL, true)
{
assert(chan < 16);
@@ -36,7 +37,7 @@ Note::Note(uint8_t chan, double t, double d, uint8_t n, uint8_t v)
_off_event.buffer()[2] = 0x40;
assert(time() == t);
- assert(duration() == d);
+ assert(length() == l);
assert(note() == n);
assert(velocity() == v);
assert(_on_event.channel() == _off_event.channel());
@@ -64,7 +65,7 @@ Note::Note(const Note& copy)
assert(end_time() == copy.end_time());
assert(note() == copy.note());
assert(velocity() == copy.velocity());
- assert(duration() == copy.duration());
+ assert(length() == copy.length());
assert(_on_event.channel() == _off_event.channel());
assert(channel() == copy.channel());
}
@@ -80,20 +81,12 @@ Note::operator=(const Note& copy)
{
_on_event = copy._on_event;
_off_event = copy._off_event;
- /*_on_event.time = copy._on_event.time;
- assert(copy._on_event.size == 3);
- memcpy(_on_event_buffer, copy._on_event_buffer, 3);
-
- _off_event.time = copy._off_event.time;
- assert(copy._off_event.size == 3);
- memcpy(_off_event_buffer, copy._off_event_buffer, 3);
- */
assert(time() == copy.time());
assert(end_time() == copy.end_time());
assert(note() == copy.note());
assert(velocity() == copy.velocity());
- assert(duration() == copy.duration());
+ assert(length() == copy.length());
assert(_on_event.channel() == _off_event.channel());
assert(channel() == copy.channel());