Files
oak-editor/app/panel/curve/curve.cpp
T
itsmattkc 3399227b3a keyframeview: implemented transforming keyframe times to and from sequence time
Since the node graph can have transform cross nodes, input keyframes may occur
at a different times requiring transforming between sequence time and media
time. This commit implements such a mechanism in all UI classes that need it.
2020-03-26 19:17:46 +11:00

44 lines
975 B
C++

#include "curve.h"
CurvePanel::CurvePanel(QWidget *parent) :
TimeBasedPanel(parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("CurvePanel");
// Create main widget and set it
SetTimeBasedWidget(new CurveWidget());
// Set strings
Retranslate();
}
void CurvePanel::SetInput(NodeInput *input)
{
static_cast<CurveWidget*>(GetTimeBasedWidget())->SetInput(input);
}
void CurvePanel::SetTimeTarget(Node *target)
{
static_cast<CurveWidget*>(GetTimeBasedWidget())->SetTimeTarget(target);
}
void CurvePanel::IncreaseTrackHeight()
{
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
c->SetVerticalScale(c->GetVerticalScale() * 2);
}
void CurvePanel::DecreaseTrackHeight()
{
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
c->SetVerticalScale(c->GetVerticalScale() * 0.5);
}
void CurvePanel::Retranslate()
{
TimeBasedPanel::Retranslate();
SetTitle(tr("Curve Editor"));
}