diff base/CommandHistory.cpp @ 115:90ade4fa63be

* Fix serious failure to reload "imported" (i.e. all non-derived non-main) models from .sv file * Give a short playback duration to notes with formal duration of 0 or 1 * Show crosshairs on spectrogram even when there is another layer on top (if it isn't opaque) * Always paste to the same time in the layer as the cut/copy was from, rather than to the playback pointer -- less flexible, but more predictable and less annoying. We probably need a way to get the old behaviour if pasting from somewhere else in the future (e.g. from a text file), but we can't do that yet anyway * Use a compound operation for dragging and resizing selections, so as to ensure a single undo operation works * Use a note model as the target for feature extraction plugins that output variable samplerate data with more than one value per feature * Avoid possible crashes in cut/paste if a layer proves to have no model
author Chris Cannam
date Thu, 11 May 2006 11:35:46 +0000
parents c983dda79f72
children c30728d5625c
line wrap: on
line diff
--- a/base/CommandHistory.cpp	Wed May 10 16:34:03 2006 +0000
+++ b/base/CommandHistory.cpp	Thu May 11 11:35:46 2006 +0000
@@ -115,12 +115,25 @@
 }
 
 void
+CommandHistory::addCommand(Command *command)
+{
+    if (!command) return;
+
+    if (m_currentCompound) {
+	addToCompound(command, m_executeCompound);
+	return;
+    }
+
+    addCommand(command, true);
+}
+
+void
 CommandHistory::addCommand(Command *command, bool execute, bool bundle)
 {
     if (!command) return;
 
     if (m_currentCompound) {
-	addToCompound(command);
+	addToCompound(command, execute);
 	return;
     }
 
@@ -198,11 +211,11 @@
 }
 
 void
-CommandHistory::addToCompound(Command *command)
+CommandHistory::addToCompound(Command *command, bool execute)
 {
 //    std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl;
 
-    if (m_executeCompound) command->execute();
+    if (execute) command->execute();
     m_currentCompound->addCommand(command);
 }