diff --git a/app/node/output/viewer/viewer.cpp b/app/node/output/viewer/viewer.cpp index e296e159c..f289ac914 100644 --- a/app/node/output/viewer/viewer.cpp +++ b/app/node/output/viewer/viewer.cpp @@ -216,7 +216,7 @@ void ViewerOutput::VerifyLength() if (video_length.isNull() && texture_input_->IsConnected()) { NodeValueTable t = traverser.GenerateTable(texture_input_->GetConnectedNode(), 0, 0); - video_length = t.Get(NodeValue::kRational, "length").value(); + video_length = t.Get(NodeValue::kRational, QStringLiteral("length")).value(); } video_frame_cache_.SetLength(video_length); @@ -227,7 +227,7 @@ void ViewerOutput::VerifyLength() if (audio_length.isNull() && samples_input_->IsConnected()) { NodeValueTable t = traverser.GenerateTable(samples_input_->GetConnectedNode(), 0, 0); - audio_length = t.Get(NodeValue::kRational, "length").value(); + audio_length = t.Get(NodeValue::kRational, QStringLiteral("length")).value(); } audio_playback_cache_.SetLength(audio_length); @@ -277,13 +277,6 @@ void ViewerOutput::Retranslate() } } -void ViewerOutput::set_media_name(const QString &name) -{ - media_name_ = name; - - emit MediaNameChanged(media_name_); -} - void ViewerOutput::BeginOperation() { operation_stack_++; diff --git a/app/node/output/viewer/viewer.h b/app/node/output/viewer/viewer.h index b49e74276..22b4cdbc5 100644 --- a/app/node/output/viewer/viewer.h +++ b/app/node/output/viewer/viewer.h @@ -60,21 +60,25 @@ public: void ShiftAudioCache(const rational& from, const rational& to); void ShiftCache(const rational& from, const rational& to); - NodeInput* texture_input() const { + NodeInput* texture_input() const + { return texture_input_; } - NodeInput* samples_input() const { + NodeInput* samples_input() const + { return samples_input_; } virtual void InvalidateCache(const TimeRange& range, const InputConnection& from) override; - const VideoParams& video_params() const { + const VideoParams& video_params() const + { return video_params_; } - const AudioParams& audio_params() const { + const AudioParams& audio_params() const + { return audio_params_; } @@ -83,11 +87,13 @@ public: rational GetLength(); - const QUuid& uuid() const { + const QUuid& uuid() const + { return uuid_; } - const QVector &GetTracks() const { + const QVector &GetTracks() const + { return track_cache_; } @@ -96,27 +102,25 @@ public: */ QVector GetUnlockedTracks() const; - NodeInput* track_input(Timeline::TrackType type) const { + NodeInput* track_input(Timeline::TrackType type) const + { return track_inputs_.at(type); } - TrackList* track_list(Timeline::TrackType type) const { + TrackList* track_list(Timeline::TrackType type) const + { return track_lists_.at(type); } virtual void Retranslate() override; - const QString& media_name() const { - return media_name_; - } - - void set_media_name(const QString& name); - - FrameHashCache* video_frame_cache() { + FrameHashCache* video_frame_cache() + { return &video_frame_cache_; } - AudioPlaybackCache* audio_playback_cache() { + AudioPlaybackCache* audio_playback_cache() + { return &audio_playback_cache_; } @@ -146,8 +150,6 @@ signals: void TrackHeightChanged(Timeline::TrackType type, int index, int height); - void MediaNameChanged(const QString& name); - private: QUuid uuid_; @@ -167,8 +169,6 @@ private: rational last_length_; - QString media_name_; - FrameHashCache video_frame_cache_; AudioPlaybackCache audio_playback_cache_; diff --git a/app/panel/timebased/timebased.cpp b/app/panel/timebased/timebased.cpp index be52e2ca5..8b3ea15f6 100644 --- a/app/panel/timebased/timebased.cpp +++ b/app/panel/timebased/timebased.cpp @@ -130,13 +130,13 @@ void TimeBasedPanel::ConnectViewerNode(ViewerOutput *node) } if (widget_->GetConnectedNode()) { - disconnect(widget_->GetConnectedNode(), &ViewerOutput::MediaNameChanged, this, &TimeBasedPanel::SetSubtitle); + disconnect(widget_->GetConnectedNode(), &ViewerOutput::LabelChanged, this, &TimeBasedPanel::SetSubtitle); } widget_->ConnectViewerNode(node); if (node) { - connect(node, &ViewerOutput::MediaNameChanged, this, &TimeBasedPanel::SetSubtitle); + connect(node, &ViewerOutput::LabelChanged, this, &TimeBasedPanel::SetSubtitle); } // Update strings @@ -163,7 +163,7 @@ void TimeBasedPanel::SetTimeBasedWidget(TimeBasedWidget *widget) void TimeBasedPanel::Retranslate() { if (GetTimeBasedWidget()->GetConnectedNode()) { - SetSubtitle(GetTimeBasedWidget()->GetConnectedNode()->media_name()); + SetSubtitle(GetTimeBasedWidget()->GetConnectedNode()->GetLabel()); } else { SetSubtitle(tr("(none)")); } diff --git a/app/project/item/sequence/sequence.cpp b/app/project/item/sequence/sequence.cpp index 98453eea4..ab79763c5 100644 --- a/app/project/item/sequence/sequence.cpp +++ b/app/project/item/sequence/sequence.cpp @@ -43,6 +43,7 @@ Sequence::Sequence() viewer_output_ = new ViewerOutput(); viewer_output_->SetCanBeDeleted(false); viewer_output_->setParent(this); + connect(viewer_output_, &ViewerOutput::LabelChanged, this, &Sequence::set_name); } void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint version, const QAtomicInt *cancelled) @@ -366,7 +367,7 @@ ViewerOutput *Sequence::viewer_output() const void Sequence::NameChangedEvent(const QString &name) { - viewer_output_->set_media_name(name); + viewer_output_->SetLabel(name); } } diff --git a/app/task/export/export.cpp b/app/task/export/export.cpp index 50bcb3554..7d97c02a2 100644 --- a/app/task/export/export.cpp +++ b/app/task/export/export.cpp @@ -32,7 +32,7 @@ ExportTask::ExportTask(ViewerOutput* viewer_node, color_manager_(color_manager), params_(params) { - SetTitle(tr("Exporting \"%1\"").arg(viewer_node->media_name())); + SetTitle(tr("Exporting \"%1\"").arg(viewer_node->GetLabel())); } bool ExportTask::Run() diff --git a/app/widget/viewer/footageviewer.cpp b/app/widget/viewer/footageviewer.cpp index 0ee3818b5..563d079e4 100644 --- a/app/widget/viewer/footageviewer.cpp +++ b/app/widget/viewer/footageviewer.cpp @@ -68,7 +68,7 @@ void FootageViewerWidget::SetFootage(Footage *footage) if (footage_) { // Update sequence media name - sequence_.viewer_output()->set_media_name(footage_->name()); + sequence_.viewer_output()->SetLabel(footage_->name()); // Reset parameters and then attempt to set from footage sequence_.set_default_parameters();