began new infrastructure

Yep, this is another one of my "famous" sweeping rewrites. Expect things to break.

Goals for this are:
- Greatly simplify node connections (particularly with arrays) so the code requires less maintenance/is more stable
- Redesign node structure to address issues where UI would stall for lengthy periods of time
- Less reliance on shared ptrs/greater reliance on QObject system for inheritance/memory management
- General code cleanup and improvements
This commit is contained in:
itsmattkc
2021-01-05 11:20:38 +11:00
parent 19eabf2830
commit 181235f6ce
152 changed files with 3932 additions and 8166 deletions
+13 -7
View File
@@ -42,7 +42,7 @@ Sequence::Sequence()
{
viewer_output_ = new ViewerOutput();
viewer_output_->SetCanBeDeleted(false);
AddNode(viewer_output_);
viewer_output_->setParent(this);
}
void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint version, const QAtomicInt *cancelled)
@@ -158,8 +158,7 @@ void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint v
if (node) {
node->Load(reader, xml_node_data, cancelled);
AddNode(node);
node->setParent(this);
}
} else {
reader->skipCurrentElement();
@@ -222,10 +221,17 @@ void Sequence::Save(QXmlStreamWriter *writer) const
void Sequence::add_default_nodes()
{
// Create tracks and connect them to the viewer
Node* video_track_output = viewer_output_->track_list(Timeline::kTrackTypeVideo)->AddTrack();
Node* audio_track_output = viewer_output_->track_list(Timeline::kTrackTypeAudio)->AddTrack();
NodeParam::ConnectEdge(video_track_output->output(), viewer_output_->texture_input());
NodeParam::ConnectEdge(audio_track_output->output(), viewer_output_->samples_input());
TrackOutput* video_track = new TrackOutput();
video_track->setParent(this);
viewer_output_->track_input(Timeline::kTrackTypeVideo)->ArrayAppend();
Node::ConnectEdge(video_track, viewer_output_->track_input(Timeline::kTrackTypeVideo), 0);
Node::ConnectEdge(video_track, viewer_output_->texture_input());
TrackOutput* audio_track = new TrackOutput();
audio_track->setParent(this);
viewer_output_->track_input(Timeline::kTrackTypeAudio)->ArrayAppend();
Node::ConnectEdge(audio_track, viewer_output_->track_input(Timeline::kTrackTypeAudio), 0);
Node::ConnectEdge(audio_track, viewer_output_->samples_input());
}
Item::Type Sequence::type() const