/***
Olive - Non-Linear Video Editor
Copyright (C) 2020 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 "timeline.h"
#include "panel/panelmanager.h"
#include "panel/project/footagemanagementpanel.h"
namespace olive {
TimelinePanel::TimelinePanel(QWidget *parent) :
TimeBasedPanel(QStringLiteral("TimelinePanel"), parent)
{
TimelineWidget* tw = new TimelineWidget();
SetTimeBasedWidget(tw);
Retranslate();
connect(tw, &TimelineWidget::BlocksSelected, this, &TimelinePanel::BlocksSelected);
connect(tw, &TimelineWidget::BlocksDeselected, this, &TimelinePanel::BlocksDeselected);
}
void TimelinePanel::Clear()
{
static_cast(GetTimeBasedWidget())->Clear();
}
void TimelinePanel::SplitAtPlayhead()
{
static_cast(GetTimeBasedWidget())->SplitAtPlayhead();
}
QByteArray TimelinePanel::SaveSplitterState() const
{
return static_cast(GetTimeBasedWidget())->SaveSplitterState();
}
void TimelinePanel::RestoreSplitterState(const QByteArray &state)
{
static_cast(GetTimeBasedWidget())->RestoreSplitterState(state);
}
void TimelinePanel::SelectAll()
{
static_cast(GetTimeBasedWidget())->SelectAll();
}
void TimelinePanel::DeselectAll()
{
static_cast(GetTimeBasedWidget())->DeselectAll();
}
void TimelinePanel::RippleToIn()
{
static_cast(GetTimeBasedWidget())->RippleToIn();
}
void TimelinePanel::RippleToOut()
{
static_cast(GetTimeBasedWidget())->RippleToOut();
}
void TimelinePanel::EditToIn()
{
static_cast(GetTimeBasedWidget())->EditToIn();
}
void TimelinePanel::EditToOut()
{
static_cast(GetTimeBasedWidget())->EditToOut();
}
void TimelinePanel::DeleteSelected()
{
static_cast(GetTimeBasedWidget())->DeleteSelected(false);
}
void TimelinePanel::RippleDelete()
{
static_cast(GetTimeBasedWidget())->DeleteSelected(true);
}
void TimelinePanel::IncreaseTrackHeight()
{
static_cast(GetTimeBasedWidget())->IncreaseTrackHeight();
}
void TimelinePanel::DecreaseTrackHeight()
{
static_cast(GetTimeBasedWidget())->DecreaseTrackHeight();
}
void TimelinePanel::Insert()
{
FootageManagementPanel* project_panel = PanelManager::instance()->MostRecentlyFocused();
if (project_panel) {
InsertFootageAtPlayhead(project_panel->GetSelectedFootage());
}
}
void TimelinePanel::Overwrite()
{
FootageManagementPanel* project_panel = PanelManager::instance()->MostRecentlyFocused();
if (project_panel) {
OverwriteFootageAtPlayhead(project_panel->GetSelectedFootage());
}
}
void TimelinePanel::ToggleLinks()
{
static_cast(GetTimeBasedWidget())->ToggleLinksOnSelected();
}
void TimelinePanel::CutSelected()
{
static_cast(GetTimeBasedWidget())->CopySelected(true);
}
void TimelinePanel::CopySelected()
{
static_cast(GetTimeBasedWidget())->CopySelected(false);
}
void TimelinePanel::Paste()
{
static_cast(GetTimeBasedWidget())->Paste(false);
}
void TimelinePanel::PasteInsert()
{
static_cast(GetTimeBasedWidget())->Paste(true);
}
void TimelinePanel::DeleteInToOut()
{
static_cast(GetTimeBasedWidget())->DeleteInToOut(false);
}
void TimelinePanel::RippleDeleteInToOut()
{
static_cast(GetTimeBasedWidget())->DeleteInToOut(true);
}
void TimelinePanel::ToggleSelectedEnabled()
{
static_cast(GetTimeBasedWidget())->ToggleSelectedEnabled();
}
void TimelinePanel::SetColorLabel(int index)
{
static_cast(GetTimeBasedWidget())->SetColorLabel(index);
}
void TimelinePanel::InsertFootageAtPlayhead(const QVector &footage)
{
static_cast(GetTimeBasedWidget())->InsertFootageAtPlayhead(footage);
}
void TimelinePanel::OverwriteFootageAtPlayhead(const QVector &footage)
{
static_cast(GetTimeBasedWidget())->OverwriteFootageAtPlayhead(footage);
}
void TimelinePanel::Retranslate()
{
TimeBasedPanel::Retranslate();
SetTitle(tr("Timeline"));
}
}