almost finished setting in-out points in footage viewer
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
#include "sequence.h"
|
||||
|
||||
#include "project/clip.h"
|
||||
#include "effects/transition.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
Sequence::Sequence() :
|
||||
playhead(0),
|
||||
using_workarea(false),
|
||||
workarea_in(0),
|
||||
workarea_out(0),
|
||||
wrapper_sequence(false)
|
||||
{
|
||||
}
|
||||
|
||||
Sequence::~Sequence() {
|
||||
// dealloc all clips
|
||||
for (int i=0;i<clips.size();i++) {
|
||||
delete clips.at(i);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
s->clips.resize(clips.size());
|
||||
for (int i=0;i<clips.size();i++) {
|
||||
Clip* c = clips.at(i);
|
||||
if (c == NULL) {
|
||||
s->clips[i] = NULL;
|
||||
} else {
|
||||
Clip* 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++) {
|
||||
Clip* c = clips.at(j);
|
||||
if (c != NULL && c->timeline_out > end) {
|
||||
end = c->timeline_out;
|
||||
}
|
||||
}
|
||||
return end;
|
||||
}
|
||||
|
||||
void Sequence::getTrackLimits(int* video_tracks, int* audio_tracks) {
|
||||
int vt = 0;
|
||||
int at = 0;
|
||||
for (int j=0;j<clips.size();j++) {
|
||||
Clip* c = clips.at(j);
|
||||
if (c != NULL) {
|
||||
if (c->track < 0 && c->track < vt) { // video clip
|
||||
vt = c->track;
|
||||
} else if (c->track > at) {
|
||||
at = c->track;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (video_tracks != NULL) *video_tracks = vt;
|
||||
if (audio_tracks != NULL) *audio_tracks = at;
|
||||
}
|
||||
|
||||
// static variable for the currently active sequence
|
||||
Sequence* sequence = NULL;
|
||||
@@ -27,6 +27,8 @@ struct Sequence {
|
||||
long workarea_in;
|
||||
long workarea_out;
|
||||
|
||||
bool wrapper_sequence;
|
||||
|
||||
int save_id;
|
||||
|
||||
QVector<Marker> markers;
|
||||
|
||||
@@ -163,6 +163,14 @@ void SetTimelineInOutCommand::undo() {
|
||||
seq->workarea_in = old_in;
|
||||
seq->workarea_out = old_out;
|
||||
|
||||
// footage viewer functions
|
||||
if (seq->wrapper_sequence) {
|
||||
Media* m = static_cast<Media*>(seq->clips.at(0)->media);
|
||||
m->using_inout = old_enabled;
|
||||
m->in = old_in;
|
||||
m->out = old_out;
|
||||
}
|
||||
|
||||
mainWindow->setWindowModified(old_project_changed);
|
||||
}
|
||||
|
||||
@@ -175,6 +183,14 @@ void SetTimelineInOutCommand::redo() {
|
||||
seq->workarea_in = new_in;
|
||||
seq->workarea_out = new_out;
|
||||
|
||||
// footage viewer functions
|
||||
if (seq->wrapper_sequence) {
|
||||
Media* m = static_cast<Media*>(seq->clips.at(0)->media);
|
||||
m->using_inout = new_enabled;
|
||||
m->in = new_in;
|
||||
m->out = new_out;
|
||||
}
|
||||
|
||||
mainWindow->setWindowModified(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user