changeset 838:b17b7ec4a31e

Fix dead code; fix previous fix to midi insertion logic
author Chris Cannam
date Wed, 03 Sep 2014 12:36:11 +0100 (2014-09-03)
parents 561ae7ca346d
children 591c72f58252
files main/MainWindow.cpp
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
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());
     }