preliminary track/channel support
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -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_;
|
||||
|
||||
@@ -50,7 +50,9 @@ public:
|
||||
|
||||
TrackOutput* next_track();
|
||||
|
||||
NodeOutput *track_output();
|
||||
NodeInput* track_input();
|
||||
|
||||
NodeOutput* track_output();
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user