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:
@@ -26,71 +26,71 @@
|
||||
namespace olive
|
||||
{
|
||||
|
||||
const QString TimeOffsetNode::kTimeInput = QStringLiteral("time_in");
|
||||
const QString TimeOffsetNode::kInputInput = QStringLiteral("input_in");
|
||||
const QString TimeOffsetNode::k_time_input = QStringLiteral("time_in");
|
||||
const QString TimeOffsetNode::k_input_input = QStringLiteral("input_in");
|
||||
|
||||
#define super Node
|
||||
|
||||
TimeOffsetNode::TimeOffsetNode()
|
||||
{
|
||||
AddInput(kTimeInput, NodeValue::kRational, QVariant::fromValue(rational(0)),
|
||||
InputFlags(kInputFlagNotConnectable));
|
||||
SetInputProperty(kTimeInput, QStringLiteral("view"), RationalSlider::kTime);
|
||||
SetInputProperty(kTimeInput, QStringLiteral("viewlock"), true);
|
||||
add_input(k_time_input, NodeValue::k_rational, QVariant::fromValue(Rational(0)),
|
||||
InputFlags(k_input_flag_not_connectable));
|
||||
set_input_property(k_time_input, QStringLiteral("view"), RationalSlider::k_time);
|
||||
set_input_property(k_time_input, QStringLiteral("viewlock"), true);
|
||||
|
||||
AddInput(kInputInput, NodeValue::kNone,
|
||||
InputFlags(kInputFlagNotKeyframable));
|
||||
add_input(k_input_input, NodeValue::k_none,
|
||||
InputFlags(k_input_flag_not_keyframable));
|
||||
}
|
||||
|
||||
void TimeOffsetNode::Retranslate()
|
||||
void TimeOffsetNode::retranslate()
|
||||
{
|
||||
super::Retranslate();
|
||||
super::retranslate();
|
||||
|
||||
SetInputName(kTimeInput, QStringLiteral("Time"));
|
||||
SetInputName(kInputInput, QStringLiteral("Input"));
|
||||
set_input_name(k_time_input, QStringLiteral("Time"));
|
||||
set_input_name(k_input_input, QStringLiteral("Input"));
|
||||
}
|
||||
|
||||
TimeRange TimeOffsetNode::InputTimeAdjustment(const QString &input, int element,
|
||||
TimeRange TimeOffsetNode::input_time_adjustment(const QString &input, int element,
|
||||
const TimeRange &input_time,
|
||||
bool clamp) const
|
||||
{
|
||||
if (input == kInputInput) {
|
||||
return TimeRange(GetRemappedTime(input_time.in()),
|
||||
GetRemappedTime(input_time.out()));
|
||||
if (input == k_input_input) {
|
||||
return TimeRange(get_remapped_time(input_time.in()),
|
||||
get_remapped_time(input_time.out()));
|
||||
} else {
|
||||
return super::InputTimeAdjustment(input, element, input_time, clamp);
|
||||
return super::input_time_adjustment(input, element, input_time, clamp);
|
||||
}
|
||||
}
|
||||
|
||||
TimeRange
|
||||
TimeOffsetNode::OutputTimeAdjustment(const QString &input, int element,
|
||||
TimeOffsetNode::output_time_adjustment(const QString &input, int element,
|
||||
const TimeRange &input_time) const
|
||||
{
|
||||
if (input == kInputInput) {
|
||||
if (input == k_input_input) {
|
||||
// The inverse of InputTimeAdjustment(): times at the input are mapped
|
||||
// back to the output by subtracting the offset again
|
||||
return TimeRange(GetRemappedOutputTime(input_time.in()),
|
||||
GetRemappedOutputTime(input_time.out()));
|
||||
return TimeRange(get_remapped_output_time(input_time.in()),
|
||||
get_remapped_output_time(input_time.out()));
|
||||
} else {
|
||||
return super::OutputTimeAdjustment(input, element, input_time);
|
||||
return super::output_time_adjustment(input, element, input_time);
|
||||
}
|
||||
}
|
||||
|
||||
void TimeOffsetNode::Value(const NodeValueRow &value,
|
||||
void TimeOffsetNode::value(const NodeValueRow &value,
|
||||
const NodeGlobals &globals,
|
||||
NodeValueTable *table) const
|
||||
{
|
||||
table->Push(value[kInputInput]);
|
||||
table->push(value[k_input_input]);
|
||||
}
|
||||
|
||||
rational TimeOffsetNode::GetRemappedTime(const rational &input) const
|
||||
Rational TimeOffsetNode::get_remapped_time(const Rational &input) const
|
||||
{
|
||||
return input + GetValueAtTime(kTimeInput, input).value<rational>();
|
||||
return input + get_value_at_time(k_time_input, input).value<Rational>();
|
||||
}
|
||||
|
||||
rational TimeOffsetNode::GetRemappedOutputTime(const rational &input) const
|
||||
Rational TimeOffsetNode::get_remapped_output_time(const Rational &input) const
|
||||
{
|
||||
return input - GetValueAtTime(kTimeInput, input).value<rational>();
|
||||
return input - get_value_at_time(k_time_input, input).value<Rational>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user