preliminary track/channel support

This commit is contained in:
itsmattkc
2019-08-16 16:28:32 +10:00
parent 7d9d12ee0b
commit c68e879d47
7 changed files with 35 additions and 5 deletions
+1
View File
@@ -300,6 +300,7 @@ void Core::CreateNewSequence()
Block::ConnectBlocks(gb, cb);
Block::ConnectBlocks(cb, to);
Block::ConnectBlocks(cb2, to2);
NodeParam::ConnectEdge(to2->track_output(), to->track_input());
NodeParam::ConnectEdge(to->texture_output(), vo->texture_input());
NodeParam::ConnectEdge(to->track_output(), tb->track_input());
+20 -2
View File
@@ -75,9 +75,9 @@ void TimelineOutput::AttachTimeline(TimelinePanel *timeline)
attached_timeline_->SetTimebase(rational(1001, 30000));
// END TEST CODE
if (attached_track() != nullptr) {
foreach (TrackOutput* track, track_cache_) {
// Defer to the track to make all the block UI items necessary
attached_track()->GenerateBlockWidgets();
track->GenerateBlockWidgets();
}
//TimelineView* view = attached_timeline_->view();
@@ -97,6 +97,22 @@ void TimelineOutput::Process(const rational &time)
Q_UNUSED(time)
}
int TimelineOutput::GetTrackIndex(TrackOutput *track)
{
return track_cache_.indexOf(track);
}
rational TimelineOutput::GetSequenceLength()
{
rational length = 0;
foreach (TrackOutput* track, track_cache_) {
length = qMax(length, track->in());
}
return length;
}
TrackOutput *TimelineOutput::attached_track()
{
return ValueToPtr<TrackOutput>(track_input_->get_value(0));
@@ -150,6 +166,8 @@ void TimelineOutput::TrackConnectionRemoved(NodeEdgePtr edge)
void TimelineOutput::TrackAddedBlock(Block *block)
{
if (attached_timeline_ != nullptr) {
qDebug() << "track index lmao:" << GetTrackIndex(static_cast<TrackOutput*>(sender()));
attached_timeline_->view()->AddBlock(block);
}
}
+4
View File
@@ -47,6 +47,10 @@ public slots:
virtual void Process(const rational &time) override;
private:
int GetTrackIndex(TrackOutput* track);
rational GetSequenceLength();
TrackOutput* attached_track();
TimelinePanel* attached_timeline_;
+5
View File
@@ -111,6 +111,11 @@ TrackOutput *TrackOutput::next_track()
return ValueToPtr<TrackOutput>(track_input_->get_value(0));
}
NodeInput *TrackOutput::track_input()
{
return track_input_;
}
NodeOutput* TrackOutput::track_output()
{
return track_output_;
+3 -1
View File
@@ -50,7 +50,9 @@ public:
TrackOutput* next_track();
NodeOutput *track_output();
NodeInput* track_input();
NodeOutput* track_output();
signals:
/**
@@ -55,7 +55,7 @@ void TimelineViewClipItem::UpdateRect()
double item_left = TimeToScreenCoord(clip_->in());
double item_width = TimeToScreenCoord(clip_->length());
setRect(0, 0, item_width - 1, 100);
setRect(0, 0, item_width - 1, 64);
setPos(item_left, 0.0);
}
@@ -102,7 +102,7 @@ void TimelineViewGhostItem::UpdateRect()
{
rational length = GetAdjustedOut() - GetAdjustedIn();
setRect(0, 0, TimeToScreenCoord(length), 100);
setRect(0, 0, TimeToScreenCoord(length), 64);
setPos(TimeToScreenCoord(GetAdjustedIn()), 0);
}