Sync Footage proxy state to render worker copy project
Proxy state (enabled/path/state/etc.) is stored as Footage member data, not as a Node input, so ProjectCopier did not synchronize it to the internal copy project used by worker processes. This caused toggling Use Proxy in the UI to have no effect on rendered output. Add a Footage::ProxySettingsChanged signal and have ProjectCopier sync the proxy state to the copied Footage node, marking the copy project modified so RenderWorkerPool writes a fresh graph snapshot.
This commit is contained in:
@@ -240,6 +240,7 @@ void Footage::SetProxy(const QString &path,
|
||||
proxy_video_stream_index_ = video_stream_index;
|
||||
proxy_preset_version_ = preset_version;
|
||||
proxy_enabled_ = enabled;
|
||||
emit ProxySettingsChanged();
|
||||
}
|
||||
|
||||
void Footage::ClearProxy()
|
||||
@@ -249,6 +250,7 @@ void Footage::ClearProxy()
|
||||
proxy_state_ = ProxyManager::kProxyMissing;
|
||||
proxy_video_stream_index_ = -1;
|
||||
proxy_preset_version_ = 0;
|
||||
emit ProxySettingsChanged();
|
||||
}
|
||||
|
||||
QString Footage::DescribeVideoStream(const VideoParams ¶ms)
|
||||
|
||||
@@ -180,7 +180,10 @@ public:
|
||||
|
||||
void set_proxy_enabled(bool enabled)
|
||||
{
|
||||
proxy_enabled_ = enabled;
|
||||
if (proxy_enabled_ != enabled) {
|
||||
proxy_enabled_ = enabled;
|
||||
emit ProxySettingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
const QString &proxy_path() const
|
||||
@@ -240,6 +243,10 @@ public:
|
||||
SerializedData *data) override;
|
||||
virtual void SaveCustom(QXmlStreamWriter *writer) const override;
|
||||
|
||||
signals:
|
||||
void ProxySettingsChanged();
|
||||
|
||||
public:
|
||||
static const QString kFilenameInput;
|
||||
|
||||
virtual void AddedToGraphEvent(Project *p) override;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "projectcopier.h"
|
||||
|
||||
#include "node/group/group.h"
|
||||
#include "node/project/footage/footage.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -260,10 +261,35 @@ void ProjectCopier::InsertIntoCopyMap(Node *node, Node *copy)
|
||||
// Copy parameters
|
||||
Node::CopyInputs(node, copy, false);
|
||||
|
||||
// Sync Footage proxy state (which is not stored as a Node input)
|
||||
if (Footage *src_footage = dynamic_cast<Footage *>(node)) {
|
||||
if (dynamic_cast<Footage *>(copy)) {
|
||||
connect(src_footage, &Footage::ProxySettingsChanged, this,
|
||||
[this, src_footage]() { SyncFootageProxySettings(src_footage); });
|
||||
SyncFootageProxySettings(src_footage);
|
||||
}
|
||||
}
|
||||
|
||||
// Connect to node's cache
|
||||
emit AddedNode(node);
|
||||
}
|
||||
|
||||
void ProjectCopier::SyncFootageProxySettings(Footage *source)
|
||||
{
|
||||
Footage *copy = GetCopy(source);
|
||||
if (!copy) {
|
||||
return;
|
||||
}
|
||||
|
||||
copy->SetProxy(source->proxy_path(), source->proxy_state(),
|
||||
source->proxy_video_stream_index(),
|
||||
source->proxy_preset_version(), source->proxy_enabled());
|
||||
|
||||
if (Project *cp = copy->project()) {
|
||||
cp->set_modified(true);
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectCopier::QueueNodeAdd(Node *node)
|
||||
{
|
||||
graph_update_queue_.push_back({ QueuedJob::kNodeAdded, node, NodeInput(),
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define PROJECTCOPIER_H
|
||||
|
||||
#include "node/project.h"
|
||||
#include "node/project/footage/footage.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -89,6 +90,8 @@ private:
|
||||
void DoValueHintChange(const NodeInput &input);
|
||||
void DoProjectSettingChange(const QString &key, const QString &value);
|
||||
|
||||
void SyncFootageProxySettings(Footage *source);
|
||||
|
||||
void InsertIntoCopyMap(Node *node, Node *copy);
|
||||
|
||||
void UpdateGraphChangeValue();
|
||||
|
||||
Reference in New Issue
Block a user