began refactoring keyframe times

This commit is contained in:
itsmattkc
2019-01-02 16:12:10 +11:00
parent 9934ec5777
commit 05524153ab
3 changed files with 37 additions and 52 deletions
+17 -22
View File
@@ -737,28 +737,6 @@ void MediaRename::redo() {
mainWindow->setWindowModified(true);
}
KeyframeMove::KeyframeMove(const QVector<EffectRow*>& irows, const QVector<int>& ikeyframes, const QVector<long>& iold_values, const QVector<long>& inew_values) :
rows(irows),
keyframes(ikeyframes),
old_values(iold_values),
new_values(inew_values),
old_project_changed(mainWindow->isWindowModified())
{}
void KeyframeMove::undo() {
for (int i=0;i<rows.size();i++) {
rows.at(i)->keyframe_times[keyframes.at(i)] = old_values.at(i);
}
mainWindow->setWindowModified(old_project_changed);
}
void KeyframeMove::redo() {
for (int i=0;i<rows.size();i++) {
rows.at(i)->keyframe_times[keyframes.at(i)] = new_values.at(i);
}
mainWindow->setWindowModified(true);
}
KeyframeDelete::KeyframeDelete() :
disable_keyframes_on_row(NULL),
old_project_changed(mainWindow->isWindowModified()),
@@ -1332,3 +1310,20 @@ void SetQVariant::undo() {
void SetQVariant::redo() {
*target = new_val;
}
SetLong::SetLong(long *pointer, long old_value, long new_value) :
p(pointer),
oldval(old_value),
newval(new_value),
old_project_changed(mainWindow->isWindowModified())
{}
void SetLong::undo() {
*p = oldval;
mainWindow->setWindowModified(old_project_changed);
}
void SetLong::redo() {
*p = newval;
mainWindow->setWindowModified(true);
}