Finish TODO 6 and 7
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user