diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-11 16:06:31 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-11 16:06:31 +0000 |
commit | a8449db4660f447fb6ebde29c9195bc43109a57c (patch) | |
tree | cab7abfb0931d366565d1efdd1fd9148a29daebf /libs/evoral/src | |
parent | 1f845c0e326c713a2a99c22d269a2b765b507a4f (diff) |
finish the intention of the previous commit, correctly this time
git-svn-id: svn://localhost/ardour2/branches/3.0@9979 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/src')
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 0ca0537ac9..fb10bfac7b 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -880,11 +880,11 @@ Sequence<Time>::append_note_on_unlocked (NotePtr note, event_id_t evid) assert(_writing); if (note->note() > 127) { - error << string_compose (_("illegal note number (%1) used in Note event - event will be ignored"), note->note()) << endmsg; + error << string_compose (_("illegal note number (%1) used in Note on event - event will be ignored"), (int) note->note()) << endmsg; return; } if (note->channel() >= 16) { - error << string_compose (_("illegal channel number (%1) used in Note event - event will be ignored"), note->channel()) << endmsg; + error << string_compose (_("illegal channel number (%1) used in Note on event - event will be ignored"), (int) note->channel()) << endmsg; return; } @@ -915,9 +915,17 @@ Sequence<Time>::append_note_off_unlocked (NotePtr note) DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 c=%2 note %3 OFF @ %4 v=%5\n", this, (int)note->channel(), (int)note->note(), note->time(), (int)note->velocity())); - assert(note->note() <= 127); - assert(note->channel() < 16); assert(_writing); + + if (note->note() > 127) { + error << string_compose (_("illegal note number (%1) used in Note off event - event will be ignored"), (int) note->note()) << endmsg; + return; + } + if (note->channel() >= 16) { + error << string_compose (_("illegal channel number (%1) used in Note off event - event will be ignored"), (int) note->channel()) << endmsg; + return; + } + _edited = true; if (_percussive) { |