Finish TODO 6 and 7
This commit is contained in:
+8
-3
@@ -30,13 +30,18 @@
|
||||
6) editBegin/editEnd、Progress、Timeline 等回调还只是空实现
|
||||
- 现状:`OlivePluginInstance` 中多处函数是空壳或默认返回。
|
||||
- 为什么需要:插件在编辑参数、显示进度、根据时间线上下文渲染时依赖这些回调。
|
||||
- 可能改动:实现 editBegin/editEnd 通知;progressStart/Update/End 与 UI 进度条连接;timelineGetTime/GotoTime/Bounds 与工程时间轴连接。
|
||||
- 已完成:
|
||||
- editBegin/editEnd:实现编辑会话计数,保证调用合法并可用于后续扩展。
|
||||
- progressStart/Update/End:接入 `ProgressDialog`,支持取消并返回给插件停止信号。
|
||||
- timeLineGetTime/GotoTime/Bounds:关联当前活跃的时间线/面板播放头,读取与设置时间。
|
||||
|
||||
7) 持久消息展示与清理机制需要完善
|
||||
- 现状:我们已在 Host/Instance 里保存消息并能弹窗,但 UI 面板还需要稳定地展示、更新和清理。
|
||||
- 为什么需要:插件经常用 persistent message 提示错误或警告,需要可追踪、可清除。
|
||||
- 可能改动:统一消息存储(Host/Instance),提供 UI 列表、清除按钮、计数徽标,并保证信号更新。
|
||||
|
||||
- 已完成:
|
||||
- Host/Instance 持久消息保存,节点右上角显示数量徽标。
|
||||
- 参数面板顶部展示消息列表,并可点击清除按钮移除消息。
|
||||
- 清除/新增消息后通过信号更新 UI。
|
||||
8) Project Extent / Fielding 行为待确认
|
||||
- 现状:`OlivePluginInstance::getProjectExtent()` 有 “TODO” 注释。
|
||||
- 为什么需要:OFX 插件会根据项目尺寸、扫描线场信息做渲染决策。
|
||||
|
||||
@@ -21,11 +21,19 @@
|
||||
#include "ofxCore.h"
|
||||
#include "ofxMessage.h"
|
||||
#include "common/Current.h"
|
||||
#include "core.h"
|
||||
#include "dialog/progress/progress.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
#include "panel/panelmanager.h"
|
||||
#include "panel/timebased/timebased.h"
|
||||
#include "panel/timeline/timeline.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <QMessageBox>
|
||||
#include <QCoreApplication>
|
||||
#include <qmessagebox.h>
|
||||
#include <qobject.h>
|
||||
#include <QtGlobal>
|
||||
#include <string.h>
|
||||
#include <QString>
|
||||
#include "paraminstance.h"
|
||||
@@ -33,6 +41,72 @@ namespace olive
|
||||
{
|
||||
namespace plugin
|
||||
{
|
||||
namespace {
|
||||
class DeferredRedoCommand : public UndoCommand {
|
||||
public:
|
||||
explicit DeferredRedoCommand(UndoCommand *inner)
|
||||
: inner_(inner)
|
||||
{
|
||||
}
|
||||
|
||||
~DeferredRedoCommand() override
|
||||
{
|
||||
delete inner_;
|
||||
}
|
||||
|
||||
Project *GetRelevantProject() const override
|
||||
{
|
||||
return inner_ ? inner_->GetRelevantProject() : nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
void redo() override
|
||||
{
|
||||
if (skip_first_redo_) {
|
||||
skip_first_redo_ = false;
|
||||
return;
|
||||
}
|
||||
if (inner_) {
|
||||
inner_->redo_now();
|
||||
}
|
||||
}
|
||||
|
||||
void undo() override
|
||||
{
|
||||
if (inner_) {
|
||||
inner_->undo_now();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
UndoCommand *inner_ = nullptr;
|
||||
bool skip_first_redo_ = true;
|
||||
};
|
||||
|
||||
ViewerOutput *GetActiveViewerOutput()
|
||||
{
|
||||
PanelManager *manager = PanelManager::instance();
|
||||
if (!manager) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (auto *time_panel = manager->MostRecentlyFocused<TimeBasedPanel>()) {
|
||||
if (time_panel->GetConnectedViewer()) {
|
||||
return time_panel->GetConnectedViewer();
|
||||
}
|
||||
}
|
||||
|
||||
QList<TimelinePanel *> timelines = manager->GetPanelsOfType<TimelinePanel>();
|
||||
for (TimelinePanel *panel : timelines) {
|
||||
if (panel && panel->GetConnectedViewer()) {
|
||||
return panel->GetConnectedViewer();
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
OfxStatus OlivePluginInstance::vmessage(const char *type, const char *id,
|
||||
const char *format, va_list args)
|
||||
{
|
||||
@@ -200,6 +274,150 @@ OlivePluginInstance::newParam(const std::string &name,
|
||||
}
|
||||
OfxStatus OlivePluginInstance::editBegin(const std::string &name)
|
||||
{
|
||||
edit_depth_++;
|
||||
if (edit_depth_ == 1) {
|
||||
edit_command_ = nullptr;
|
||||
edit_label_.clear();
|
||||
edit_first_label_.clear();
|
||||
edit_param_count_ = 0;
|
||||
if (!name.empty()) {
|
||||
edit_first_label_ =
|
||||
QCoreApplication::translate(
|
||||
"OlivePluginInstance", "Change %1")
|
||||
.arg(QString::fromStdString(name));
|
||||
}
|
||||
}
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus OlivePluginInstance::editEnd()
|
||||
{
|
||||
if (edit_depth_ > 0) {
|
||||
edit_depth_--;
|
||||
}
|
||||
if (edit_depth_ == 0 && edit_command_) {
|
||||
QString label = edit_label_;
|
||||
if (label.isEmpty()) {
|
||||
if (edit_param_count_ <= 1 && !edit_first_label_.isEmpty()) {
|
||||
label = edit_first_label_;
|
||||
} else if (edit_param_count_ > 1 &&
|
||||
!edit_first_label_.isEmpty()) {
|
||||
label = QCoreApplication::translate(
|
||||
"OlivePluginInstance", "%1 (+%2)")
|
||||
.arg(edit_first_label_)
|
||||
.arg(edit_param_count_ - 1);
|
||||
} else {
|
||||
label = QCoreApplication::translate(
|
||||
"OlivePluginInstance", "Edit Parameters");
|
||||
}
|
||||
}
|
||||
Core::instance()->undo_stack()->push(edit_command_, label);
|
||||
edit_command_ = nullptr;
|
||||
edit_label_.clear();
|
||||
edit_first_label_.clear();
|
||||
edit_param_count_ = 0;
|
||||
}
|
||||
return kOfxStatOK;
|
||||
}
|
||||
|
||||
void OlivePluginInstance::SubmitUndoCommand(UndoCommand *command,
|
||||
const QString &label)
|
||||
{
|
||||
if (!command) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (edit_depth_ > 0) {
|
||||
if (!edit_command_) {
|
||||
edit_command_ = new MultiUndoCommand();
|
||||
}
|
||||
edit_param_count_++;
|
||||
if (!label.isEmpty() && edit_first_label_.isEmpty()) {
|
||||
edit_first_label_ = label;
|
||||
}
|
||||
|
||||
command->redo_now();
|
||||
edit_command_->add_child(new DeferredRedoCommand(command));
|
||||
return;
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command, label);
|
||||
}
|
||||
|
||||
void OlivePluginInstance::progressStart(const std::string &message,
|
||||
const std::string &messageid)
|
||||
{
|
||||
(void)messageid;
|
||||
progress_cancelled_ = false;
|
||||
progress_active_ = true;
|
||||
|
||||
if (progress_dialog_) {
|
||||
progress_dialog_->close();
|
||||
progress_dialog_->deleteLater();
|
||||
}
|
||||
|
||||
QString dialog_message = message.empty()
|
||||
? QStringLiteral("Processing...")
|
||||
: QString::fromStdString(message);
|
||||
|
||||
progress_dialog_ = new ProgressDialog(
|
||||
dialog_message, QStringLiteral("OpenFX"), Core::instance()->main_window());
|
||||
progress_dialog_->setAttribute(Qt::WA_DeleteOnClose);
|
||||
connect(progress_dialog_, &ProgressDialog::Cancelled, this,
|
||||
[this]() { progress_cancelled_ = true; });
|
||||
progress_dialog_->show();
|
||||
}
|
||||
|
||||
void OlivePluginInstance::progressEnd()
|
||||
{
|
||||
progress_active_ = false;
|
||||
progress_cancelled_ = false;
|
||||
|
||||
if (progress_dialog_) {
|
||||
progress_dialog_->close();
|
||||
progress_dialog_->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
bool OlivePluginInstance::progressUpdate(double t)
|
||||
{
|
||||
if (!progress_active_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (progress_dialog_) {
|
||||
double clamped = qBound(0.0, t, 1.0);
|
||||
progress_dialog_->SetProgress(clamped);
|
||||
}
|
||||
|
||||
return !progress_cancelled_;
|
||||
}
|
||||
|
||||
double OlivePluginInstance::timeLineGetTime()
|
||||
{
|
||||
if (ViewerOutput *viewer = GetActiveViewerOutput()) {
|
||||
return viewer->GetPlayhead().toDouble();
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void OlivePluginInstance::timeLineGotoTime(double t)
|
||||
{
|
||||
if (ViewerOutput *viewer = GetActiveViewerOutput()) {
|
||||
viewer->SetPlayhead(core::rational::fromDouble(t));
|
||||
}
|
||||
}
|
||||
|
||||
void OlivePluginInstance::timeLineGetBounds(double &t1, double &t2)
|
||||
{
|
||||
if (ViewerOutput *viewer = GetActiveViewerOutput()) {
|
||||
t1 = 0.0;
|
||||
t2 = viewer->GetLength().toDouble();
|
||||
return;
|
||||
}
|
||||
|
||||
t1 = 0.0;
|
||||
t2 = 0.0;
|
||||
}
|
||||
|
||||
OFX::Host::ImageEffect::ClipInstance *OlivePluginInstance::newClipInstance(
|
||||
|
||||
@@ -23,13 +23,16 @@
|
||||
#include "ofxhImageEffect.h"
|
||||
#include "node/plugins/Plugin.h"
|
||||
#include "render/videoparams.h"
|
||||
#include "undo/undocommand.h"
|
||||
|
||||
#include <map>
|
||||
#include <QPointer>
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qlist.h>
|
||||
namespace olive {
|
||||
namespace plugin{
|
||||
class PluginNode;
|
||||
class ProgressDialog;
|
||||
enum class ErrorType{
|
||||
Error,
|
||||
Warning,
|
||||
@@ -132,21 +135,17 @@ public:
|
||||
/// Client host code needs to implement this
|
||||
OFX::Host::Param::Instance* newParam(const std::string& name, OFX::Host::Param::Descriptor& Descriptor) override;
|
||||
|
||||
void SubmitUndoCommand(UndoCommand *command, const QString &label);
|
||||
|
||||
/// Triggered when the plug-in calls OfxParameterSuiteV1::paramEditBegin
|
||||
///
|
||||
/// Client host code needs to implement this
|
||||
virtual OfxStatus editBegin(const std::string& name)
|
||||
{
|
||||
return kOfxStatOK;
|
||||
};
|
||||
virtual OfxStatus editBegin(const std::string& name) override;
|
||||
|
||||
/// Triggered when the plug-in calls OfxParameterSuiteV1::paramEditEnd
|
||||
///
|
||||
/// Client host code needs to implement this
|
||||
virtual OfxStatus editEnd()
|
||||
{
|
||||
return kOfxStatOK;
|
||||
};
|
||||
virtual OfxStatus editEnd() override;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -156,16 +155,15 @@ public:
|
||||
// overridden for Progress::ProgressI
|
||||
|
||||
/// Start doing progress.
|
||||
virtual void progressStart(const std::string &message, const std::string &messageid)
|
||||
{
|
||||
};
|
||||
virtual void progressStart(const std::string &message,
|
||||
const std::string &messageid) override;
|
||||
|
||||
/// finish yer progress
|
||||
virtual void progressEnd(){};
|
||||
virtual void progressEnd() override;
|
||||
|
||||
/// set the progress to some level of completion, returns
|
||||
/// false if you should abandon processing, true to continue
|
||||
virtual bool progressUpdate(double t){return true;};
|
||||
virtual bool progressUpdate(double t) override;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -189,6 +187,14 @@ private:
|
||||
QList<PersistentErrors> persistentErrors_;
|
||||
VideoParams params_;
|
||||
std::shared_ptr<PluginNode> node_ = nullptr;
|
||||
int edit_depth_ = 0;
|
||||
MultiUndoCommand *edit_command_ = nullptr;
|
||||
QString edit_label_;
|
||||
QString edit_first_label_;
|
||||
int edit_param_count_ = 0;
|
||||
QPointer<ProgressDialog> progress_dialog_;
|
||||
bool progress_cancelled_ = false;
|
||||
bool progress_active_ = false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,30 @@
|
||||
|
||||
#include "paraminstance.h"
|
||||
|
||||
#include "OlivePluginInstance.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
namespace plugin
|
||||
{
|
||||
void SubmitUndoCommand(const std::shared_ptr<PluginNode> &node,
|
||||
UndoCommand *command, const QString &label)
|
||||
{
|
||||
if (!command) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node) {
|
||||
auto *instance = node->getPluginInstance();
|
||||
auto *olive_instance =
|
||||
dynamic_cast<OlivePluginInstance *>(instance);
|
||||
if (olive_instance) {
|
||||
olive_instance->SubmitUndoCommand(command, label);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ inline QString ParamChangeLabel(const OFX::Host::Param::Descriptor &descriptor)
|
||||
return QStringLiteral("Change %1")
|
||||
.arg(QString::fromStdString(descriptor.getName()));
|
||||
}
|
||||
void SubmitUndoCommand(const std::shared_ptr<PluginNode> &node,
|
||||
UndoCommand *command, const QString &label);
|
||||
|
||||
class PushbuttonInstance : public OFX::Host::Param::PushbuttonInstance {
|
||||
protected:
|
||||
@@ -97,8 +99,7 @@ public:
|
||||
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(_node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(_node, command, ParamChangeLabel(_descriptor));
|
||||
id=_descriptor.getName().c_str();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
@@ -108,8 +109,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(_node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), data, 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(_node, command, ParamChangeLabel(_descriptor));
|
||||
id=_descriptor.getName().c_str();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
@@ -155,8 +155,7 @@ public:
|
||||
NodeValue::kFloat, data);
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, double data)
|
||||
@@ -165,8 +164,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), data, 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus derive(OfxTime, double&)
|
||||
@@ -219,8 +217,7 @@ public:
|
||||
NodeValue::kBoolean, data);
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, bool data)
|
||||
@@ -229,8 +226,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), data, 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -275,8 +271,7 @@ public:
|
||||
NodeValue::kCombo, data);
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, int data)
|
||||
@@ -285,8 +280,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), data, 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -335,8 +329,7 @@ public:
|
||||
QVariant::fromValue(olive::core::Color(r, g, b, a)));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, double r,double g,double b,double a)
|
||||
@@ -351,8 +344,7 @@ public:
|
||||
b, 2, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name), rational::fromDouble(time),
|
||||
a, 3, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -400,8 +392,7 @@ public:
|
||||
QVariant::fromValue(olive::core::Color(r, g, b)));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, double r,double g,double b)
|
||||
@@ -414,8 +405,7 @@ public:
|
||||
g, 1, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name), rational::fromDouble(time),
|
||||
b, 2, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -457,8 +447,7 @@ public:
|
||||
NodeValue::kVec2, QVector2D(x, y));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time,double x,double y)
|
||||
@@ -469,8 +458,7 @@ public:
|
||||
x, 0, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name), rational::fromDouble(time),
|
||||
y, 1, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -512,8 +500,7 @@ public:
|
||||
NodeValue::kVec2, QVector2D(x, y));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time,int x,int y)
|
||||
@@ -524,8 +511,7 @@ public:
|
||||
x, 0, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name), rational::fromDouble(time),
|
||||
y, 1, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -570,8 +556,7 @@ public:
|
||||
NodeValue::kVec3, QVector3D(x, y, z));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time,double x,double y,double z)
|
||||
@@ -584,8 +569,7 @@ public:
|
||||
rational::fromDouble(time), y, 1, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name),
|
||||
rational::fromDouble(time), z, 2, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -630,8 +614,7 @@ public:
|
||||
NodeValue::kVec3, QVector3D(x, y, z));
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time,int x,int y,int z)
|
||||
@@ -644,8 +627,7 @@ public:
|
||||
rational::fromDouble(time), y, 1, command, true);
|
||||
Node::SetValueAtTime(NodeInput(node.get(), name),
|
||||
rational::fromDouble(time), z, 2, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -692,8 +674,7 @@ public:
|
||||
NodeValue::kText, v);
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, const char *data)
|
||||
@@ -702,8 +683,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), QString::fromUtf8(data), 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
@@ -758,8 +738,7 @@ public:
|
||||
NodeValue::kBinary, v);
|
||||
auto command = new NodeParamSetSplitStandardValueCommand(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()), split);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus set(OfxTime time, const char *data)
|
||||
@@ -768,8 +747,7 @@ public:
|
||||
Node::SetValueAtTime(
|
||||
NodeInput(node.get(), _descriptor.getName().c_str()),
|
||||
rational::fromDouble(time), QByteArray(data), 0, command, true);
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
ParamChangeLabel(_descriptor));
|
||||
SubmitUndoCommand(node, command, ParamChangeLabel(_descriptor));
|
||||
return kOfxStatOK;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4782,4 +4782,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4788,4 +4788,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4702,4 +4702,19 @@ Opravdu chcete tento záznam smazat?</translation>
|
||||
<translation>Vzorky</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -5734,4 +5734,19 @@ Soll es wirklich gelöscht werden?</translation>
|
||||
<translation>Samples</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -69,4 +69,19 @@
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4933,4 +4933,19 @@ y salida.</translation>
|
||||
<translation>Muestras</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4918,4 +4918,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4788,4 +4788,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4782,4 +4782,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -5494,4 +5494,19 @@ Equivale a moltiplicare per una matrice ortografica.</translation>
|
||||
<translation>Esempi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -5480,4 +5480,19 @@ Are you sure you wish to delete this footage?</source>
|
||||
<translation>サンプル</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4782,4 +4782,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -6093,4 +6093,19 @@ Duration: %3</source>
|
||||
<translation>Сэмплы</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4788,4 +4788,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4782,4 +4782,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4782,4 +4782,19 @@ What would you like to do with these clips?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -7418,4 +7418,19 @@ Please check your audio preferences and try again.</source>
|
||||
<translation>垂直</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -4795,4 +4795,19 @@ What would you like to do with these clips?</translation>
|
||||
<translation>取樣</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>OlivePluginInstance</name>
|
||||
<message>
|
||||
<source>Change %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>%1 (+%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Edit Parameters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -51,6 +51,7 @@ NodeParamViewItem::NodeParamViewItem(
|
||||
: super(parent)
|
||||
, body_(nullptr)
|
||||
, message_label_(nullptr)
|
||||
, message_clear_button_(nullptr)
|
||||
, message_container_(nullptr)
|
||||
, node_(node)
|
||||
, create_checkboxes_(create_checkboxes)
|
||||
@@ -103,6 +104,7 @@ void NodeParamViewItem::RecreateBody()
|
||||
message_container_->deleteLater();
|
||||
message_container_ = nullptr;
|
||||
message_label_ = nullptr;
|
||||
message_clear_button_ = nullptr;
|
||||
}
|
||||
|
||||
body_ = new NodeParamViewItemBody(node_, create_checkboxes_, this);
|
||||
@@ -123,6 +125,16 @@ void NodeParamViewItem::RecreateBody()
|
||||
message_layout->setContentsMargins(0, 0, 0, 0);
|
||||
message_layout->setSpacing(4);
|
||||
|
||||
QHBoxLayout *message_header = new QHBoxLayout();
|
||||
message_header->setContentsMargins(0, 0, 0, 0);
|
||||
message_header->addStretch();
|
||||
message_clear_button_ = new QPushButton(tr("Clear"), message_container_);
|
||||
message_clear_button_->setVisible(false);
|
||||
connect(message_clear_button_, &QPushButton::clicked, this,
|
||||
&NodeParamViewItem::ClearMessages);
|
||||
message_header->addWidget(message_clear_button_);
|
||||
message_layout->addLayout(message_header);
|
||||
|
||||
message_label_ = new QLabel(message_container_);
|
||||
message_label_->setWordWrap(true);
|
||||
message_label_->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
@@ -146,6 +158,9 @@ void NodeParamViewItem::UpdateMessagePanel()
|
||||
dynamic_cast<plugin::OlivePluginInstance *>(instance);
|
||||
if (!olive_instance || olive_instance->persistentMessageCount() == 0) {
|
||||
message_label_->setVisible(false);
|
||||
if (message_clear_button_) {
|
||||
message_clear_button_->setVisible(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,6 +183,9 @@ void NodeParamViewItem::UpdateMessagePanel()
|
||||
|
||||
message_label_->setText(lines.join('\n'));
|
||||
message_label_->setVisible(true);
|
||||
if (message_clear_button_) {
|
||||
message_clear_button_->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
int NodeParamViewItem::GetElementY(const NodeInput &c) const
|
||||
@@ -185,6 +203,18 @@ void NodeParamViewItem::SetInputChecked(const NodeInput &input, bool e)
|
||||
body_->SetInputChecked(input, e);
|
||||
}
|
||||
|
||||
void NodeParamViewItem::ClearMessages()
|
||||
{
|
||||
auto *instance = node_->getPluginInstance();
|
||||
auto *olive_instance =
|
||||
dynamic_cast<plugin::OlivePluginInstance *>(instance);
|
||||
if (!olive_instance) {
|
||||
return;
|
||||
}
|
||||
|
||||
olive_instance->clearPersistentMessage();
|
||||
}
|
||||
|
||||
NodeParamViewItemBody::NodeParamViewItemBody(
|
||||
Node *node, NodeParamViewCheckBoxBehavior create_checkboxes,
|
||||
QWidget *parent)
|
||||
|
||||
@@ -233,6 +233,7 @@ protected slots:
|
||||
private:
|
||||
NodeParamViewItemBody *body_;
|
||||
QLabel *message_label_;
|
||||
QPushButton *message_clear_button_;
|
||||
QWidget *message_container_;
|
||||
|
||||
Node *node_;
|
||||
@@ -250,6 +251,7 @@ private:
|
||||
private slots:
|
||||
void RecreateBody();
|
||||
void UpdateMessagePanel();
|
||||
void ClearMessages();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user