diff options
author | David Robillard <d@drobilla.net> | 2007-08-02 04:45:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-02 04:45:16 +0000 |
commit | cfda46ba3ec3cb4f28c24e21009cd2cca0a38da4 (patch) | |
tree | aca1d8a54862b542924d2d5bf312be6de16a4fca /libs | |
parent | 3c22c8f2d545c2a20b422ad0c069f9c5f8c94957 (diff) |
... commit in top level instead of gtk2_ardour. whoops.
git-svn-id: svn://localhost/ardour2/trunk@2219 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/midi_model.h | 5 | ||||
-rw-r--r-- | libs/ardour/midi_model.cc | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 994d15d5b8..5a253c1033 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -55,7 +55,10 @@ public: inline uint8_t velocity() const { return _on_event.velocity(); } inline double duration() const { return _off_event.time() - _on_event.time(); } - inline void set_duration(double d) { _off_event.time() = _on_event.time() + d; } + inline void set_time(double t) { _off_event.time() = t + duration(); _on_event.time() = t; } + inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; } + inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; } + inline void set_duration(double d) { _off_event.time() = _on_event.time() + d; } inline MidiEvent& on_event() { return _on_event; } inline MidiEvent& off_event() { return _off_event; } diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 27bb681c43..b2d5a80928 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -116,7 +116,7 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe { size_t read_events = 0; - cerr << "MM READ @ " << start << " + " << nframes << endl; + //cerr << "MM READ @ " << start << " + " << nframes << endl; /* FIXME: cache last lookup value to avoid the search */ @@ -170,8 +170,8 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe } } - if (read_events > 0) - cerr << "MM READ " << read_events << " EVENTS" << endl; + //if (read_events > 0) + // cerr << "MM READ " << read_events << " EVENTS" << endl; return read_events; } |