summaryrefslogtreecommitdiff
path: root/libs/midi++2/parser.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-22 20:21:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-22 20:21:43 +0000
commitc83389b8ec5fef9553a401e6123b7e55702af9e2 (patch)
tree5580dd13b6275eefe67b9147ce96fa10db4d8674 /libs/midi++2/parser.cc
parent87fb46859c5950af7c00111afa81a00a1fad2196 (diff)
cleanup up cleanup at session destruction; clarify the meaning of 3 signals (DropReferences & Destroyed in libardour ; CatchDeletion in the GTK UI); clarify ownership of objects (session no longer pays attention to DropReferences for objects that it is considered to own, such as routes, sources, etc); fix up MIDI parsing and a couple of other places by correcting syntax for return of values from a boost::signals2::signal (possible danger elsewhere to be checked)
git-svn-id: svn://localhost/ardour2/branches/3.0@6389 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/parser.cc')
-rw-r--r--libs/midi++2/parser.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc
index af9cfafaca..60a321cefb 100644
--- a/libs/midi++2/parser.cc
+++ b/libs/midi++2/parser.cc
@@ -313,7 +313,6 @@ Parser::trace (bool onoff, ostream *o, const string &prefix)
trace_connection.disconnect ();
if (onoff) {
- cerr << "enabling tracing for port " << _port.name() << endl;
trace_stream = o;
trace_prefix = prefix;
any.connect_same_thread (trace_connection, boost::bind (&Parser::trace_event, this, _1, _2, _3));
@@ -402,8 +401,9 @@ Parser::scanner (unsigned char inbyte)
* an EOX. Actually, since EOX is a status byte, this
* code ALWAYS handles the end of a VARIABLELENGTH message.
*/
-
+
if (state == VARIABLELENGTH && statusbit) {
+
/* The message has ended, so process it */
/* add EOX to any sysex message */
@@ -419,7 +419,7 @@ Parser::scanner (unsigned char inbyte)
}
cerr << dec << endl;
#endif
- if (msgindex > 0 && edit (msgbuf, msgindex) >= 0) {
+ if (msgindex > 0 && (edit.empty() || !(*edit (msgbuf, msgindex) >= 0))) {
if (!possible_mmc (msgbuf, msgindex) || _mmc_forward) {
if (!possible_mtc (msgbuf, msgindex) || _mtc_forward) {
if (!_offline) {
@@ -429,7 +429,7 @@ Parser::scanner (unsigned char inbyte)
}
if (!_offline) {
any (*this, msgbuf, msgindex);
- }
+ }
}
}
@@ -490,8 +490,7 @@ Parser::scanner (unsigned char inbyte)
case NEEDONEBYTE:
/* We've completed a 1 or 2 byte message. */
-
- if (edit (msgbuf, msgindex) == 0) {
+ if (edit.empty() || !(*edit (msgbuf, msgindex) == 0)) {
/* message not cancelled by an editor */