sequence duplication for #97
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "clip.h"
|
||||
|
||||
#include "project/effect.h"
|
||||
#include "effects/transition.h"
|
||||
#include "io/media.h"
|
||||
#include "playback/playback.h"
|
||||
#include "playback/cacher.h"
|
||||
@@ -46,6 +47,9 @@ Clip* Clip::copy() {
|
||||
copy->effects.append(effects.at(i)->copy(copy));
|
||||
}
|
||||
|
||||
if (opening_transition != NULL) copy->opening_transition = opening_transition->copy();
|
||||
if (closing_transition != NULL) copy->closing_transition = closing_transition->copy();
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,25 @@ Sequence::~Sequence() {
|
||||
}
|
||||
}
|
||||
|
||||
Sequence* Sequence::copy() {
|
||||
Sequence* s = new Sequence();
|
||||
s->name = name + " (copy)";
|
||||
s->width = width;
|
||||
s->height = height;
|
||||
s->frame_rate = frame_rate;
|
||||
s->audio_frequency = audio_frequency;
|
||||
s->audio_layout = audio_layout;
|
||||
for (int i=0;i<clip_count();i++) {
|
||||
Clip* c = get_clip(i);
|
||||
if (c != NULL) {
|
||||
Clip* copy = c->copy();
|
||||
copy->linked = c->linked;
|
||||
s->add_clip(copy);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void Sequence::add_clip(Clip* c) {
|
||||
c->id = clip_count();
|
||||
clips.append(c);
|
||||
|
||||
@@ -11,6 +11,7 @@ struct Sequence {
|
||||
public:
|
||||
Sequence();
|
||||
~Sequence();
|
||||
Sequence* copy();
|
||||
QString name;
|
||||
void add_clip(Clip* c);
|
||||
int clip_count();
|
||||
|
||||
Reference in New Issue
Block a user