Mercurial > hg > sonic-visualiser
diff main/MainWindow.cpp @ 838:b17b7ec4a31e
Fix dead code; fix previous fix to midi insertion logic
author | Chris Cannam |
---|---|
date | Wed, 03 Sep 2014 12:36:11 +0100 |
parents | c305961985c4 |
children | ce4d9e149086 |
line wrap: on
line diff
--- 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<TimeValueLayer *> (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()); }