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
+1
View File
@@ -20,5 +20,6 @@ set(OLIVE_SOURCES
node/output/timeline/timeline.cpp
node/output/timeline/tracklist.h
node/output/timeline/tracklist.cpp
node/output/timeline/tracktypes.h
PARENT_SCOPE
)
+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));
}
+7
View File
@@ -24,6 +24,7 @@
#include "common/timelinecommon.h"
#include "node/block/block.h"
#include "node/output/track/track.h"
#include "timeline/trackreference.h"
#include "tracklist.h"
#include "tracktypes.h"
@@ -56,6 +57,10 @@ public:
signals:
void LengthChanged(const rational& length);
void BlockAdded(Block* block, TrackReference track);
void BlockRemoved(Block* block);
protected:
virtual QVariant Value(NodeOutput* output, const rational& time) override;
@@ -75,6 +80,8 @@ private slots:
void UpdateLength(const rational &length);
void TrackListAddedBlock(Block* block, int index);
};
#endif // TIMELINEOUTPUT_H