Mercurial > hg > sonic-visualiser
comparison 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 |
comparison
equal
deleted
inserted
replaced
837:561ae7ca346d | 838:b17b7ec4a31e |
---|---|
3638 m_document->setModel(newLayer, model); | 3638 m_document->setModel(newLayer, model); |
3639 } else { | 3639 } else { |
3640 cerr << "WARNING: MainWindow::addLayer: unknown model " | 3640 cerr << "WARNING: MainWindow::addLayer: unknown model " |
3641 << model | 3641 << model |
3642 << " (\"" | 3642 << " (\"" |
3643 << (model ? model->objectName() : "") | 3643 << model->objectName() |
3644 << "\") in layer action map" | 3644 << "\") in layer action map" |
3645 << endl; | 3645 << endl; |
3646 } | 3646 } |
3647 } | 3647 } |
3648 } | 3648 } |
4061 if (currentPane) { | 4061 if (currentPane) { |
4062 currentNoteLayer = dynamic_cast<NoteLayer *> | 4062 currentNoteLayer = dynamic_cast<NoteLayer *> |
4063 (currentPane->getSelectedLayer()); | 4063 (currentPane->getSelectedLayer()); |
4064 currentTimeValueLayer = dynamic_cast<TimeValueLayer *> | 4064 currentTimeValueLayer = dynamic_cast<TimeValueLayer *> |
4065 (currentPane->getSelectedLayer()); | 4065 (currentPane->getSelectedLayer()); |
4066 } | 4066 } else { |
4067 | |
4068 if (!currentNoteLayer && !currentTimeValueLayer) { | |
4069 // discard these events | 4067 // discard these events |
4070 while (m_midiInput->getEventsAvailable() > 0) { | 4068 while (m_midiInput->getEventsAvailable() > 0) { |
4071 (void)m_midiInput->readEvent(); | 4069 (void)m_midiInput->readEvent(); |
4072 } | 4070 } |
4073 return; | 4071 return; |
4125 SparseTimeValueModel::AddPointCommand *command = | 4123 SparseTimeValueModel::AddPointCommand *command = |
4126 new SparseTimeValueModel::AddPointCommand | 4124 new SparseTimeValueModel::AddPointCommand |
4127 (tvm, point, tr("Add Point")); | 4125 (tvm, point, tr("Add Point")); |
4128 CommandHistory::getInstance()->addCommand(command); | 4126 CommandHistory::getInstance()->addCommand(command); |
4129 } | 4127 } |
4128 | |
4130 continue; | 4129 continue; |
4131 | 4130 } |
4132 } | 4131 |
4132 // This is reached only if !currentNoteLayer and | |
4133 // !currentTimeValueLayer, i.e. there is some other sort of | |
4134 // layer that may be insertable-into | |
4133 | 4135 |
4134 if (!noteOn) continue; | 4136 if (!noteOn) continue; |
4135 insertInstantAt(ev.getTime()); | 4137 insertInstantAt(ev.getTime()); |
4136 } | 4138 } |
4137 } | 4139 } |