Skip to content

Commit

Permalink
Merge pull request #1984 from michaelgregorius/1981-midicrash
Browse files Browse the repository at this point in the history
Might fix 1981 ("Midi Import crash in master branch")
  • Loading branch information
tresf committed Apr 24, 2015
2 parents c57ba1b + 2d90946 commit 478bbbd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions plugins/MidiImport/MidiImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,20 +374,28 @@ bool MidiImport::readSMF( TrackContainer* tc )
if( evt->chan == -1 )
{
bool handled = false;
if( evt->is_update() )
if( evt->is_update() )
{
QString attr = evt->get_attribute();
if( attr == "tracknames" ) {
if( attr == "tracknames" && evt->get_update_type() == 'a' ) {
trackName = evt->get_atom_value();
handled = true;
}
}
if(!handled) {
printf("MISSING GLOBAL THINGY\n");
printf(" %d %d %f %s %s\n", (int) evt->chan,
evt->get_type_code(), evt->time,
evt->get_attribute(), evt->get_atom_value() );
// Global stuff
if( !handled ) {
// 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( ", Update Type: %s", evt->get_attribute() );
if ( evt->get_update_type() == 'a' )
{
printf( ", Atom: %s", evt->get_atom_value() );
}
}
printf( "\n" );
}
}
else if( evt->is_note() && evt->chan < 256 )
Expand Down

0 comments on commit 478bbbd

Please sign in to comment.