summaryrefslogtreecommitdiff
path: root/libs/midi++2/midi++/event.h
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-04-15 23:00:06 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-04-15 23:00:06 +0000
commitc4bdcb82afa95555a036cb1418bf6c74b4d4a2c1 (patch)
treee562fed34d3945934dcc1d4a62a6f53e2929829a /libs/midi++2/midi++/event.h
parent8b3d298f6b16fbe819a9b9911e018c811b4914e3 (diff)
* fixed bug: crash because of invalidated iterator while removing midi notes from model
git-svn-id: svn://localhost/ardour2/branches/3.0@3253 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/midi++/event.h')
-rw-r--r--libs/midi++2/midi++/event.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/midi++2/midi++/event.h b/libs/midi++2/midi++/event.h
index cce17b0625..b718267704 100644
--- a/libs/midi++2/midi++/event.h
+++ b/libs/midi++2/midi++/event.h
@@ -167,10 +167,10 @@ struct Event {
inline uint32_t& size() { return _size; }
inline uint8_t type() const { return (_buffer[0] & 0xF0); }
inline uint8_t channel() const { return (_buffer[0] & 0x0F); }
- inline void set_channel(uint8_t channel) { _buffer[0] = (0xF0 & _buffer[0]) | channel; }
- inline bool is_note_on() const { return (type() == MIDI_CMD_NOTE_ON); }
- inline bool is_note_off() const { return (type() == MIDI_CMD_NOTE_OFF); }
- inline bool is_cc() const { return (type() == MIDI_CMD_CONTROL); }
+ inline void set_channel(uint8_t channel) { _buffer[0] = (0xF0 & _buffer[0]) | (0x0F & channel); }
+ inline bool is_note_on() const { return (type() == MIDI_CMD_NOTE_ON); }
+ inline bool is_note_off() const { return (type() == MIDI_CMD_NOTE_OFF); }
+ inline bool is_cc() const { return (type() == MIDI_CMD_CONTROL); }
inline bool is_note() const { return (is_note_on() || is_note_off()); }
inline uint8_t note() const { return (_buffer[1]); }
inline uint8_t velocity() const { return (_buffer[2]); }