style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Oak Video Editor - 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 OAK_PLUGIN_NODES_H
|
||||
#define OAK_PLUGIN_NODES_H
|
||||
#include "ofxhImageEffectAPI.h"
|
||||
#include "ofxhPluginCache.h"
|
||||
#include "ofxImageEffect.h"
|
||||
#include "node/node.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
namespace plugin
|
||||
{
|
||||
const QString k_texture_input = QStringLiteral("tex_in");
|
||||
|
||||
class PluginNode : public olive::Node {
|
||||
public:
|
||||
PluginNode(OFX::Host::ImageEffect::Instance *plugin);
|
||||
~PluginNode() override;
|
||||
|
||||
QString name() const override;
|
||||
QString id() const override;
|
||||
QVector<CategoryID> category() const override;
|
||||
QString sub_category() const override;
|
||||
QString description() const override;
|
||||
|
||||
Node *copy() const override;
|
||||
/**
|
||||
* @brief The main processing function
|
||||
*
|
||||
* The node's main purpose is to take values from inputs to set values in outputs. For whatever subclass node you
|
||||
* create, this is where the code for that goes.
|
||||
*
|
||||
* Note that as a video editor, the node graph has to work across time. Depending on the purpose of your node, it may
|
||||
* output different values depending on the time, and even if not, it will likely be receiving different input
|
||||
* depending on the time. Most of the difficult work here is handled by NodeInput::get_value() which you should pass
|
||||
* the `time` parameter to. It will return its value (at that time, if it's keyframed), or pass the time to a
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* @brief If Value() pushes a ShaderJob, this is the function that will process them.
|
||||
*/
|
||||
virtual void process_samples(const NodeValueRow &values,
|
||||
const SampleBuffer &input, SampleBuffer &output,
|
||||
int index) const;
|
||||
|
||||
/**
|
||||
* @brief If Value() pushes a GenerateJob, override this function for the image to create
|
||||
*
|
||||
* @param frame
|
||||
*
|
||||
* The destination buffer. It will already be allocated and ready for writing to.
|
||||
*/
|
||||
virtual void generate_frame(FramePtr frame, const GenerateJob &job) const;
|
||||
|
||||
private:
|
||||
QString sub_category_;
|
||||
|
||||
public slots:
|
||||
void push_button_clicked(QString name);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //PLUGIN_H
|
||||
Reference in New Issue
Block a user