/***
Olive - Non-Linear Video Editor
Copyright (C) 2021 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 "panel/timeline/timeline.h"
#include "ui/icons/icons.h"
namespace olive {
const QString Sequence::kTrackInputFormat = QStringLiteral("track_in_%1");
#define super ViewerOutput
Sequence::Sequence()
{
// Create TrackList instances
track_lists_.resize(Track::kCount);
for (int i=0;i(i), track_input_id);
track_lists_.replace(i, list);
connect(list, &TrackList::TrackListChanged, this, &Sequence::UpdateTrackCache);
connect(list, &TrackList::LengthChanged, this, &Sequence::VerifyLength);
connect(list, &TrackList::TrackAdded, this, &Sequence::TrackAdded);
connect(list, &TrackList::TrackRemoved, this, &Sequence::TrackRemoved);
}
}
void Sequence::add_default_nodes(MultiUndoCommand* command)
{
// Create tracks and connect them to the viewer
UndoCommand* video_track_command = new TimelineAddTrackCommand(track_list(Track::kVideo));
UndoCommand* audio_track_command = new TimelineAddTrackCommand(track_list(Track::kAudio));
if (command) {
command->add_child(video_track_command);
command->add_child(audio_track_command);
} else {
video_track_command->redo();
audio_track_command->redo();
delete video_track_command;
delete audio_track_command;
}
}
QIcon Sequence::icon() const
{
return icon::Sequence;
}
QVector