# HG changeset patch # User Chris Cannam # Date 1409744171 -3600 # Node ID b17b7ec4a31ebe17992210d2b1b79a1b3e1e1d81 # Parent 561ae7ca346da3be485e2b49b1f6c0db523d796c Fix dead code; fix previous fix to midi insertion logic diff -r 561ae7ca346d -r b17b7ec4a31e main/MainWindow.cpp --- a/main/MainWindow.cpp Wed Sep 03 12:11:40 2014 +0100 +++ b/main/MainWindow.cpp Wed Sep 03 12:36:11 2014 +0100 @@ -3640,7 +3640,7 @@ cerr << "WARNING: MainWindow::addLayer: unknown model " << model << " (\"" - << (model ? model->objectName() : "") + << model->objectName() << "\") in layer action map" << endl; } @@ -4063,9 +4063,7 @@ (currentPane->getSelectedLayer()); currentTimeValueLayer = dynamic_cast (currentPane->getSelectedLayer()); - } - - if (!currentNoteLayer && !currentTimeValueLayer) { + } else { // discard these events while (m_midiInput->getEventsAvailable() > 0) { (void)m_midiInput->readEvent(); @@ -4127,10 +4125,14 @@ (tvm, point, tr("Add Point")); CommandHistory::getInstance()->addCommand(command); } + continue; - } + // This is reached only if !currentNoteLayer and + // !currentTimeValueLayer, i.e. there is some other sort of + // layer that may be insertable-into + if (!noteOn) continue; insertInstantAt(ev.getTime()); }