barebones prototype of timeline/clip functionality

This commit is contained in:
itsmattkc
2019-07-28 02:30:26 -07:00
parent 32c7d089aa
commit 8d944387a2
13 changed files with 201 additions and 23 deletions
+41
View File
@@ -26,11 +26,52 @@ TimelineBlock::TimelineBlock() :
{
}
QString TimelineBlock::Name()
{
return tr("Timeline");
}
QString TimelineBlock::id()
{
return "org.olivevideoeditor.Olive.timeline";
}
QString TimelineBlock::Description()
{
return tr("Node for communicating between a Timeline panel and the node graph. Also represents the end of a Sequence.");
}
rational TimelineBlock::length()
{
return 0;
}
void TimelineBlock::AttachTimeline(TimelinePanel *timeline)
{
if (attached_timeline_ != nullptr) {
attached_timeline_->Clear();
}
attached_timeline_ = timeline;
if (attached_timeline_ != nullptr) {
attached_timeline_->Clear();
Block* previous_block = previous();
while (previous_block != nullptr) {
// FIXME: Dynamic cast is a dumb way of doing this
ClipBlock* clip_block = dynamic_cast<ClipBlock*>(previous_block);
if (clip_block != nullptr) {
attached_timeline_->AddClip(clip_block);
}
previous_block = previous_block->previous();
}
}
}
void TimelineBlock::Process(const rational &time)
{
// Run default process function