*/
#include <iostream>
-#include <evoral/Note.hpp>
+#include "evoral/Note.hpp"
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)
+template<typename Time>
+Note<Time>::Note(uint8_t chan, Time 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);
_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());
}
-Note::Note(const Note& copy)
+template<typename Time>
+Note<Time>::Note(const Note<Time>& copy)
: _on_event(copy._on_event, true)
, _off_event(copy._off_event, true)
{
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());
}
-Note::~Note()
+template<typename Time>
+Note<Time>::~Note()
{
}
-const Note&
-Note::operator=(const Note& copy)
+template<typename Time>
+const Note<Time>&
+Note<Time>::operator=(const Note<Time>& 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());
return *this;
}
+template class Note<double>;
+
} // namespace Evoral