/* * 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 . */ #ifndef OLIVE_PLUGIN_H #define OLIVE_PLUGIN_H #include "ofxCore.h" #include #include #include #include namespace olive { namespace plugin { class Value; enum class Type { FLOAT, STRING, INT, POINTER, ARRAY, NONE }; class Array { private: Type type; int strSize=0; char** strings; QVector pointers; QVector ints; QVector floats; public: Array() { type=Type::NONE; } Array(const int *data, size_t size) { this->type=Type::INT; ints.reserve(size); std::copy(data, data+size, ints.data()); } Array(const double *data, size_t size) { this->type=Type::FLOAT; floats.reserve(size); std::copy(data, data+size, floats.data()); } Array(void * const* data, size_t size) { this->type=Type::POINTER; pointers.reserve(size); std::copy(data, data+size, pointers.data()); } Array(const char * const *data, size_t size) { strings=(char**)malloc(sizeof(char *)*size); for (int i=0;itype=Type::INT; ints.clear(); ints.reserve(size); std::copy(data, data+size, ints.data()); } void setArray(double *data, size_t size) { this->type=Type::FLOAT; floats.clear(); floats.reserve(size); std::copy(data, data+size, floats.data()); } void setArray(void *const*data, size_t size) { this->type=Type::POINTER; pointers.reserve(size); pointers.clear(); std::copy(data, data+size, pointers.data()); } void setArray(const char * const *data, size_t size) { for (int i=0;istrSize;i++) { free(strings[i]); } free(strings); strings=nullptr; strings=(char**)malloc(sizeof(char *)*size); for (int i=0;i> props; std::list mems; }; } } struct OfxPropertySetStruct { olive::plugin::OlivePlugin* plugin; }; #endif //OLIVE_PLUGIN_H