X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fmidi%2B%2B2%2Fparser.cc;h=8e3af64504407f8cdbf5e9377256bbdac1a2a3b6;hb=93349141379343c91ea0ec2127d694f6cf2e230e;hp=52de52c2d225ffe442e06a65f65371707db389ed;hpb=ae1abc4ea6b77611399e37817cd2f837342238b2;p=ardour.git diff --git a/libs/midi++2/parser.cc b/libs/midi++2/parser.cc index 52de52c2d2..8e3af64504 100644 --- a/libs/midi++2/parser.cc +++ b/libs/midi++2/parser.cc @@ -105,8 +105,7 @@ Parser::midi_event_type_name (eventType t) } Parser::Parser (Port &p) - : _port (p) - + : _port(p) { trace_stream = 0; trace_prefix = ""; @@ -326,6 +325,7 @@ void Parser::scanner (unsigned char inbyte) { bool statusbit; + boost::optional edit_result; // cerr << "parse: " << hex << (int) inbyte << dec << " state = " << state << " msgindex = " << msgindex << " runnable = " << runnable << endl; @@ -497,7 +497,10 @@ Parser::scanner (unsigned char inbyte) case NEEDONEBYTE: /* We've completed a 1 or 2 byte message. */ - if (edit.empty() || !(*edit (msgbuf, msgindex) == 0)) { + + edit_result = edit (msgbuf, msgindex); + + if (edit_result.get_value_or (1)) { /* message not cancelled by an editor */