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:
itsmattkc
2019-12-06 04:21:55 +11:00
parent 694f424627
commit c32a1c8be2
18 changed files with 83 additions and 240 deletions
+26 -9
View File
@@ -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);
+2 -4
View File
@@ -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_;
+2 -2
View File
@@ -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()) {