work towards shifting functions from timelineview to timelinewidget

This commit is contained in:
itsmattkc
2019-10-11 16:57:12 +11:00
parent 79d1f99fa8
commit e9f5d0d248
34 changed files with 895 additions and 704 deletions
+10 -4
View File
@@ -37,12 +37,14 @@ TimelineOutput::TimelineOutput()
NodeInput* track_input = new NodeInput(QString("track_in_%1").arg(i));
track_input->add_data_input(NodeParam::kTrack);
AddParameter(track_input);
track_inputs_[i] = track_input;
track_inputs_.replace(i, track_input);
TrackList* list = new TrackList(this, static_cast<TrackType>(i), track_input);
track_lists_[i] = list;
track_lists_.replace(i, list);
connect(list, SIGNAL(TrackListChanged()), this, SLOT(UpdateTrackCache()));
connect(list, SIGNAL(LengthChanged(const rational &)), this, SLOT(UpdateLength(const rational &)));
connect(list, SIGNAL(BlockAdded(Block*, int)), this, SLOT(TrackListAddedBlock(Block*, int)));
connect(list, SIGNAL(BlockRemoved(Block*)), this, SIGNAL(BlockRemoved(Block*)));
}
length_output_ = new NodeOutput("length_out");
@@ -107,8 +109,6 @@ void TimelineOutput::UpdateTrackCache()
void TimelineOutput::UpdateLength(const rational &length)
{
qDebug() << "Updating length! Received value:" << length;
// If this length is equal, no-op
if (length == length_) {
return;
@@ -150,3 +150,9 @@ TrackList *TimelineOutput::track_list(TrackType type)
{
return track_lists_.at(type);
}
void TimelineOutput::TrackListAddedBlock(Block *block, int index)
{
TrackType type = static_cast<TrackList*>(sender())->TrackType();
emit BlockAdded(block, TrackReference(type, index));
}