giant rendering overhaul and many small fixes

This commit is contained in:
itsmattkc
2019-02-25 13:47:18 -08:00
parent b9d7efa0bc
commit c3373524b1
1429 changed files with 10234 additions and 194593 deletions
+47 -46
View File
@@ -25,45 +25,45 @@
#include "debug.h"
Sequence::Sequence() {
playhead = 0;
using_workarea = false;
workarea_in = 0;
workarea_out = 0;
wrapper_sequence = false;
playhead = 0;
using_workarea = false;
workarea_in = 0;
workarea_out = 0;
wrapper_sequence = false;
}
Sequence::~Sequence() {}
SequencePtr Sequence::copy() {
SequencePtr s(new Sequence());
s->name = QCoreApplication::translate("Sequence", "%1 (copy)").arg(name);
s->width = width;
s->height = height;
s->frame_rate = frame_rate;
s->audio_frequency = audio_frequency;
s->audio_layout = audio_layout;
s->clips.resize(clips.size());
for (int i=0;i<clips.size();i++) {
ClipPtr c = clips.at(i);
if (c == nullptr) {
s->clips[i] = nullptr;
} else {
ClipPtr copy = c->copy(s);
copy->linked = c->linked;
s->clips[i] = copy;
}
}
return s;
SequencePtr s(new Sequence());
s->name = QCoreApplication::translate("Sequence", "%1 (copy)").arg(name);
s->width = width;
s->height = height;
s->frame_rate = frame_rate;
s->audio_frequency = audio_frequency;
s->audio_layout = audio_layout;
s->clips.resize(clips.size());
for (int i=0;i<clips.size();i++) {
ClipPtr c = clips.at(i);
if (c == nullptr) {
s->clips[i] = nullptr;
} else {
ClipPtr copy = c->copy(s);
copy->linked = c->linked;
s->clips[i] = copy;
}
}
return s;
}
long Sequence::getEndFrame() {
long end = 0;
for (int j=0;j<clips.size();j++) {
ClipPtr c = clips.at(j);
if (c != nullptr && c->timeline_out > end) {
end = c->timeline_out;
}
}
long end = 0;
for (int j=0;j<clips.size();j++) {
ClipPtr c = clips.at(j);
if (c != nullptr && c->timeline_out() > end) {
end = c->timeline_out();
}
}
return end;
}
@@ -72,27 +72,28 @@ void Sequence::RefreshClips(Media *m) {
ClipPtr c = clips.at(i);
if (c != nullptr
&& (m == nullptr || c->media == m)) {
&& (m == nullptr || c->media() == m)) {
c->Close(true);
c->refresh();
}
}
}
void Sequence::getTrackLimits(int* video_tracks, int* audio_tracks) {
int vt = 0;
int at = 0;
for (int j=0;j<clips.size();j++) {
ClipPtr c = clips.at(j);
if (c != nullptr) {
if (c->track < 0 && c->track < vt) { // video clip
vt = c->track;
} else if (c->track > at) {
at = c->track;
}
}
}
if (video_tracks != nullptr) *video_tracks = vt;
if (audio_tracks != nullptr) *audio_tracks = at;
int vt = 0;
int at = 0;
for (int j=0;j<clips.size();j++) {
ClipPtr c = clips.at(j);
if (c != nullptr) {
if (c->track() < 0 && c->track() < vt) { // video clip
vt = c->track();
} else if (c->track() > at) {
at = c->track();
}
}
}
if (video_tracks != nullptr) *video_tracks = vt;
if (audio_tracks != nullptr) *audio_tracks = at;
}
// static variable for the currently active sequence