format: reformatting files

This commit is contained in:
2026-07-13 15:30:43 +08:00
parent 7522543c48
commit e5eeaddf2f
511 changed files with 274803 additions and 207140 deletions
+27 -27
View File
@@ -33,31 +33,31 @@ add_subdirectory(project)
add_subdirectory(time)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/factory.cpp
node/factory.h
node/globals.cpp
node/globals.h
node/inputdragger.cpp
node/inputdragger.h
node/inputimmediate.cpp
node/inputimmediate.h
node/keyframe.cpp
node/keyframe.h
node/node.cpp
node/node.h
node/nodeundo.cpp
node/nodeundo.h
node/param.cpp
node/param.h
node/project.cpp
node/project.h
node/splitvalue.h
node/traverser.cpp
node/traverser.h
node/value.cpp
node/value.h
node/valuedatabase.cpp
node/valuedatabase.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/factory.cpp
node/factory.h
node/globals.cpp
node/globals.h
node/inputdragger.cpp
node/inputdragger.h
node/inputimmediate.cpp
node/inputimmediate.h
node/keyframe.cpp
node/keyframe.h
node/node.cpp
node/node.h
node/nodeundo.cpp
node/nodeundo.h
node/param.cpp
node/param.h
node/project.cpp
node/project.h
node/splitvalue.h
node/traverser.cpp
node/traverser.h
node/value.cpp
node/value.h
node/valuedatabase.cpp
node/valuedatabase.h
PARENT_SCOPE
)
+2 -2
View File
@@ -18,6 +18,6 @@ add_subdirectory(pan)
add_subdirectory(volume)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/audio/pan/pan.h
node/audio/pan/pan.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/audio/pan/pan.h
node/audio/pan/pan.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/audio/volume/volume.h
node/audio/volume/volume.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/audio/volume/volume.h
node/audio/volume/volume.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -20,8 +20,8 @@ add_subdirectory(subtitle)
add_subdirectory(transition)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/block.h
node/block/block.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/block.h
node/block/block.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/clip/clip.h
node/block/clip/clip.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/clip/clip.h
node/block/clip/clip.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/gap/gap.h
node/block/gap/gap.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/gap/gap.h
node/block/gap/gap.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/subtitle/subtitle.cpp
node/block/subtitle/subtitle.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/subtitle/subtitle.cpp
node/block/subtitle/subtitle.h
PARENT_SCOPE
)
+4 -4
View File
@@ -18,8 +18,8 @@ add_subdirectory(crossdissolve)
add_subdirectory(diptocolor)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/transition/transition.h
node/block/transition/transition.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/transition/transition.h
node/block/transition/transition.cpp
PARENT_SCOPE
)
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/transition/crossdissolve/crossdissolvetransition.h
node/block/transition/crossdissolve/crossdissolvetransition.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/transition/crossdissolve/crossdissolvetransition.h
node/block/transition/crossdissolve/crossdissolvetransition.cpp
PARENT_SCOPE
)
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/block/transition/diptocolor/diptocolortransition.h
node/block/transition/diptocolor/diptocolortransition.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/block/transition/diptocolor/diptocolortransition.h
node/block/transition/diptocolor/diptocolortransition.cpp
PARENT_SCOPE
)
+2 -2
View File
@@ -22,6 +22,6 @@ add_subdirectory(ociolut)
add_subdirectory(threewaycolor)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/colormanager/colormanager.cpp
node/color/colormanager/colormanager.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/colormanager/colormanager.cpp
node/color/colormanager/colormanager.h
PARENT_SCOPE
)
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/displaytransform/displaytransform.cpp
node/color/displaytransform/displaytransform.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/displaytransform/displaytransform.cpp
node/color/displaytransform/displaytransform.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/ociobase/ociobase.cpp
node/color/ociobase/ociobase.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/ociobase/ociobase.cpp
node/color/ociobase/ociobase.h
PARENT_SCOPE
)
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp
node/color/ociogradingtransformlinear/ociogradingtransformlinear.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/ociogradingtransformlinear/ociogradingtransformlinear.cpp
node/color/ociogradingtransformlinear/ociogradingtransformlinear.h
PARENT_SCOPE
)
+4 -4
View File
@@ -7,8 +7,8 @@
# (at your option) any later version.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/ociolut/ociolut.cpp
node/color/ociolut/ociolut.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/ociolut/ociolut.cpp
node/color/ociolut/ociolut.h
PARENT_SCOPE
)
+10 -8
View File
@@ -37,7 +37,8 @@ const QString OCIOLutNode::kDirectionInput = QStringLiteral("lut_dir_in");
#define super OCIOBaseNode
namespace {
namespace
{
bool IsSupportedLutExtension(const QString &suffix)
{
@@ -47,7 +48,8 @@ bool IsSupportedLutExtension(const QString &suffix)
bool IsMainProcess()
{
return qobject_cast<QApplication *>(QCoreApplication::instance()) != nullptr;
return qobject_cast<QApplication *>(QCoreApplication::instance()) !=
nullptr;
}
int ReadDirectionInput(const Node *node)
@@ -245,9 +247,8 @@ bool OCIOLutNode::CreateProcessorFromInputs() const
ColorProcessorPtr processor;
try {
const bool forward =
static_cast<ColorProcessor::Direction>(direction) ==
ColorProcessor::kNormal;
const bool forward = static_cast<ColorProcessor::Direction>(
direction) == ColorProcessor::kNormal;
qDebug() << "OCIOLutNode: creating processor for" << path
<< "direction=" << direction
<< "ocio_dir=" << (forward ? "FORWARD" : "INVERSE")
@@ -256,10 +257,11 @@ bool OCIOLutNode::CreateProcessorFromInputs() const
OCIO::FileTransformRcPtr transform = OCIO::FileTransform::Create();
transform->setSrc(path.toUtf8().constData());
transform->setInterpolation(OCIO::INTERP_LINEAR);
transform->setDirection(
forward ? OCIO::TRANSFORM_DIR_FORWARD : OCIO::TRANSFORM_DIR_INVERSE);
transform->setDirection(forward ? OCIO::TRANSFORM_DIR_FORWARD :
OCIO::TRANSFORM_DIR_INVERSE);
processor = ColorProcessor::Create(manager()->GetConfig()->getProcessor(transform));
processor = ColorProcessor::Create(
manager()->GetConfig()->getProcessor(transform));
} catch (const std::exception &e) {
qWarning() << "OCIO LUT processor error:" << e.what();
processor = nullptr;
+1 -1
View File
@@ -43,7 +43,7 @@ public:
virtual void Retranslate() override;
virtual void InputValueChangedEvent(const QString &input,
int element) override;
int element) override;
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override;
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/color/threewaycolor/threewaycolor.h
node/color/threewaycolor/threewaycolor.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/color/threewaycolor/threewaycolor.h
node/color/threewaycolor/threewaycolor.cpp
PARENT_SCOPE
)
@@ -87,8 +87,7 @@ void ThreeWayColorNode::Retranslate()
SetInputName(kHighlightsAmountInput, tr("Highlights Amount"));
}
ShaderCode
ThreeWayColorNode::GetShaderCode(const ShaderRequest &request) const
ShaderCode ThreeWayColorNode::GetShaderCode(const ShaderRequest &request) const
{
Q_UNUSED(request)
return ShaderCode(
+2 -2
View File
@@ -25,6 +25,6 @@ add_subdirectory(transform)
add_subdirectory(wave)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/cornerpin/cornerpindistortnode.cpp
node/distort/cornerpin/cornerpindistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/cornerpin/cornerpindistortnode.cpp
node/distort/cornerpin/cornerpindistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/crop/cropdistortnode.cpp
node/distort/crop/cropdistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/crop/cropdistortnode.cpp
node/distort/crop/cropdistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/flip/flipdistortnode.cpp
node/distort/flip/flipdistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/flip/flipdistortnode.cpp
node/distort/flip/flipdistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/mask/mask.cpp
node/distort/mask/mask.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/mask/mask.cpp
node/distort/mask/mask.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/ripple/rippledistortnode.cpp
node/distort/ripple/rippledistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/ripple/rippledistortnode.cpp
node/distort/ripple/rippledistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/swirl/swirldistortnode.cpp
node/distort/swirl/swirldistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/swirl/swirldistortnode.cpp
node/distort/swirl/swirldistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/tile/tiledistortnode.cpp
node/distort/tile/tiledistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/tile/tiledistortnode.cpp
node/distort/tile/tiledistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/transform/transformdistortnode.cpp
node/distort/transform/transformdistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/transform/transformdistortnode.cpp
node/distort/transform/transformdistortnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/distort/wave/wavedistortnode.cpp
node/distort/wave/wavedistortnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/distort/wave/wavedistortnode.cpp
node/distort/wave/wavedistortnode.h
PARENT_SCOPE
)
+2 -2
View File
@@ -17,6 +17,6 @@
add_subdirectory(opacity)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/effect/opacity/opacityeffect.cpp
node/effect/opacity/opacityeffect.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/effect/opacity/opacityeffect.cpp
node/effect/opacity/opacityeffect.h
PARENT_SCOPE
)
+4 -7
View File
@@ -94,7 +94,6 @@ void NodeFactory::Initialize()
}
RegisterPluginNodes();
}
void NodeFactory::Destroy()
@@ -151,8 +150,7 @@ Menu *NodeFactory::CreateMenu(QWidget *parent, bool create_none_item,
// Determine final destination (support secondary grouping)
Menu *destination = top_menu;
QString sub = n->SubCategory();
if (!sub.isEmpty() &&
n->Category().contains(Node::kCategoryOpenFX)) {
if (!sub.isEmpty() && n->Category().contains(Node::kCategoryOpenFX)) {
QList<QAction *> sub_actions = top_menu->actions();
foreach (QAction *action, sub_actions) {
if (action->menu() && action->menu()->title() == sub) {
@@ -249,16 +247,15 @@ void NodeFactory::RegisterPluginNodes()
continue;
}
const QString plugin_id = QString::fromStdString(
image_effect->getIdentifier());
const QString plugin_id =
QString::fromStdString(image_effect->getIdentifier());
if (existing_ids.contains(plugin_id)) {
continue;
}
const auto &contexts = image_effect->getContexts();
if (contexts.empty()) {
qWarning() << "Skipping OFX plugin with no contexts:"
<< plugin_id;
qWarning() << "Skipping OFX plugin with no contexts:" << plugin_id;
continue;
}
std::string context = kOfxImageEffectContextFilter;
+2 -2
View File
@@ -20,6 +20,6 @@ add_subdirectory(mosaic)
add_subdirectory(stroke)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/filter/blur/blur.h
node/filter/blur/blur.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/filter/blur/blur.h
node/filter/blur/blur.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/filter/dropshadow/dropshadowfilter.h
node/filter/dropshadow/dropshadowfilter.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/filter/dropshadow/dropshadowfilter.h
node/filter/dropshadow/dropshadowfilter.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/filter/mosaic/mosaicfilternode.h
node/filter/mosaic/mosaicfilternode.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/filter/mosaic/mosaicfilternode.h
node/filter/mosaic/mosaicfilternode.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/filter/stroke/stroke.h
node/filter/stroke/stroke.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/filter/stroke/stroke.h
node/filter/stroke/stroke.cpp
PARENT_SCOPE
)
+2 -2
View File
@@ -22,6 +22,6 @@ add_subdirectory(solid)
add_subdirectory(text)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/matrix/matrix.h
node/generator/matrix/matrix.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/matrix/matrix.h
node/generator/matrix/matrix.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/noise/noise.h
node/generator/noise/noise.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/noise/noise.h
node/generator/noise/noise.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/polygon/polygon.h
node/generator/polygon/polygon.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/polygon/polygon.h
node/generator/polygon/polygon.cpp
PARENT_SCOPE
)
+8 -8
View File
@@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/shape/generatorwithmerge.cpp
node/generator/shape/generatorwithmerge.h
node/generator/shape/shapenode.cpp
node/generator/shape/shapenode.h
node/generator/shape/shapenodebase.cpp
node/generator/shape/shapenodebase.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/shape/generatorwithmerge.cpp
node/generator/shape/generatorwithmerge.h
node/generator/shape/shapenode.cpp
node/generator/shape/shapenode.h
node/generator/shape/shapenodebase.cpp
node/generator/shape/shapenodebase.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/solid/solid.h
node/generator/solid/solid.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/solid/solid.h
node/generator/solid/solid.cpp
PARENT_SCOPE
)
+8 -8
View File
@@ -15,12 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/text/textv1.cpp
node/generator/text/textv1.h
node/generator/text/textv2.cpp
node/generator/text/textv2.h
node/generator/text/textv3.cpp
node/generator/text/textv3.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/generator/text/textv1.cpp
node/generator/text/textv1.h
node/generator/text/textv2.cpp
node/generator/text/textv2.h
node/generator/text/textv3.cpp
node/generator/text/textv3.h
PARENT_SCOPE
)
+18 -18
View File
@@ -15,22 +15,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/gizmo/draggable.cpp
node/gizmo/draggable.h
node/gizmo/gizmo.cpp
node/gizmo/gizmo.h
node/gizmo/line.cpp
node/gizmo/line.h
node/gizmo/path.cpp
node/gizmo/path.h
node/gizmo/point.cpp
node/gizmo/point.h
node/gizmo/polygon.cpp
node/gizmo/polygon.h
node/gizmo/screen.cpp
node/gizmo/screen.h
node/gizmo/text.cpp
node/gizmo/text.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/gizmo/draggable.cpp
node/gizmo/draggable.h
node/gizmo/gizmo.cpp
node/gizmo/gizmo.h
node/gizmo/line.cpp
node/gizmo/line.h
node/gizmo/path.cpp
node/gizmo/path.h
node/gizmo/point.cpp
node/gizmo/point.h
node/gizmo/polygon.cpp
node/gizmo/polygon.h
node/gizmo/screen.cpp
node/gizmo/screen.h
node/gizmo/text.cpp
node/gizmo/text.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/group/group.cpp
node/group/group.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/group/group.cpp
node/group/group.h
PARENT_SCOPE
)
+2 -2
View File
@@ -19,6 +19,6 @@ add_subdirectory(time)
add_subdirectory(value)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/multicam/multicamnode.h
node/input/multicam/multicamnode.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/input/multicam/multicamnode.h
node/input/multicam/multicamnode.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/time/timeinput.h
node/input/time/timeinput.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/input/time/timeinput.h
node/input/time/timeinput.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/value/valuenode.h
node/input/value/valuenode.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/input/value/valuenode.h
node/input/value/valuenode.cpp
PARENT_SCOPE
)
+2 -2
View File
@@ -19,6 +19,6 @@ add_subdirectory(colordifferencekey)
add_subdirectory(despill)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/keying/chromakey/chromakey.h
node/keying/chromakey/chromakey.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/keying/chromakey/chromakey.h
node/keying/chromakey/chromakey.cpp
PARENT_SCOPE
)
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/keying/colordifferencekey/colordifferencekey.h
node/keying/colordifferencekey/colordifferencekey.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/keying/colordifferencekey/colordifferencekey.h
node/keying/colordifferencekey/colordifferencekey.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/keying/despill/despill.h
node/keying/despill/despill.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/keying/despill/despill.h
node/keying/despill/despill.cpp
PARENT_SCOPE
)
+2 -2
View File
@@ -19,6 +19,6 @@ add_subdirectory(merge)
add_subdirectory(trigonometry)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+6 -6
View File
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/math/math/math.h
node/math/math/math.cpp
node/math/math/mathbase.h
node/math/math/mathbase.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/math/math/math.h
node/math/math/math.cpp
node/math/math/mathbase.h
node/math/math/mathbase.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/math/merge/merge.h
node/math/merge/merge.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/math/merge/merge.h
node/math/merge/merge.cpp
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/math/trigonometry/trigonometry.h
node/math/trigonometry/trigonometry.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/math/trigonometry/trigonometry.h
node/math/trigonometry/trigonometry.cpp
PARENT_SCOPE
)
+9 -6
View File
@@ -182,7 +182,10 @@ public:
* @brief Return a sub-category string for secondary grouping
* within the primary category (e.g. "Filter" under "OpenFX").
*/
virtual QString SubCategory() const { return QString(); }
virtual QString SubCategory() const
{
return QString();
}
/**
* @brief Return a description of this node's purpose (optional for subclassing, but recommended)
@@ -1136,20 +1139,20 @@ public:
static const QString kEnabledInput;
OFX::Host::ImageEffect::Instance* getPluginInstance() const
OFX::Host::ImageEffect::Instance *getPluginInstance() const
{
return plugin_instance_;
}
OFX::Host::ImageEffect::ImageEffectPlugin* getPlugin() const
OFX::Host::ImageEffect::ImageEffectPlugin *getPlugin() const
{
return plugin_instance_ ? plugin_instance_->getPlugin() : nullptr;
}
protected:
// If set, this node owns a plugin instance.
OFX::Host::ImageEffect::Instance* plugin_instance_ = nullptr;
OFX::Host::ImageEffect::Instance *plugin_instance_ = nullptr;
void setPluginInstance(OFX::Host::ImageEffect::Instance* instance)
void setPluginInstance(OFX::Host::ImageEffect::Instance *instance)
{
plugin_instance_ = instance;
}
+2 -2
View File
@@ -18,6 +18,6 @@ add_subdirectory(track)
add_subdirectory(viewer)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+6 -6
View File
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/output/track/track.cpp
node/output/track/track.h
node/output/track/tracklist.cpp
node/output/track/tracklist.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/output/track/track.cpp
node/output/track/track.h
node/output/track/tracklist.cpp
node/output/track/tracklist.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/output/viewer/viewer.h
node/output/viewer/viewer.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/output/viewer/viewer.h
node/output/viewer/viewer.cpp
PARENT_SCOPE
)
+6 -6
View File
@@ -581,12 +581,12 @@ void ViewerOutput::set_parameters_from_footage(
found_video_params = true;
}
SetVideoParams(VideoParams(
s.width(), s.height(), using_timebase,
static_cast<PixelFormat::Format>(
OLIVE_CONFIG("OfflinePixelFormat").toInt()),
VideoParams::kInternalChannelCount, s.pixel_aspect_ratio(),
s.interlacing(), 1));
SetVideoParams(
VideoParams(s.width(), s.height(), using_timebase,
static_cast<PixelFormat::Format>(
OLIVE_CONFIG("OfflinePixelFormat").toInt()),
VideoParams::kInternalChannelCount,
s.pixel_aspect_ratio(), s.interlacing(), 1));
if (found_video_params) {
break;
+92 -118
View File
@@ -32,7 +32,8 @@
#include <QVector2D>
#include <QVector3D>
namespace {
namespace
{
QHash<QString, QHash<QString, QVariant>> g_plugin_param_defaults;
static bool IsNormalisedCoordSystem(const OFX::Host::Param::Base *param)
@@ -61,8 +62,7 @@ QVariant DefaultValueForParam(const OFX::Host::Param::Base *param)
const std::string &ofxType = param->getType();
const auto &props = param->getProperties();
if (ofxType == kOfxParamTypeInteger ||
ofxType == kOfxParamTypeChoice) {
if (ofxType == kOfxParamTypeInteger || ofxType == kOfxParamTypeChoice) {
return props.getIntProperty(kOfxParamPropDefault);
}
if (ofxType == kOfxParamTypeBoolean) {
@@ -77,34 +77,30 @@ QVariant DefaultValueForParam(const OFX::Host::Param::Base *param)
}
return val;
}
if (ofxType == kOfxParamTypeString ||
ofxType == kOfxParamTypeStrChoice ||
if (ofxType == kOfxParamTypeString || ofxType == kOfxParamTypeStrChoice ||
ofxType == kOfxParamTypeCustom) {
return QString::fromStdString(
props.getStringProperty(kOfxParamPropDefault));
}
if (ofxType == kOfxParamTypeRGB ||
ofxType == kOfxParamTypeRGBA) {
if (ofxType == kOfxParamTypeRGB || ofxType == kOfxParamTypeRGBA) {
const int count = (ofxType == kOfxParamTypeRGBA) ? 4 : 3;
double values[4] = {0.0, 0.0, 0.0, 1.0};
double values[4] = { 0.0, 0.0, 0.0, 1.0 };
props.getDoublePropertyN(kOfxParamPropDefault, values, count);
const double alpha = (count == 4) ? values[3] : 1.0;
return QVariant::fromValue(
olive::core::Color(values[0], values[1], values[2], alpha));
}
if (ofxType == kOfxParamTypeDouble2D ||
ofxType == kOfxParamTypeDouble3D ||
if (ofxType == kOfxParamTypeDouble2D || ofxType == kOfxParamTypeDouble3D ||
ofxType == kOfxParamTypeInteger2D ||
ofxType == kOfxParamTypeInteger3D) {
const bool is_double =
(ofxType == kOfxParamTypeDouble2D ||
ofxType == kOfxParamTypeDouble3D);
const bool is_double = (ofxType == kOfxParamTypeDouble2D ||
ofxType == kOfxParamTypeDouble3D);
const int count = (ofxType == kOfxParamTypeDouble2D ||
ofxType == kOfxParamTypeInteger2D)
? 2
: 3;
ofxType == kOfxParamTypeInteger2D) ?
2 :
3;
if (is_double) {
double values[3] = {0.0, 0.0, 0.0};
double values[3] = { 0.0, 0.0, 0.0 };
props.getDoublePropertyN(kOfxParamPropDefault, values, count);
if (IsNormalisedCoordSystem(param)) {
double xSize, ySize;
@@ -120,7 +116,7 @@ QVariant DefaultValueForParam(const OFX::Host::Param::Base *param)
}
return QVector3D(values[0], values[1], values[2]);
}
int values[3] = {0, 0, 0};
int values[3] = { 0, 0, 0 };
props.getIntPropertyN(kOfxParamPropDefault, values, count);
if (count == 2) {
return QVector2D(values[0], values[1]);
@@ -156,8 +152,7 @@ QString DeduceColorSemantic(const OFX::Host::Param::Base *param,
// Rule 1: explicit color keywords → color
static const QStringList kColorKeywords = {
QStringLiteral("color"), QStringLiteral("colour"),
QStringLiteral("fill"), QStringLiteral("tint"),
QStringLiteral("key")
QStringLiteral("fill"), QStringLiteral("tint"), QStringLiteral("key")
};
for (const QString &kw : kColorKeywords) {
if (label.contains(kw) || hint.contains(kw) || name.contains(kw)) {
@@ -167,11 +162,11 @@ QString DeduceColorSemantic(const OFX::Host::Param::Base *param,
// Rule 2: explicit scalar/adjustment keywords → scalar
static const QStringList kScalarKeywords = {
QStringLiteral("gamma"), QStringLiteral("contrast"),
QStringLiteral("gain"), QStringLiteral("offset"),
QStringLiteral("gamma"), QStringLiteral("contrast"),
QStringLiteral("gain"), QStringLiteral("offset"),
QStringLiteral("saturation"), QStringLiteral("exposure"),
QStringLiteral("brightness"), QStringLiteral("lift"),
QStringLiteral("multiply"), QStringLiteral("scale"),
QStringLiteral("multiply"), QStringLiteral("scale"),
QStringLiteral("pivot")
};
for (const QString &kw : kScalarKeywords) {
@@ -183,8 +178,8 @@ QString DeduceColorSemantic(const OFX::Host::Param::Base *param,
// Rule 3: display range significantly outside/asymmetric to [0,1] → scalar
const auto &props = param->getProperties();
const int dim = (ofxType == kOfxParamTypeRGBA) ? 4 : 3;
double dmin[4] = {0, 0, 0, 0};
double dmax[4] = {1, 1, 1, 1};
double dmin[4] = { 0, 0, 0, 0 };
double dmax[4] = { 1, 1, 1, 1 };
props.getDoublePropertyN(kOfxParamPropDisplayMin, dmin, dim);
props.getDoublePropertyN(kOfxParamPropDisplayMax, dmax, dim);
bool range_looks_scalar = false;
@@ -199,7 +194,7 @@ QString DeduceColorSemantic(const OFX::Host::Param::Base *param,
}
// Rule 4: default values all equal → scalar (lean)
double defs[4] = {0, 0, 0, 1};
double defs[4] = { 0, 0, 0, 1 };
props.getDoublePropertyN(kOfxParamPropDefault, defs, dim);
bool all_equal = true;
for (int i = 1; i < dim; ++i) {
@@ -227,14 +222,13 @@ QString DeduceColorSemantic(const OFX::Host::Param::Base *param,
return QStringLiteral("color");
}
QHash<QString, QVariant>
BuildDefaultValues(const std::map<std::string, OFX::Host::Param::Instance *> &params)
QHash<QString, QVariant> BuildDefaultValues(
const std::map<std::string, OFX::Host::Param::Instance *> &params)
{
QHash<QString, QVariant> defaults;
for (const auto &param : params) {
const std::string &ofxType = param.second->getType();
if (ofxType == kOfxParamTypeGroup ||
ofxType == kOfxParamTypePage ||
if (ofxType == kOfxParamTypeGroup || ofxType == kOfxParamTypePage ||
ofxType == kOfxParamTypePushButton) {
continue;
}
@@ -254,8 +248,9 @@ BuildDefaultValues(const std::map<std::string, OFX::Host::Param::Instance *> &pa
return defaults;
}
}
static QString ClipLabelForName(const std::string &name,
const OFX::Host::ImageEffect::ClipDescriptor *desc)
static QString
ClipLabelForName(const std::string &name,
const OFX::Host::ImageEffect::ClipDescriptor *desc)
{
if (name == kOfxImageEffectSimpleSourceClipName) {
return olive::plugin::PluginNode::tr("Source");
@@ -278,10 +273,9 @@ static QString ClipLabelForName(const std::string &name,
return QString::fromStdString(name);
}
olive::plugin::PluginNode::PluginNode(
OFX::Host::ImageEffect::Instance *plugin)
olive::plugin::PluginNode::PluginNode(OFX::Host::ImageEffect::Instance *plugin)
{
plugin_instance_=plugin;
plugin_instance_ = plugin;
const std::string &ctx = plugin_instance_->getContext();
if (ctx == kOfxImageEffectContextFilter) {
@@ -299,16 +293,16 @@ olive::plugin::PluginNode::PluginNode(
QHash<QString, QString> page_labels;
QHash<QString, QString> page_for_param;
auto params=plugin_instance_->getParams();
const QString plugin_id = QString::fromStdString(
plugin_instance_->getPlugin()->getIdentifier());
auto params = plugin_instance_->getParams();
const QString plugin_id =
QString::fromStdString(plugin_instance_->getPlugin()->getIdentifier());
auto defaults_iter = g_plugin_param_defaults.find(plugin_id);
if (defaults_iter == g_plugin_param_defaults.end()) {
g_plugin_param_defaults.insert(plugin_id, BuildDefaultValues(params));
defaults_iter = g_plugin_param_defaults.find(plugin_id);
}
const QHash<QString, QVariant> &defaults = defaults_iter.value();
for (auto param: params) {
for (auto param : params) {
const std::string &ofxType = param.second->getType();
if (ofxType == kOfxParamTypeGroup) {
const QString name = QString::fromStdString(param.first);
@@ -336,8 +330,7 @@ olive::plugin::PluginNode::PluginNode(
}
}
for (auto param: params) {
for (auto param : params) {
NodeValue::Type type = NodeValue::kNone;
const std::string &ofxType = param.second->getType();
@@ -355,26 +348,27 @@ olive::plugin::PluginNode::PluginNode(
} else if (ofxType == kOfxParamTypeChoice) {
type = NodeValue::kCombo;
} else if (ofxType == kOfxParamTypeDouble2D ||
ofxType == kOfxParamTypeInteger2D){
type = NodeValue::kVec2;}
else if (ofxType == kOfxParamTypeDouble3D ||
ofxType == kOfxParamTypeInteger3D){
ofxType == kOfxParamTypeInteger2D) {
type = NodeValue::kVec2;
} else if (ofxType == kOfxParamTypeDouble3D ||
ofxType == kOfxParamTypeInteger3D) {
type = NodeValue::kVec3;
} else if (ofxType == kOfxParamTypeStrChoice){
} else if (ofxType == kOfxParamTypeStrChoice) {
type = NodeValue::kStrCombo;
}else if (ofxType == kOfxParamTypeBytes
|| ofxType == kOfxParamTypeCustom) {
} else if (ofxType == kOfxParamTypeBytes ||
ofxType == kOfxParamTypeCustom) {
type = NodeValue::kBinary;
} else if (ofxType == kOfxParamTypePushButton) {
type = NodeValue::kPushButton;
} else if (ofxType == kOfxParamTypeGroup ||
ofxType == kOfxParamTypePage) {
continue;
}else {
} else {
type = NodeValue::kNone;
}
const QString input_id = QString::fromStdString(param.second->getName());
const QString input_id =
QString::fromStdString(param.second->getName());
if (input_id.isEmpty()) {
continue;
}
@@ -395,8 +389,7 @@ olive::plugin::PluginNode::PluginNode(
if (is_secret) {
SetInputFlag(input_id, kInputFlagHidden);
}
const QString label =
QString::fromStdString(param.second->getLabel());
const QString label = QString::fromStdString(param.second->getLabel());
if (!label.isEmpty()) {
SetInputName(input_id, label);
} else {
@@ -413,33 +406,22 @@ olive::plugin::PluginNode::PluginNode(
page_for_param.value(input_id));
}
if (type == NodeValue::kColor) {
QString semantic =
DeduceColorSemantic(param.second, group_labels);
SetInputProperty(input_id,
QStringLiteral("color_semantic"),
QString semantic = DeduceColorSemantic(param.second, group_labels);
SetInputProperty(input_id, QStringLiteral("color_semantic"),
semantic);
const int dim =
(ofxType == kOfxParamTypeRGBA) ? 4 : 3;
double dmin[4] = {0, 0, 0, 0};
double dmax[4] = {1, 1, 1, 1};
props.getDoublePropertyN(kOfxParamPropDisplayMin,
dmin, dim);
props.getDoublePropertyN(kOfxParamPropDisplayMax,
dmax, dim);
SetInputProperty(input_id,
QStringLiteral("min"),
dmin[0]);
SetInputProperty(input_id,
QStringLiteral("max"),
dmax[0]);
const int dim = (ofxType == kOfxParamTypeRGBA) ? 4 : 3;
double dmin[4] = { 0, 0, 0, 0 };
double dmax[4] = { 1, 1, 1, 1 };
props.getDoublePropertyN(kOfxParamPropDisplayMin, dmin, dim);
props.getDoublePropertyN(kOfxParamPropDisplayMax, dmax, dim);
SetInputProperty(input_id, QStringLiteral("min"), dmin[0]);
SetInputProperty(input_id, QStringLiteral("max"), dmax[0]);
const QString hint = QString::fromStdString(
param.second->getHint());
const QString hint =
QString::fromStdString(param.second->getHint());
if (!hint.isEmpty()) {
SetInputProperty(input_id,
QStringLiteral("tooltip"),
hint);
SetInputProperty(input_id, QStringLiteral("tooltip"), hint);
}
}
if (type == NodeValue::kCombo || type == NodeValue::kStrCombo) {
@@ -447,8 +429,7 @@ olive::plugin::PluginNode::PluginNode(
QStringList option_values;
const int label_count =
props.getDimension(kOfxParamPropChoiceOption);
const int value_count =
props.getDimension(kOfxParamPropChoiceEnum);
const int value_count = props.getDimension(kOfxParamPropChoiceEnum);
for (int i = 0; i < label_count; ++i) {
const std::string &label =
@@ -478,15 +459,13 @@ olive::plugin::PluginNode::PluginNode(
indices[i] = i;
}
std::stable_sort(indices.begin(), indices.end(),
[&](int a, int b) {
return props.getIntProperty(
kOfxParamPropChoiceOrder,
a) <
props.getIntProperty(
kOfxParamPropChoiceOrder,
b);
});
std::stable_sort(
indices.begin(), indices.end(), [&](int a, int b) {
return props.getIntProperty(kOfxParamPropChoiceOrder,
a) <
props.getIntProperty(kOfxParamPropChoiceOrder,
b);
});
QStringList ordered_labels;
QStringList ordered_values;
@@ -519,7 +498,6 @@ olive::plugin::PluginNode::PluginNode(
SetInputName(input_id, ClipLabelForName(entry.first, entry.second));
has_texture_input = true;
}
const QString source_id =
QString::fromUtf8(kOfxImageEffectSimpleSourceClipName);
@@ -527,8 +505,7 @@ olive::plugin::PluginNode::PluginNode(
SetEffectInput(source_id);
} else if (HasInputWithID(kTextureInput)) {
SetEffectInput(kTextureInput);
}
else {
} else {
if (has_texture_input) {
AddInput(kTextureInput, NodeValue::kTexture);
SetInputName(kTextureInput, tr("Texture"));
@@ -545,7 +522,6 @@ QString olive::plugin::PluginNode::Name() const
.getProps()
.getStringProperty(kOfxPropLabel)
.data();
}
QVector<olive::Node::CategoryID> olive::plugin::PluginNode::Category() const
@@ -565,7 +541,6 @@ QString olive::plugin::PluginNode::Description() const
.getProps()
.getStringProperty(kOfxPropPluginDescription)
.data();
}
void olive::plugin::PluginNode::ProcessSamples(const NodeValueRow &values,
const SampleBuffer &input,
@@ -655,7 +630,7 @@ void olive::plugin::PluginNode::Value(const NodeValueRow &value,
}
if (tex && plugin_instance_) {
PluginJob job(plugin_instance_, this, value, globals.time().in());
table->Push(NodeValue::kTexture, tex->toJob(job), this);
}
}
@@ -669,30 +644,29 @@ QString olive::plugin::PluginNode::id() const
return plugin->getIdentifier().data();
}
olive::Node *olive::plugin::PluginNode::copy() const
{
if (!plugin_instance_) {
return nullptr;
}
const auto &contexts = plugin_instance_->getPlugin()->getContexts();
std::string context = kOfxImageEffectContextFilter;
if (!contexts.empty() &&
contexts.find(kOfxImageEffectContextFilter) == contexts.end()) {
context = *contexts.begin();
}
auto *instance =
plugin_instance_->getPlugin()->createInstance(context, nullptr);
if (!instance) {
return nullptr;
}
auto *node = new PluginNode(instance);
if (auto *olive_instance =
dynamic_cast<OlivePluginInstance *>(instance)) {
olive_instance->setNode(
std::shared_ptr<PluginNode>(node, [](PluginNode *) {}));
}
return node;
olive::Node *olive::plugin::PluginNode::copy() const
{
if (!plugin_instance_) {
return nullptr;
}
const auto &contexts = plugin_instance_->getPlugin()->getContexts();
std::string context = kOfxImageEffectContextFilter;
if (!contexts.empty() &&
contexts.find(kOfxImageEffectContextFilter) == contexts.end()) {
context = *contexts.begin();
}
auto *instance =
plugin_instance_->getPlugin()->createInstance(context, nullptr);
if (!instance) {
return nullptr;
}
auto *node = new PluginNode(instance);
if (auto *olive_instance = dynamic_cast<OlivePluginInstance *>(instance)) {
olive_instance->setNode(
std::shared_ptr<PluginNode>(node, [](PluginNode *) {}));
}
return node;
}
+4 -7
View File
@@ -29,12 +29,11 @@ namespace plugin
{
const QString kTextureInput = QStringLiteral("tex_in");
class PluginNode : public olive::Node{
class PluginNode : public olive::Node {
public:
PluginNode(OFX::Host::ImageEffect::Instance* plugin) ;
PluginNode(OFX::Host::ImageEffect::Instance *plugin);
~PluginNode() override;
QString Name() const override;
QString id() const override;
QVector<CategoryID> Category() const override;
@@ -58,8 +57,8 @@ public:
* corresponding output if it's connected to one. If your node doesn't directly deal with time, the default behavior
* of the NodeParam objects will handle everything related to it automatically.
*/
void Value(const NodeValueRow &value,
const NodeGlobals &globals, NodeValueTable *table) const override;
void Value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override;
/**
* @brief If Value() pushes a ShaderJob, this is the function that will process them.
@@ -82,11 +81,9 @@ private:
public slots:
void pushButtonClicked(QString name);
};
}
}
#endif //PLUGIN_H
+10 -12
View File
@@ -121,9 +121,8 @@ SerializedData Project::Load(QXmlStreamReader *reader)
}
}
const QString path = bundle_path.isEmpty()
? file_path
: bundle_path;
const QString path = bundle_path.isEmpty() ? file_path :
bundle_path;
if (!path.isEmpty()) {
plugin_paths.insert(path);
}
@@ -239,19 +238,18 @@ void Project::Save(QXmlStreamWriter *writer) const
}
const QString key = QStringLiteral("%1|%2|%3|%4|%5")
.arg(QString::fromStdString(id))
.arg(major)
.arg(minor)
.arg(bundle_path)
.arg(file_path);
.arg(QString::fromStdString(id))
.arg(major)
.arg(minor)
.arg(bundle_path)
.arg(file_path);
if (seen.contains(key)) {
continue;
}
seen.insert(key);
QMap<QString, QString> attrs;
attrs.insert(QStringLiteral("id"),
QString::fromStdString(id));
attrs.insert(QStringLiteral("id"), QString::fromStdString(id));
attrs.insert(QStringLiteral("major"), QString::number(major));
attrs.insert(QStringLiteral("minor"), QString::number(minor));
if (!bundle_path.isEmpty()) {
@@ -269,8 +267,8 @@ void Project::Save(QXmlStreamWriter *writer) const
writer->writeStartElement(QStringLiteral("plugins"));
for (const auto &entry : plugins_to_save) {
writer->writeStartElement(QStringLiteral("plugin"));
for (auto it = entry.second.cbegin();
it != entry.second.cend(); ++it) {
for (auto it = entry.second.cbegin(); it != entry.second.cend();
++it) {
writer->writeAttribute(it.key(), it.value());
}
writer->writeEndElement();
+2 -2
View File
@@ -20,6 +20,6 @@ add_subdirectory(sequence)
add_subdirectory(serializer)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -16,8 +16,8 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/project/folder/folder.h
node/project/folder/folder.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/project/folder/folder.h
node/project/folder/folder.cpp
PARENT_SCOPE
)
+6 -6
View File
@@ -16,10 +16,10 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/project/footage/footage.cpp
node/project/footage/footage.h
node/project/footage/footagedescription.cpp
node/project/footage/footagedescription.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/project/footage/footage.cpp
node/project/footage/footage.h
node/project/footage/footagedescription.cpp
node/project/footage/footagedescription.h
PARENT_SCOPE
)
+5 -9
View File
@@ -242,11 +242,8 @@ void Footage::set_proxy_enabled(bool enabled)
}
}
void Footage::SetProxy(const QString &path,
ProxyManager::ProxyState state,
int video_stream_index,
int preset_version,
bool enabled)
void Footage::SetProxy(const QString &path, ProxyManager::ProxyState state,
int video_stream_index, int preset_version, bool enabled)
{
qDebug() << "Footage::SetProxy:" << filename() << "enabled=" << enabled
<< "state=" << ProxyManager::ProxyStateToString(state)
@@ -598,11 +595,10 @@ void Footage::SaveCustom(QXmlStreamWriter *writer) const
if (!proxy_path_.isEmpty() || proxy_enabled_) {
writer->writeStartElement(QStringLiteral("proxy"));
writer->writeAttribute(QStringLiteral("enabled"),
proxy_enabled_ ? QStringLiteral("1")
: QStringLiteral("0"));
proxy_enabled_ ? QStringLiteral("1") :
QStringLiteral("0"));
writer->writeAttribute(QStringLiteral("state"),
ProxyManager::ProxyStateToString(
proxy_state_));
ProxyManager::ProxyStateToString(proxy_state_));
writer->writeAttribute(QStringLiteral("stream"),
QString::number(proxy_video_stream_index_));
writer->writeAttribute(QStringLiteral("preset"),
+2 -5
View File
@@ -200,11 +200,8 @@ public:
return proxy_state_;
}
void SetProxy(const QString &path,
ProxyManager::ProxyState state,
int video_stream_index,
int preset_version,
bool enabled);
void SetProxy(const QString &path, ProxyManager::ProxyState state,
int video_stream_index, int preset_version, bool enabled);
void ClearProxy();
@@ -78,10 +78,9 @@ bool FootageDescription::Load(const QString &filename)
const QStringList split =
reader.readElementText().split('/');
if (split.size() == 2) {
SetSourceStartTime(
rational(split.at(0).toInt(),
split.at(1).toInt()),
source);
SetSourceStartTime(rational(split.at(0).toInt(),
split.at(1).toInt()),
source);
}
} else if (reader.name() == QStringLiteral("streams")) {
{
+4 -4
View File
@@ -16,8 +16,8 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/project/sequence/sequence.h
node/project/sequence/sequence.cpp
PARENT_SCOPE
${OLIVE_SOURCES}
node/project/sequence/sequence.h
node/project/sequence/sequence.cpp
PARENT_SCOPE
)
+18 -18
View File
@@ -16,25 +16,25 @@
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/project/serializer/serializer.cpp
node/project/serializer/serializer.h
node/project/serializer/serializer190219.cpp
node/project/serializer/serializer190219.h
node/project/serializer/serializer210528.cpp
node/project/serializer/serializer210528.h
node/project/serializer/serializer210907.cpp
node/project/serializer/serializer210907.h
node/project/serializer/serializer211228.cpp
node/project/serializer/serializer211228.h
node/project/serializer/serializer220403.cpp
node/project/serializer/serializer220403.h
node/project/serializer/serializer230220.cpp
node/project/serializer/serializer230220.h
${OLIVE_SOURCES}
node/project/serializer/serializer.cpp
node/project/serializer/serializer.h
node/project/serializer/serializer190219.cpp
node/project/serializer/serializer190219.h
node/project/serializer/serializer210528.cpp
node/project/serializer/serializer210528.h
node/project/serializer/serializer210907.cpp
node/project/serializer/serializer210907.h
node/project/serializer/serializer211228.cpp
node/project/serializer/serializer211228.h
node/project/serializer/serializer220403.cpp
node/project/serializer/serializer220403.h
node/project/serializer/serializer230220.cpp
node/project/serializer/serializer230220.h
node/project/serializer/typeserializer.cpp
node/project/serializer/typeserializer.h
node/project/serializer/typeserializer.cpp
node/project/serializer/typeserializer.h
PARENT_SCOPE
PARENT_SCOPE
)
+1 -1
View File
@@ -98,7 +98,7 @@ ProjectSerializer::Result ProjectSerializer::Load(Project *project,
} else {
Result r(kFileError);
r.SetDetails(QStringLiteral("Unable to open '%1': %2")
.arg(filename, project_file.errorString()));
.arg(filename, project_file.errorString()));
return r;
}
}
+2 -2
View File
@@ -19,6 +19,6 @@ add_subdirectory(timeoffset)
add_subdirectory(timeremap)
set(OLIVE_SOURCES
${OLIVE_SOURCES}
PARENT_SCOPE
${OLIVE_SOURCES}
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/time/timeformat/timeformat.cpp
node/time/timeformat/timeformat.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/time/timeformat/timeformat.cpp
node/time/timeformat/timeformat.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/time/timeoffset/timeoffsetnode.cpp
node/time/timeoffset/timeoffsetnode.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/time/timeoffset/timeoffsetnode.cpp
node/time/timeoffset/timeoffsetnode.h
PARENT_SCOPE
)
+4 -4
View File
@@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/time/timeremap/timeremap.cpp
node/time/timeremap/timeremap.h
PARENT_SCOPE
${OLIVE_SOURCES}
node/time/timeremap/timeremap.cpp
node/time/timeremap/timeremap.h
PARENT_SCOPE
)
+5 -4
View File
@@ -502,19 +502,20 @@ void NodeTraverser::ResolveJobs(NodeValue &val)
}
val.set_value(tex);
}
else if (plugin::PluginJob* plugin_job=dynamic_cast<plugin::PluginJob*>(base_job)) {
} else if (plugin::PluginJob *plugin_job =
dynamic_cast<plugin::PluginJob *>(
base_job)) {
VideoParams tex_params = job_tex->params();
// Force internal working format (F32) for plugin processing,
// matching FootageJob/GenerateJob behavior.
tex_params.set_format(GetCacheVideoParams().format());
tex_params.set_channel_count(VideoParams::kRGBAChannelCount);
tex_params.set_channel_count(
VideoParams::kRGBAChannelCount);
TexturePtr tex = CreateTexture(tex_params);
ProcessPluginJob(job_tex, tex, val.source());
val.set_value(tex);
}
// Cache resolved value
+3 -1
View File
@@ -147,7 +147,9 @@ protected:
return SampleBuffer();
}
virtual TexturePtr ProcessPluginJob(TexturePtr texture, TexturePtr destination, const Node *node);
virtual TexturePtr ProcessPluginJob(TexturePtr texture,
TexturePtr destination,
const Node *node);
SampleBuffer CreateSampleBuffer(const AudioParams &params,
const rational &length)
{