fixed #142
This commit is contained in:
+2
-1
@@ -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();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ struct Clip
|
||||
bool finished_opening;
|
||||
bool replaced;
|
||||
int skip_type;
|
||||
bool ignore_reverse;
|
||||
|
||||
// caching functions
|
||||
bool use_existing_frame;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user