Add TestNeedingPlaylistAndRegions
[ardour.git] / libs / midi++2 / parser.cc
index a42a465193fa05a967b24ee96a8e003102c7f2cb..cdd23a5306814793c1b24c6dd9eaf66655c30b0d 100644 (file)
@@ -196,7 +196,7 @@ Parser::trace_event (Parser &, byte *msg, size_t len)
                *o << trace_prefix 
                   << "Channel "
                   << (msg[0]&0xF)+1
-                  <<  " Program PropertyChange ProgNum "
+                  <<  " Program Change ProgNum "
                   << (int) msg[1]
                   << endmsg;
                break;
@@ -326,6 +326,7 @@ void
 Parser::scanner (unsigned char inbyte)
 {
        bool statusbit;
+        boost::optional<int> edit_result;
 
        // cerr << "parse: " << hex << (int) inbyte << dec << " state = " << state << " msgindex = " << msgindex << " runnable = " << runnable << endl;
        
@@ -497,7 +498,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 */