started removing track_input from track
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "node/blend/alphaover/alphaover.h"
|
||||
#include "timeline.h"
|
||||
|
||||
TrackList::TrackList(TimelineOutput* parent, const enum TrackType &type, NodeInput *track_input) :
|
||||
TrackList::TrackList(TimelineOutput* parent, const enum TrackType &type, NodeInputArray *track_input) :
|
||||
QObject(parent),
|
||||
track_input_(track_input),
|
||||
type_(type)
|
||||
@@ -130,16 +130,15 @@ void TrackList::AddTrack()
|
||||
TrackOutput* track = new TrackOutput();
|
||||
GetParentGraph()->AddNode(track);
|
||||
|
||||
if (track_cache_.isEmpty()) {
|
||||
// Connect this track directly to this output
|
||||
NodeParam::ConnectEdge(track->output(), track_input_);
|
||||
} else {
|
||||
TrackOutput* current_last_track = track_cache_.last();
|
||||
track_input_->Append();
|
||||
|
||||
// Connect this track to the current last track
|
||||
NodeParam::ConnectEdge(track->output(), current_last_track->track_input());
|
||||
NodeInput* assoc_input = track_input_->ParamAt(track_input_->GetSize() - 1);
|
||||
|
||||
// FIXME: Test code only
|
||||
// Connect this track directly to this output
|
||||
NodeParam::ConnectEdge(track->output(), assoc_input);
|
||||
|
||||
// FIXME: Test code only
|
||||
if (track_input_->GetSize() > 1) {
|
||||
if (current_last_track->output()->IsConnected()) {
|
||||
AlphaOverBlend* blend = new AlphaOverBlend();
|
||||
GetParentGraph()->AddNode(blend);
|
||||
@@ -148,7 +147,18 @@ void TrackList::AddTrack()
|
||||
NodeParam::ConnectEdge(current_last_track->output(), blend->base_input());
|
||||
NodeParam::ConnectEdge(blend->output(), current_last_track->output()->edges().first()->input());
|
||||
}
|
||||
// End test code
|
||||
}
|
||||
// End test code
|
||||
|
||||
if (track_cache_.isEmpty()) {
|
||||
|
||||
} else {
|
||||
TrackOutput* current_last_track = track_cache_.last();
|
||||
|
||||
// Connect this track to the current last track
|
||||
NodeParam::ConnectEdge(track->output(), current_last_track->track_input());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class TimelineOutput;
|
||||
class TrackList : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TrackList(TimelineOutput *parent, const enum TrackType& type, NodeInput* track_input);
|
||||
TrackList(TimelineOutput *parent, const enum TrackType& type, NodeInputArray* track_input);
|
||||
|
||||
TrackOutput* attached_track();
|
||||
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
*/
|
||||
QVector<TrackOutput*> track_cache_;
|
||||
|
||||
NodeInput* track_input_;
|
||||
NodeInputArray* track_input_;
|
||||
|
||||
rational total_length_;
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
TrackOutput::TrackOutput() :
|
||||
track_type_(kTrackTypeNone),
|
||||
previous_track_(nullptr),
|
||||
next_track_(nullptr),
|
||||
block_invalidate_cache_stack_(0),
|
||||
index_(-1)
|
||||
{
|
||||
@@ -35,10 +37,6 @@ TrackOutput::TrackOutput() :
|
||||
connect(block_input_, SIGNAL(EdgeAdded(NodeEdgePtr)), this, SLOT(BlockConnected(NodeEdgePtr)));
|
||||
connect(block_input_, SIGNAL(EdgeRemoved(NodeEdgePtr)), this, SLOT(BlockDisconnected(NodeEdgePtr)));
|
||||
connect(block_input_, SIGNAL(SizeChanged(int)), this, SLOT(BlockListSizeChanged(int)));
|
||||
|
||||
track_input_ = new NodeInput("track_in");
|
||||
track_input_->set_dependent(false);
|
||||
AddInput(track_input_);
|
||||
}
|
||||
|
||||
void TrackOutput::set_track_type(const TrackType &track_type)
|
||||
@@ -82,6 +80,11 @@ QString TrackOutput::Description() const
|
||||
"a Sequence.");
|
||||
}
|
||||
|
||||
void TrackOutput::Retranslate()
|
||||
{
|
||||
block_input_->set_name(tr("Blocks"));
|
||||
}
|
||||
|
||||
const int &TrackOutput::Index()
|
||||
{
|
||||
return index_;
|
||||
@@ -92,15 +95,24 @@ void TrackOutput::SetIndex(const int &index)
|
||||
index_ = index;
|
||||
}
|
||||
|
||||
TrackOutput *TrackOutput::next_track()
|
||||
void TrackOutput::set_previous_track(TrackOutput *previous)
|
||||
{
|
||||
// FIXME: Re-do this without dynamic_cast at some point
|
||||
return dynamic_cast<TrackOutput*>(track_input_->get_connected_node());
|
||||
previous_track_ = previous;
|
||||
}
|
||||
|
||||
NodeInput *TrackOutput::track_input()
|
||||
void TrackOutput::set_next_track(TrackOutput *next)
|
||||
{
|
||||
return track_input_;
|
||||
next_track_ = next;
|
||||
}
|
||||
|
||||
TrackOutput *TrackOutput::previous_track() const
|
||||
{
|
||||
return previous_track_;
|
||||
}
|
||||
|
||||
TrackOutput *TrackOutput::next_track() const
|
||||
{
|
||||
return next_track_;
|
||||
}
|
||||
|
||||
Block *TrackOutput::BlockContainingTime(const rational &time) const
|
||||
|
||||
@@ -45,12 +45,15 @@ public:
|
||||
virtual QString Category() const override;
|
||||
virtual QString Description() const override;
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
const int& Index();
|
||||
void SetIndex(const int& index);
|
||||
|
||||
TrackOutput* next_track();
|
||||
|
||||
NodeInput* track_input();
|
||||
void set_previous_track(TrackOutput* previous);
|
||||
void set_next_track(TrackOutput* next);
|
||||
TrackOutput* previous_track() const;
|
||||
TrackOutput* next_track() const;
|
||||
|
||||
Block* BlockContainingTime(const rational& time) const;
|
||||
|
||||
@@ -156,12 +159,14 @@ private:
|
||||
|
||||
NodeInputArray* block_input_;
|
||||
|
||||
NodeInput* track_input_;
|
||||
|
||||
TrackType track_type_;
|
||||
|
||||
rational track_length_;
|
||||
|
||||
TrackOutput* previous_track_;
|
||||
|
||||
TrackOutput* next_track_;
|
||||
|
||||
int block_invalidate_cache_stack_;
|
||||
|
||||
int index_;
|
||||
|
||||
Reference in New Issue
Block a user