trying to fix undo bug
This commit is contained in:
+2
-2
@@ -18,7 +18,7 @@ Clip::Clip() {
|
||||
Clip* Clip::copy() {
|
||||
Clip* copy = new Clip();
|
||||
|
||||
copy->name = name;
|
||||
copy->name = QString(name);
|
||||
copy->clip_in = clip_in;
|
||||
copy->timeline_in = timeline_in;
|
||||
copy->timeline_out = timeline_out;
|
||||
@@ -31,7 +31,7 @@ Clip* Clip::copy() {
|
||||
copy->media_stream = media_stream;
|
||||
|
||||
for (int i=0;i<effects.size();i++) {
|
||||
copy->effects.append(effects.at(i)->copy());
|
||||
copy->effects.append(effects.at(i)->copy(copy));
|
||||
}
|
||||
|
||||
return copy;
|
||||
|
||||
+1
-2
@@ -20,7 +20,6 @@ struct AVPacket;
|
||||
struct SwsContext;
|
||||
struct SwrContext;
|
||||
class QOpenGLTexture;
|
||||
class QPixmap;
|
||||
|
||||
struct ClipCache {
|
||||
AVFrame** frames;
|
||||
@@ -50,7 +49,7 @@ struct Clip
|
||||
uint8_t color_b;
|
||||
long getLength();
|
||||
|
||||
// inherited information (should be copied in copy())
|
||||
// inherited information (should be set to the same references in copy())
|
||||
Media* media; // attached media
|
||||
MediaStream* media_stream;
|
||||
Sequence* sequence;
|
||||
|
||||
+3
-3
@@ -28,9 +28,9 @@ void Effect::field_changed() {
|
||||
panel_viewer->viewer_widget->update();
|
||||
}
|
||||
|
||||
Effect* Effect::copy() {return NULL;}
|
||||
void Effect::load(QXmlStreamReader* stream) {}
|
||||
void Effect::save(QXmlStreamWriter *stream) {}
|
||||
Effect* Effect::copy(Clip*) {return NULL;}
|
||||
void Effect::load(QXmlStreamReader*) {}
|
||||
void Effect::save(QXmlStreamWriter*) {}
|
||||
|
||||
void Effect::process_gl(int*, int*) {}
|
||||
void Effect::process_audio(uint8_t*, int) {}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public:
|
||||
QWidget* ui;
|
||||
Clip* parent_clip;
|
||||
|
||||
virtual Effect* copy();
|
||||
virtual Effect* copy(Clip* c);
|
||||
virtual void load(QXmlStreamReader* stream);
|
||||
virtual void save(QXmlStreamWriter* stream);
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ void Sequence::undo_add_current() {
|
||||
undo_stack.removeFirst();
|
||||
} else {
|
||||
undo_pointer++;
|
||||
for (int i=undo_stack.size()-1;i>undo_pointer;i--) {
|
||||
delete undo_stack[i];
|
||||
while (undo_stack.size() > undo_pointer+1) {
|
||||
delete undo_stack.last();
|
||||
undo_stack.removeLast();
|
||||
}
|
||||
}
|
||||
@@ -115,9 +115,9 @@ void Sequence::set_undo(int i) {
|
||||
}
|
||||
clips.clear();
|
||||
|
||||
QVector<Clip*>* copy_from_list = undo_stack[undo_pointer];
|
||||
QVector<Clip*>* copy_from_list = undo_stack.at(undo_pointer);
|
||||
for (int i=0;i<copy_from_list->size();i++) {
|
||||
add_clip(copy_from_list->at(i));
|
||||
add_clip(copy_from_list->at(i)->copy());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user