added some functionality for #97

This commit is contained in:
itsmattkc
2018-07-03 20:45:39 +01:00
parent 5a60e2d2c6
commit ae13ccfbd1
15 changed files with 157 additions and 63 deletions
+15
View File
@@ -1,6 +1,7 @@
#include "sequence.h"
#include "project/clip.h"
#include "effects/transition.h"
#include <QDebug>
@@ -88,6 +89,20 @@ Clip* Sequence::split_clip(Clip* pre, long frame) {
post->timeline_in = frame;
post->clip_in = pre->clip_in + pre->getLength();
long pre_length = pre->getLength();
if (pre->closing_transition != NULL) {
post->closing_transition = pre->closing_transition;
pre->closing_transition = NULL;
long post_length = post->getLength();
if (post->closing_transition->length > post_length) {
post->closing_transition->length = post_length;
}
}
if (pre->opening_transition != NULL && pre->opening_transition->length > pre_length) {
pre->opening_transition->length = pre_length;
}
add_clip(post);
return post;