Mercurial > hg > svcore
comparison base/CommandHistory.h @ 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 | d397ea0a79f5 |
children | 4c5c62784211 |
comparison
equal
deleted
inserted
replaced
114:8cd01027502f | 115:90ade4fa63be |
---|---|
63 void registerMenu(QMenu *menu); | 63 void registerMenu(QMenu *menu); |
64 void registerToolbar(QToolBar *toolbar); | 64 void registerToolbar(QToolBar *toolbar); |
65 | 65 |
66 /** | 66 /** |
67 * Add a command to the command history. | 67 * Add a command to the command history. |
68 * | |
69 * The command will normally be executed before being added; but | |
70 * if a compound operation is in use (see startCompoundOperation | |
71 * below), the execute status of the compound operation will | |
72 * determine whether the command is executed or not. | |
73 */ | |
74 void addCommand(Command *command); | |
75 | |
76 /** | |
77 * Add a command to the command history. | |
68 * | 78 * |
69 * If execute is true, the command will be executed before being | 79 * If execute is true, the command will be executed before being |
70 * added. Otherwise it will be assumed to have been already | 80 * added. Otherwise it will be assumed to have been already |
71 * executed -- a command should not be added to the history unless | 81 * executed -- a command should not be added to the history unless |
72 * its work has actually been done somehow! | 82 * its work has actually been done somehow! |
73 * | 83 * |
74 * If a compound operation is in use (see startCompoundOperation | 84 * If a compound operation is in use (see startCompoundOperation |
75 * below), the execute status of the compound operation will | 85 * below), the execute value passed to this method will override |
76 * override any value of execute passed to this method. | 86 * the execute status of the compound operation. In this way it's |
87 * possible to have a compound operation mixing both to-execute | |
88 * and pre-executed commands. | |
77 * | 89 * |
78 * If bundle is true, the command will be a candidate for bundling | 90 * If bundle is true, the command will be a candidate for bundling |
79 * with any adjacent bundeable commands that have the same name, | 91 * with any adjacent bundeable commands that have the same name, |
80 * into a single compound command. This is useful for small | 92 * into a single compound command. This is useful for small |
81 * commands that may be executed repeatedly altering the same data | 93 * commands that may be executed repeatedly altering the same data |
82 * (e.g. type text, set a parameter) whose number and extent is | 94 * (e.g. type text, set a parameter) whose number and extent is |
83 * not known in advance. The bundle parameter will be ignored if | 95 * not known in advance. The bundle parameter will be ignored if |
84 * a compound operation is already in use. | 96 * a compound operation is already in use. |
85 */ | 97 */ |
86 void addCommand(Command *command, bool execute = true, bool bundle = false); | 98 void addCommand(Command *command, bool execute, bool bundle = false); |
87 | 99 |
88 /// Return the maximum number of items in the undo history. | 100 /// Return the maximum number of items in the undo history. |
89 int getUndoLimit() const { return m_undoLimit; } | 101 int getUndoLimit() const { return m_undoLimit; } |
90 | 102 |
91 /// Set the maximum number of items in the undo history. | 103 /// Set the maximum number of items in the undo history. |
190 int m_menuLimit; | 202 int m_menuLimit; |
191 int m_savedAt; | 203 int m_savedAt; |
192 | 204 |
193 MacroCommand *m_currentCompound; | 205 MacroCommand *m_currentCompound; |
194 bool m_executeCompound; | 206 bool m_executeCompound; |
195 void addToCompound(Command *command); | 207 void addToCompound(Command *command, bool execute); |
196 | 208 |
197 MacroCommand *m_currentBundle; | 209 MacroCommand *m_currentBundle; |
198 QString m_currentBundleName; | 210 QString m_currentBundleName; |
199 QTimer *m_bundleTimer; | 211 QTimer *m_bundleTimer; |
200 int m_bundleTimeout; | 212 int m_bundleTimeout; |