comparison 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
comparison
equal deleted inserted replaced
114:8cd01027502f 115:90ade4fa63be
113 toolbar->addAction(m_undoMenuAction); 113 toolbar->addAction(m_undoMenuAction);
114 toolbar->addAction(m_redoMenuAction); 114 toolbar->addAction(m_redoMenuAction);
115 } 115 }
116 116
117 void 117 void
118 CommandHistory::addCommand(Command *command)
119 {
120 if (!command) return;
121
122 if (m_currentCompound) {
123 addToCompound(command, m_executeCompound);
124 return;
125 }
126
127 addCommand(command, true);
128 }
129
130 void
118 CommandHistory::addCommand(Command *command, bool execute, bool bundle) 131 CommandHistory::addCommand(Command *command, bool execute, bool bundle)
119 { 132 {
120 if (!command) return; 133 if (!command) return;
121 134
122 if (m_currentCompound) { 135 if (m_currentCompound) {
123 addToCompound(command); 136 addToCompound(command, execute);
124 return; 137 return;
125 } 138 }
126 139
127 if (bundle) { 140 if (bundle) {
128 addToBundle(command, execute); 141 addToBundle(command, execute);
196 { 209 {
197 closeBundle(); 210 closeBundle();
198 } 211 }
199 212
200 void 213 void
201 CommandHistory::addToCompound(Command *command) 214 CommandHistory::addToCompound(Command *command, bool execute)
202 { 215 {
203 // std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl; 216 // std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl;
204 217
205 if (m_executeCompound) command->execute(); 218 if (execute) command->execute();
206 m_currentCompound->addCommand(command); 219 m_currentCompound->addCommand(command);
207 } 220 }
208 221
209 void 222 void
210 CommandHistory::startCompoundOperation(QString name, bool execute) 223 CommandHistory::startCompoundOperation(QString name, bool execute)