change: Switch to offical OpenFX Support. Still can't compile.
This commit is contained in:
@@ -1,22 +1,6 @@
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
pluginSupport/OlivePlugin.h
|
||||
pluginSupport/OlivePlugin.cpp
|
||||
pluginSupport/Dialog.cpp
|
||||
pluginSupport/Core.cpp
|
||||
pluginSupport/DrawSuite.cpp
|
||||
pluginSupport/GpuRender.cpp
|
||||
pluginSupport/ImageEffect.cpp
|
||||
pluginSupport/Interact.cpp
|
||||
pluginSupport/KeySyms.cpp
|
||||
pluginSupport/Memory.cpp
|
||||
pluginSupport/MultiThread.cpp
|
||||
pluginSupport/OpenGLRender.cpp
|
||||
pluginSupport/Param.cpp
|
||||
pluginSupport/ParametricParam.cpp
|
||||
pluginSupport/Pixels.cpp
|
||||
pluginSupport/Progress.cpp
|
||||
pluginSupport/Property.cpp
|
||||
pluginSupport/TimeLine.cpp
|
||||
PARENT_SCOPE
|
||||
target_sources(libolive-editor PRIVATE
|
||||
OliveHost.h
|
||||
OliveHost.cpp
|
||||
OliveInstance.h
|
||||
OliveInstance.cpp
|
||||
)
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <ofxDialog.h>
|
||||
|
||||
OfxStatus NotifyRedrawPending()
|
||||
{
|
||||
return kOfxStatReplyDefault;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DrawSuite.h"
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "node/project.h"
|
||||
#include "ofxhImageEffect.h"
|
||||
#include <cstddef>
|
||||
#include <ofxhPluginCache.h>
|
||||
#include <ofxhBinary.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include "OliveHost.h"
|
||||
using namespace OFX::Host;
|
||||
using namespace olive::plugin;
|
||||
void loadPlugins(QString path)
|
||||
{
|
||||
QDir dir=(QCoreApplication::applicationDirPath()+path);
|
||||
QFileInfoList files=dir.entryInfoList();
|
||||
for (auto& file:files) {
|
||||
if (file.isDir()) {
|
||||
OFX::Binary binary(file.absoluteFilePath().toStdString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OliveHost::~OliveHost()
|
||||
{
|
||||
for(auto& descriptor:descriptors_){
|
||||
delete descriptor;
|
||||
descriptor=nullptr;
|
||||
}
|
||||
for(auto& instance:instances_){
|
||||
delete instance;
|
||||
instance=nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
ImageEffect::Descriptor *
|
||||
OliveHost::makeDescriptor(ImageEffect::ImageEffectPlugin* plugin)
|
||||
{
|
||||
ImageEffect::Descriptor* desc = new ImageEffect::Descriptor(plugin);
|
||||
descriptors_.append(desc);
|
||||
return desc;
|
||||
}
|
||||
ImageEffect::Descriptor *
|
||||
OliveHost::makeDescriptor(const ImageEffect::Descriptor &rootContext,
|
||||
ImageEffect::ImageEffectPlugin *plugin)
|
||||
{
|
||||
ImageEffect::Descriptor* desc = new ImageEffect::Descriptor(rootContext,plugin);
|
||||
descriptors_.append(desc);
|
||||
return desc;
|
||||
}
|
||||
ImageEffect::Descriptor *
|
||||
OliveHost::makeDescriptor(const std::string &bundlePath,
|
||||
ImageEffect::ImageEffectPlugin *plugin)
|
||||
{
|
||||
ImageEffect::Descriptor* desc = new ImageEffect::Descriptor(bundlePath, plugin);
|
||||
descriptors_.append(desc);
|
||||
return desc;
|
||||
}
|
||||
|
||||
OFX::Host::ImageEffect::Instance* OliveHost::newInstance(void* clientData,
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin* plugin,
|
||||
OFX::Host::ImageEffect::Descriptor& desc,
|
||||
const std::string& context){
|
||||
//ImageEffect::Instance* instance=new ImageEffect::Instance(clientData,plugin,desc,context);
|
||||
instances_.append(instance);
|
||||
return instance;
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "ofxhHost.h"
|
||||
#include "ofxhImageEffectAPI.h"
|
||||
#include "ofxCore.h"
|
||||
#include "ofxhImageEffect.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <cstdint>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include <any>
|
||||
#include <list>
|
||||
#include <OpenImageIO/detail/fmt/chrono.h>
|
||||
#include <qlist.h>
|
||||
namespace olive {
|
||||
namespace plugin {
|
||||
|
||||
|
||||
void loadPlugins(QString path);
|
||||
class OliveHost: public OFX::Host::ImageEffect::Host{
|
||||
public:
|
||||
OliveHost()=default;
|
||||
~OliveHost() override;
|
||||
|
||||
bool pluginSupported(OFX::Host::ImageEffect::ImageEffectPlugin *plugin,
|
||||
std::string &reason) const override
|
||||
{
|
||||
return true;
|
||||
};
|
||||
|
||||
OFX::Host::ImageEffect::Instance* newInstance(void* clientData,
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin* plugin,
|
||||
OFX::Host::ImageEffect::Descriptor& desc,
|
||||
const std::string& context) override;
|
||||
|
||||
|
||||
OFX::Host::ImageEffect::Descriptor *makeDescriptor(
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin* plugin) override;
|
||||
|
||||
OFX::Host::ImageEffect::Descriptor *makeDescriptor(
|
||||
const OFX::Host::ImageEffect::Descriptor &rootContext,
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin *plugin) override;
|
||||
|
||||
OFX::Host::ImageEffect::Descriptor *makeDescriptor(
|
||||
const std::string &bundlePath,
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin *plugin) override;
|
||||
|
||||
private:
|
||||
QList<OFX::Host::ImageEffect::Descriptor*> descriptors_;
|
||||
QList<OFX::Host::ImageEffect::Instance*> instances_;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "OliveInstance.h"
|
||||
#include "ofxCore.h"
|
||||
#include "ofxMessage.h"
|
||||
#include <cstdio>
|
||||
#include <QMessageBox>
|
||||
#include <qmessagebox.h>
|
||||
#include <string.h>
|
||||
#include <QString>
|
||||
namespace olive{
|
||||
namespace plugin {
|
||||
OfxStatus OliveInstance::vmessage(const char* type,
|
||||
const char* id,
|
||||
const char* format,
|
||||
va_list args){
|
||||
|
||||
char *buffer=new char[1024];
|
||||
|
||||
memset(buffer, 0, 1024*sizeof(char));
|
||||
vsprintf(buffer, format, args);
|
||||
|
||||
QString message(buffer);
|
||||
|
||||
delete [] buffer;
|
||||
|
||||
if(strncmp(type, kOfxMessageQuestion, strlen(kOfxMessageQuestion))){
|
||||
|
||||
auto ret= QMessageBox::information(nullptr,
|
||||
"", message,
|
||||
QMessageBox::Ok, QMessageBox::Cancel);
|
||||
|
||||
if(ret==QMessageBox::Ok){
|
||||
return kOfxStatReplyYes;
|
||||
}
|
||||
else {
|
||||
return kOfxStatReplyNo;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
QMessageBox::information(nullptr,
|
||||
"", message);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ofxImageEffect.h"
|
||||
#include "ofxhImageEffect.h"
|
||||
namespace olive {
|
||||
namespace plugin{
|
||||
class OliveInstance : public OFX::Host::ImageEffect::Instance {
|
||||
public:
|
||||
OliveInstance(
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin* plugin,
|
||||
OFX::Host::ImageEffect::Descriptor& desc,
|
||||
const std::string& context,
|
||||
bool interactive)
|
||||
: OFX::Host::ImageEffect::Instance(plugin, desc, context, interactive)
|
||||
{
|
||||
}
|
||||
~OliveInstance() override = default;
|
||||
virtual const std::string &getDefaultOutputFielding() const{
|
||||
return kOfxImageFieldNone;
|
||||
};
|
||||
|
||||
OFX::Host::ImageEffect::ClipInstance *newClipInstance(
|
||||
OFX::Host::ImageEffect::Instance *plugin,
|
||||
OFX::Host::ImageEffect::ClipDescriptor *descriptor,
|
||||
int index) override;
|
||||
|
||||
OfxStatus vmessage(const char* type,
|
||||
const char* id,
|
||||
const char* format,
|
||||
va_list args) override;
|
||||
|
||||
OfxStatus setPersistentMessage(const char* type,
|
||||
const char* id,
|
||||
const char* format,
|
||||
va_list args) override;
|
||||
|
||||
OfxStatus clearPersistentMessage() override;
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,215 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "OlivePlugin.h"
|
||||
|
||||
#include <utility>
|
||||
olive::plugin::OlivePlugin::~OlivePlugin()
|
||||
{
|
||||
for (void *p:mems) {
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getProp(QString key, int index,
|
||||
char **str)
|
||||
{
|
||||
*str=nullptr;
|
||||
if (stringProps.contains(key)) {
|
||||
if (stringProps[key].count()>index) {
|
||||
*str=stringProps[key][index];
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getPropN(QString key,
|
||||
char ***str)
|
||||
{
|
||||
*str=nullptr;
|
||||
if (stringProps.contains(key)) {
|
||||
*str=stringProps[key].data();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getProp(QString key, int index,
|
||||
void **str)
|
||||
{
|
||||
*str=nullptr;
|
||||
if (pointerProps.contains(key)) {
|
||||
if (pointerProps[key].count()>index) {
|
||||
*str=pointerProps[key][index];
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getPropN(QString key,
|
||||
void ***p)
|
||||
{
|
||||
*p=nullptr;
|
||||
if (pointerProps.contains(key)) {
|
||||
*p=pointerProps[key].data();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getProp(QString key, int index,
|
||||
int* p)
|
||||
{
|
||||
*p=0;
|
||||
if (intProps.contains(key)) {
|
||||
if (intProps[key].count()>index) {
|
||||
*p=intProps[key][index];
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getPropN(QString key,
|
||||
int **p)
|
||||
{
|
||||
*p=nullptr;
|
||||
if (intProps.contains(key)) {
|
||||
*p=intProps[key].data();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getProp(QString key, int index,
|
||||
double* p)
|
||||
{
|
||||
*p=0;
|
||||
if (doubleProps.contains(key)) {
|
||||
if (doubleProps[key].count()>index) {
|
||||
*p=doubleProps[key][index];
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::getPropN(QString key,
|
||||
double **p)
|
||||
{
|
||||
*p=nullptr;
|
||||
if (doubleProps.contains(key)) {
|
||||
*p=doubleProps[key].data();
|
||||
return kOfxStatOK;
|
||||
}
|
||||
return kOfxStatErrUnknown;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setProp(QString key, int index, char *str)
|
||||
{
|
||||
char *p=(char*)calloc(strlen(str)+1,sizeof(char));
|
||||
strcpy(p,str);
|
||||
if (stringProps.contains(key)) {
|
||||
if (stringProps[key].count()>index) {
|
||||
stringProps[key].insert(index, p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
stringProps[key].emplace_back(p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
QVector<char *> vec;
|
||||
vec.emplace_back(str);
|
||||
stringProps[key]=vec;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setPropN(QString key, int count, char **strs)
|
||||
{
|
||||
QVector<char *> vector;
|
||||
for (int i=0;i<count;i++) {
|
||||
char *p=(char*)calloc(strlen(strs[i])+1,sizeof(char));
|
||||
strcpy(p,strs[i]);
|
||||
vector.emplace_back(p);
|
||||
}
|
||||
stringProps[key]=vector;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setProp(QString key, int index, void *p)
|
||||
{
|
||||
if (pointerProps.contains(key)) {
|
||||
if (pointerProps[key].count()>index) {
|
||||
pointerProps[key].insert(index, p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
pointerProps[key].emplace_back(p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
QVector<void *> vec;
|
||||
vec.emplace_back(p);
|
||||
pointerProps[key]=vec;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setPropN(QString key,int count, void **ps)
|
||||
{
|
||||
QVector<void *> vector;
|
||||
vector.reserve(count);
|
||||
memcpy(vector.data(), ps, sizeof(void *)*count);
|
||||
pointerProps[key]=vector;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setProp(QString key, int index, int p)
|
||||
{
|
||||
if (intProps.contains(key)) {
|
||||
if (intProps[key].count()>index) {
|
||||
intProps[key].insert(index, p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
intProps[key].emplace_back(p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
QVector<int> vec;
|
||||
vec.emplace_back(p);
|
||||
intProps[key]=vec;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setPropN(QString key,int count, int *ps)
|
||||
{
|
||||
QVector<int> vector;
|
||||
vector.reserve(count);
|
||||
memcpy(vector.data(), ps, sizeof(int)*count);
|
||||
intProps[key]=vector;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setProp(QString key, int index, double p)
|
||||
{
|
||||
if (doubleProps.contains(key)) {
|
||||
if (doubleProps[key].count()>index) {
|
||||
doubleProps[key].insert(index, p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
doubleProps[key].emplace_back(p);
|
||||
return kOfxStatOK;
|
||||
}
|
||||
QVector<double> vec;
|
||||
vec.emplace_back(p);
|
||||
doubleProps[key]=vec;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
OfxStatus olive::plugin::OlivePlugin::setPropN(QString key,int count, double *ps)
|
||||
{
|
||||
QVector<double> vector;
|
||||
vector.reserve(count);
|
||||
memcpy(vector.data(), ps, sizeof(doubleProps)*count);
|
||||
doubleProps[key]=vector;
|
||||
return kOfxStatOK;
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OLIVE_PLUGIN_H
|
||||
#define OLIVE_PLUGIN_H
|
||||
#include "OlivePlugin.h"
|
||||
#include "ofxCore.h"
|
||||
#include <QVariant>
|
||||
#include <cstdint>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include <any>
|
||||
#include <list>
|
||||
#include <OpenImageIO/detail/fmt/chrono.h>
|
||||
namespace olive
|
||||
{
|
||||
namespace plugin
|
||||
{
|
||||
class Value;
|
||||
enum class Type {
|
||||
FLOAT, STRING, INT, POINTER, ARRAY, NONE
|
||||
};
|
||||
struct plugin_mem_ptr {
|
||||
void *mem;
|
||||
int32_t count=0;
|
||||
};
|
||||
class OlivePlugin {
|
||||
public:
|
||||
OlivePlugin()=default;
|
||||
~OlivePlugin();
|
||||
OfxStatus getProp(QString key, int index, char **str);
|
||||
OfxStatus getPropN(QString key, char *** strs);
|
||||
OfxStatus getProp(QString key, int index, void **p);
|
||||
OfxStatus getPropN(QString key, void ***ps);
|
||||
OfxStatus getProp(QString key, int index, int *p);
|
||||
OfxStatus getPropN(QString key, int **ps);
|
||||
OfxStatus getProp(QString key, int index, double *p);
|
||||
OfxStatus getPropN(QString key, double **ps);
|
||||
OfxStatus setProp(QString key, int index, char *str);
|
||||
OfxStatus setPropN(QString key,int count, char ** strs);
|
||||
OfxStatus setProp(QString key, int index, void *p);
|
||||
OfxStatus setPropN(QString key,int count, void **ps);
|
||||
OfxStatus setProp(QString key, int index, int p);
|
||||
OfxStatus setPropN(QString key,int count, int *ps);
|
||||
OfxStatus setProp(QString key, int index, double p);
|
||||
OfxStatus setPropN(QString key, int count, double *ps);
|
||||
void addMem(void *mem)
|
||||
{
|
||||
mems.emplace_back(mem);
|
||||
}
|
||||
private:
|
||||
uint64_t id;
|
||||
QString name;
|
||||
QString version;
|
||||
QMap<QString, QVector<char *>> stringProps;
|
||||
QMap<QString, QVector<int>> intProps;
|
||||
QMap<QString, QVector<double>> doubleProps;
|
||||
QMap<QString, QVector<void *>> pointerProps;
|
||||
std::list<void *> mems;
|
||||
};
|
||||
}
|
||||
}
|
||||
struct OfxPropertySetStruct {
|
||||
olive::plugin::OlivePlugin* plugin;
|
||||
};
|
||||
#endif //OLIVE_PLUGIN_H
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@@ -1,217 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "node/plugins/Plugin.h"
|
||||
|
||||
#include <ofxProperty.h>
|
||||
#include <OpenImageIO/simd.h>
|
||||
#include <oneapi/tbb/detail/_template_helpers.h>
|
||||
|
||||
OfxStatus propSetPointer(OfxPropertySetHandle properties,
|
||||
const char *property, int index, void *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetString(OfxPropertySetHandle properties,
|
||||
const char *property, int index, const char *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setProp(property, index, const_cast<char *>(value));
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetDouble(OfxPropertySetHandle properties,
|
||||
const char *property, int index, double value)
|
||||
{
|
||||
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetInt(OfxPropertySetHandle properties, const char *property,
|
||||
int index, int value)
|
||||
{
|
||||
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetPointerN(OfxPropertySetHandle properties,
|
||||
const char *property, int count, void * const*value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setPropN(property, count, const_cast<void**>(value));
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetStringN(OfxPropertySetHandle properties,
|
||||
const char *property, int index, int count,const char *const *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setPropN(property, count, const_cast<char**>(value));
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetDoubleN(OfxPropertySetHandle properties,
|
||||
const char *property,int count, const double* value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setPropN(property, count, const_cast<double *>(value));
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetIntN(OfxPropertySetHandle properties, const char *property,
|
||||
int count, const int *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->setPropN(property, count, const_cast<int *>(value));
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetPointer(OfxPropertySetHandle properties,
|
||||
const char *property, int index, void **value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetString(OfxPropertySetHandle properties,
|
||||
const char *property, int index, char **value)
|
||||
{
|
||||
std::any val;
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetDouble(OfxPropertySetHandle properties,
|
||||
const char *property, int index, double *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetInt(OfxPropertySetHandle properties, const char *property,
|
||||
int index, int *value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (index<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getProp(property, index, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetPointerN(OfxPropertySetHandle properties,
|
||||
const char *property, int count, void ***value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getPropN(property, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propGetStringN(OfxPropertySetHandle properties,
|
||||
const char *property, int count, char ***value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getPropN(property, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetDoubleN(OfxPropertySetHandle properties,
|
||||
const char *property, int index, int count, double** value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getPropN(property, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
|
||||
OfxStatus propSetIntN(OfxPropertySetHandle properties, const char *property,
|
||||
int index, int count, int **value)
|
||||
{
|
||||
if (properties->plugin) {
|
||||
if (count<0) {
|
||||
return kOfxStatErrBadIndex;
|
||||
}
|
||||
return properties->plugin->getPropN(property, value);
|
||||
}
|
||||
return kOfxStatErrBadHandle;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE Team
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
Reference in New Issue
Block a user