diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-21 21:29:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-21 21:29:22 +0000 |
commit | be614d0538ddd78b13b236f760afbd94af540202 (patch) | |
tree | f437fc23359b43969d369e867146e67244c72ad7 /libs/ardour/ardour/midi_ring_buffer.h | |
parent | 500aaa0deeb386df94fddc4474aa6de43331becb (diff) |
change default overlapping note strategy to "relax" (i.e. do nothing); fix crash when looping with MIDI data; add back note-off resolution at loop point (if it was actually there) so that notes are turned off (but don't forget Ye Olde Sustain Pedal/Controller) when looping; minor other non-functional tweaks
git-svn-id: svn://localhost/ardour2/branches/3.0@9753 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/midi_ring_buffer.h')
-rw-r--r-- | libs/ardour/ardour/midi_ring_buffer.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h index 567f375bc3..14934456e1 100644 --- a/libs/ardour/ardour/midi_ring_buffer.h +++ b/libs/ardour/ardour/midi_ring_buffer.h @@ -21,9 +21,12 @@ #include <iostream> #include <algorithm> + +#include "evoral/EventRingBuffer.hpp" + #include "ardour/types.h" #include "ardour/buffer.h" -#include "evoral/EventRingBuffer.hpp" +#include "ardour/midi_state_tracker.h" namespace ARDOUR { @@ -80,8 +83,19 @@ protected: return (0x80 <= event_type_byte) && (event_type_byte <= 0xE0); } + inline bool is_note_on(uint8_t event_type_byte) { + // mask out channel information + return (event_type_byte & 0xF0) == MIDI_CMD_NOTE_ON; + } + + inline bool is_note_off(uint8_t event_type_byte) { + // mask out channel information + return (event_type_byte & 0xF0) == MIDI_CMD_NOTE_OFF; + } + private: volatile uint32_t _channel_mask; // 16 bits mode, 16 bits mask + MidiStateTracker _tracker; }; |