Skip to content

Commit

Permalink
Improved debugging output for unhandled MIDI data
Browse files Browse the repository at this point in the history
Print as much debug info as possible for unhandled data.
  • Loading branch information
michaelgregorius committed Apr 20, 2015
1 parent 19d641f commit 2d90946
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions plugins/MidiImport/MidiImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,19 @@ bool MidiImport::readSMF( TrackContainer* tc )
}
}
if( !handled ) {
printf("MISSING GLOBAL THINGY\n");
if ( evt->is_update() && evt->get_update_type() == 'a' )
// Write debug output
printf("MISSING GLOBAL HANDLER\n");
printf(" Chn: %d, Type Code: %d, Time: %f", (int) evt->chan,
evt->get_type_code(), evt->time );
if ( evt->is_update() )
{
printf(" %d %d %f %s %s\n", (int) evt->chan,
evt->get_type_code(), evt->time,
evt->get_attribute(), evt->get_atom_value() );
printf( ", Update Type: %s", evt->get_attribute() );
if ( evt->get_update_type() == 'a' )
{
printf( ", Atom: %s", evt->get_atom_value() );
}
}
// Global stuff
printf( "\n" );
}
}
else if( evt->is_note() && evt->chan < 256 )
Expand Down

0 comments on commit 2d90946

Please sign in to comment.