This commit is contained in:
itsmattkc
2018-11-01 16:12:17 +11:00
parent 229674f5e2
commit 9f0ff7f561
14 changed files with 136 additions and 53 deletions
+2 -1
View File
@@ -35,7 +35,8 @@ Clip::Clip(Sequence* s) :
autoscale(config.autoscale_by_default),
maintain_audio_pitch(false),
reverse(false),
use_existing_frame(false)
use_existing_frame(false),
ignore_reverse(false)
{
reset();
}
+1
View File
@@ -94,6 +94,7 @@ struct Clip
bool finished_opening;
bool replaced;
int skip_type;
bool ignore_reverse;
// caching functions
bool use_existing_frame;
+26
View File
@@ -1719,8 +1719,34 @@ MoveEffectCommand::MoveEffectCommand() :
void MoveEffectCommand::undo() {
clip->effects.move(to, from);
mainWindow->setWindowModified(old_project_changed);
}
void MoveEffectCommand::redo() {
clip->effects.move(from, to);
mainWindow->setWindowModified(true);
}
RemoveClipsFromClipboard::RemoveClipsFromClipboard(int index) :
pos(index),
old_project_changed(mainWindow->isWindowModified()),
done(false)
{}
RemoveClipsFromClipboard::~RemoveClipsFromClipboard() {
if (done) {
delete clip;
}
}
void RemoveClipsFromClipboard::undo() {
panel_timeline->clip_clipboard.insert(pos, clip);
done = false;
}
void RemoveClipsFromClipboard::redo() {
qDebug() << "removed" << pos << "from clipboard";
clip = panel_timeline->clip_clipboard.at(pos);
panel_timeline->clip_clipboard.removeAt(pos);
done = true;
}
+13
View File
@@ -557,4 +557,17 @@ private:
bool old_project_changed;
};
class RemoveClipsFromClipboard : public QUndoCommand {
public:
RemoveClipsFromClipboard(int index);
~RemoveClipsFromClipboard();
void undo();
void redo();
private:
int pos;
Clip* clip;
bool old_project_changed;
bool done;
};
#endif // UNDO_H