/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
***/
#include "sequence.h"
#include
#include "timelinefunctions.h"
#include "panels/panels.h"
#include "global/clipboard.h"
#include "global/config.h"
#include "global/debug.h"
Sequence::Sequence() :
playhead(0),
using_workarea(false),
workarea_in(0),
workarea_out(0),
wrapper_sequence(false)
{
AddTrack(olive::kTypeVideo);
AddTrack(olive::kTypeAudio);
}
SequencePtr Sequence::copy() {
SequencePtr s = std::make_shared();
s->name_ = tr("%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_;
/* FIXME
// deep copy all of the sequence's clips
for (int i=0;itrack_lists_[i] = track_lists_.at(i)->copy(s.get());
}
*/
// copy all of the sequence's markers
s->markers = markers;
return s;
}
void Sequence::Save(QXmlStreamWriter &stream)
{
// Provide unique IDs for each Clip
QVector all_clips = GetAllClips();
for (int i=0;iload_id = i;
}
stream.writeStartElement("sequence");
stream.writeAttribute("id", QString::number(save_id));
stream.writeAttribute("name", name_);
stream.writeAttribute("width", QString::number(width_));
stream.writeAttribute("height", QString::number(height_));
stream.writeAttribute("framerate", QString::number(frame_rate_, 'f', 10));
stream.writeAttribute("afreq", QString::number(audio_frequency_));
stream.writeAttribute("alayout", QString::number(audio_layout_));
if (this == Timeline::GetTopSequence().get()) {
stream.writeAttribute("open", "1");
}
stream.writeAttribute("workarea", QString::number(using_workarea));
stream.writeAttribute("workareaIn", QString::number(workarea_in));
stream.writeAttribute("workareaOut", QString::number(workarea_out));
QVector transition_save_cache;
QVector transition_clip_save_cache;
/* FIXME
for (int j=0;jSave(stream);
}
*/
for (int j=0;jGetEndFrame(), end_frame);
}
return end_frame;
}
QVector Sequence::GetAllClips()
{
QVector all_clips;
for (int j=0;jGetAllClips());
}
return all_clips;
}
QVector