viewer: use label instead of media name

This commit is contained in:
itsmattkc
2021-01-09 10:38:04 +11:00
parent 181235f6ce
commit 441a459774
6 changed files with 29 additions and 35 deletions
+2 -9
View File
@@ -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<rational>();
video_length = t.Get(NodeValue::kRational, QStringLiteral("length")).value<rational>();
}
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<rational>();
audio_length = t.Get(NodeValue::kRational, QStringLiteral("length")).value<rational>();
}
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_++;
+20 -20
View File
@@ -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<TrackOutput *> &GetTracks() const {
const QVector<TrackOutput *> &GetTracks() const
{
return track_cache_;
}
@@ -96,27 +102,25 @@ public:
*/
QVector<TrackOutput *> 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_;
+3 -3
View File
@@ -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)"));
}
+2 -1
View File
@@ -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);
}
}
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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();