removed last of the NodeOutput dependencies
Since all Nodes have an output that provides all output values now, we now never need to add an output from a Node derivative. These changes remove the last of them and disable the ability to add more outputs from a derivative.
This commit is contained in:
@@ -35,7 +35,7 @@ TimelineOutput::TimelineOutput()
|
||||
for (int i=0;i<kTrackTypeCount;i++) {
|
||||
// Create track input
|
||||
NodeInput* track_input = new NodeInput(QString("track_in_%1").arg(i));
|
||||
AddParameter(track_input);
|
||||
AddInput(track_input);
|
||||
track_inputs_.replace(i, track_input);
|
||||
|
||||
TrackList* list = new TrackList(this, static_cast<TrackType>(i), track_input);
|
||||
@@ -47,9 +47,6 @@ TimelineOutput::TimelineOutput()
|
||||
connect(list, SIGNAL(TrackAdded(TrackOutput*)), this, SLOT(TrackListAddedTrack(TrackOutput*)));
|
||||
connect(list, SIGNAL(TrackRemoved(TrackOutput*)), this, SIGNAL(TrackRemoved(TrackOutput*)));
|
||||
}
|
||||
|
||||
length_output_ = new NodeOutput("length_out");
|
||||
AddParameter(length_output_);
|
||||
}
|
||||
|
||||
Node *TimelineOutput::copy() const
|
||||
@@ -87,11 +84,6 @@ const QVector<TrackOutput *>& TimelineOutput::Tracks() const
|
||||
return track_cache_;
|
||||
}
|
||||
|
||||
NodeOutput *TimelineOutput::length_output() const
|
||||
{
|
||||
return length_output_;
|
||||
}
|
||||
|
||||
const rational &TimelineOutput::timeline_length() const
|
||||
{
|
||||
return length_;
|
||||
@@ -152,6 +144,31 @@ void TimelineOutput::SetTimebase(const rational &timebase)
|
||||
emit TimebaseChanged(timebase_);
|
||||
}
|
||||
|
||||
void TimelineOutput::Retranslate()
|
||||
{
|
||||
for (int i=0;i<track_inputs_.size();i++) {
|
||||
QString input_name;
|
||||
|
||||
switch (static_cast<TrackType>(i)) {
|
||||
case kTrackTypeVideo:
|
||||
input_name = tr("Video Tracks");
|
||||
break;
|
||||
case kTrackTypeAudio:
|
||||
input_name = tr("Audio Tracks");
|
||||
break;
|
||||
case kTrackTypeSubtitle:
|
||||
input_name = tr("Subtitle Tracks");
|
||||
break;
|
||||
case kTrackTypeNone:
|
||||
case kTrackTypeCount:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!input_name.isEmpty())
|
||||
track_inputs_.at(i)->set_name(input_name);
|
||||
}
|
||||
}
|
||||
|
||||
NodeInput *TimelineOutput::track_input(TrackType type) const
|
||||
{
|
||||
return track_inputs_.at(type);
|
||||
|
||||
@@ -52,14 +52,14 @@ public:
|
||||
|
||||
TrackList* track_list(TrackType type) const;
|
||||
|
||||
NodeOutput* length_output() const;
|
||||
|
||||
const rational& timeline_length() const;
|
||||
|
||||
const rational& timebase() const;
|
||||
|
||||
void SetTimebase(const rational &timebase);
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
signals:
|
||||
void LengthChanged(const rational& length);
|
||||
void TimebaseChanged(const rational &timebase);
|
||||
@@ -80,8 +80,6 @@ private:
|
||||
|
||||
QVector<TrackOutput*> track_cache_;
|
||||
|
||||
NodeOutput* length_output_;
|
||||
|
||||
rational length_;
|
||||
|
||||
rational timebase_;
|
||||
|
||||
@@ -132,12 +132,12 @@ void TrackList::AddTrack()
|
||||
|
||||
if (track_cache_.isEmpty()) {
|
||||
// Connect this track directly to this output
|
||||
NodeParam::ConnectEdge(track->track_output(), track_input_);
|
||||
NodeParam::ConnectEdge(track->output(), track_input_);
|
||||
} else {
|
||||
TrackOutput* current_last_track = track_cache_.last();
|
||||
|
||||
// Connect this track to the current last track
|
||||
NodeParam::ConnectEdge(track->track_output(), current_last_track->track_input());
|
||||
NodeParam::ConnectEdge(track->output(), current_last_track->track_input());
|
||||
|
||||
// FIXME: Test code only
|
||||
if (current_last_track->output()->IsConnected()) {
|
||||
|
||||
@@ -31,17 +31,14 @@ TrackOutput::TrackOutput() :
|
||||
index_(-1)
|
||||
{
|
||||
block_input_ = new NodeInputArray("block_in");
|
||||
AddParameter(block_input_);
|
||||
AddInput(block_input_);
|
||||
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);
|
||||
AddParameter(track_input_);
|
||||
|
||||
track_output_ = new NodeOutput("track_out");
|
||||
AddParameter(track_output_);
|
||||
AddInput(track_input_);
|
||||
}
|
||||
|
||||
void TrackOutput::set_track_type(const TrackType &track_type)
|
||||
@@ -106,11 +103,6 @@ NodeInput *TrackOutput::track_input()
|
||||
return track_input_;
|
||||
}
|
||||
|
||||
NodeOutput* TrackOutput::track_output()
|
||||
{
|
||||
return track_output_;
|
||||
}
|
||||
|
||||
Block *TrackOutput::BlockContainingTime(const rational &time) const
|
||||
{
|
||||
foreach (Block* block, block_cache_) {
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
|
||||
NodeInput* track_input();
|
||||
|
||||
NodeOutput* track_output();
|
||||
|
||||
Block* BlockContainingTime(const rational& time) const;
|
||||
|
||||
Block* NearestBlockBefore(const rational& time) const;
|
||||
@@ -160,8 +158,6 @@ private:
|
||||
|
||||
NodeInput* track_input_;
|
||||
|
||||
NodeOutput* track_output_;
|
||||
|
||||
TrackType track_type_;
|
||||
|
||||
rational track_length_;
|
||||
|
||||
@@ -24,15 +24,15 @@ ViewerOutput::ViewerOutput()
|
||||
{
|
||||
texture_input_ = new NodeInput("tex_in");
|
||||
texture_input_->set_data_type(NodeInput::kTexture);
|
||||
AddParameter(texture_input_);
|
||||
AddInput(texture_input_);
|
||||
|
||||
samples_input_ = new NodeInput("samples_in");
|
||||
samples_input_->set_data_type(NodeInput::kSamples);
|
||||
AddParameter(samples_input_);
|
||||
AddInput(samples_input_);
|
||||
|
||||
length_input_ = new NodeInput("length_in");
|
||||
length_input_->set_data_type(NodeInput::kRational);
|
||||
AddParameter(length_input_);
|
||||
AddInput(length_input_);
|
||||
}
|
||||
|
||||
Node *ViewerOutput::copy() const
|
||||
|
||||
Reference in New Issue
Block a user