validations added for moving and trimming

This commit is contained in:
itsmattkc
2019-08-22 14:52:52 +10:00
parent 51a441bc29
commit 6b24ac69d6
8 changed files with 114 additions and 33 deletions
@@ -24,7 +24,11 @@
TimelineViewGhostItem::TimelineViewGhostItem(QGraphicsItem *parent) :
TimelineViewRect(parent),
stream_(nullptr)
in_adj_(0),
out_adj_(0),
track_adj_(0),
stream_(nullptr),
mode_(kNone)
{
setBrush(Qt::NoBrush);
setPen(QPen(Qt::yellow, 2)); // FIXME: Make customizable via CSS
@@ -43,7 +47,7 @@ TimelineViewGhostItem *TimelineViewGhostItem::FromClip(TimelineViewClipItem *cli
ghost->SetIn(clip->in());
ghost->SetOut(clip->out());
ghost->SetData(Node::PtrToValue(clip));
ghost->setData(0, Node::PtrToValue(clip));
return ghost;
}
@@ -141,16 +145,6 @@ void TimelineViewGhostItem::SetMode(const TimelineViewGhostItem::Mode &mode)
mode_ = mode;
}
const QVariant &TimelineViewGhostItem::data() const
{
return data_;
}
void TimelineViewGhostItem::SetData(const QVariant &data)
{
data_ = data;
}
void TimelineViewGhostItem::UpdateRect()
{
rational length = GetAdjustedOut() - GetAdjustedIn();