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:
2026-07-19 16:10:54 +08:00
parent cb1718a103
commit bb40b4923e
1014 changed files with 44257 additions and 44220 deletions
+55 -55
View File
@@ -19,8 +19,8 @@
***/
#ifndef CLIPBLOCK_H
#define CLIPBLOCK_H
#ifndef OAK_CLIPBLOCK_H
#define OAK_CLIPBLOCK_H
#include "audio/audiovisualwaveform.h"
#include "codec/decoder.h"
@@ -43,80 +43,80 @@ public:
NODE_DEFAULT_FUNCTIONS(ClipBlock)
virtual QString Name() const override;
virtual QString name() const override;
virtual QString id() const override;
virtual QString Description() const override;
virtual QString description() const override;
virtual void set_length_and_media_out(const rational &length) override;
virtual void set_length_and_media_in(const rational &length) override;
virtual void set_length_and_media_out(const Rational &length) override;
virtual void set_length_and_media_in(const Rational &length) override;
Track::Type GetTrackType() const
Track::Type get_track_type() const
{
if (track()) {
return track()->type();
} else {
return Track::kNone;
return Track::k_none;
}
}
virtual Node::ValueHint
GetValueHintForInput(const QString &input, int element = -1) const override;
get_value_hint_for_input(const QString &input, int element = -1) const override;
rational media_in() const;
void set_media_in(const rational &media_in);
Rational media_in() const;
void set_media_in(const Rational &media_in);
bool IsAutocaching() const
bool is_autocaching() const
{
return GetStandardValue(kAutoCacheInput).toBool();
return get_standard_value(k_auto_cache_input).toBool();
}
void SetAutocache(bool e);
void set_autocache(bool e);
void DiscardCache();
void discard_cache();
virtual void InvalidateCache(const TimeRange &range, const QString &from,
virtual void invalidate_cache(const TimeRange &range, const QString &from,
int element,
InvalidateCacheOptions options) override;
virtual TimeRange InputTimeAdjustment(const QString &input, int element,
virtual TimeRange input_time_adjustment(const QString &input, int element,
const TimeRange &input_time,
bool clamp) const override;
virtual TimeRange
OutputTimeAdjustment(const QString &input, int element,
output_time_adjustment(const QString &input, int element,
const TimeRange &input_time) const override;
virtual void Value(const NodeValueRow &value, const NodeGlobals &globals,
virtual void value(const NodeValueRow &value, const NodeGlobals &globals,
NodeValueTable *table) const override;
virtual void Retranslate() override;
virtual void retranslate() override;
void
RequestInvalidatedFromConnected(bool force_all = false,
request_invalidated_from_connected(bool force_all = false,
const TimeRange &intersect = TimeRange());
double speed() const
{
return GetStandardValue(kSpeedInput).toDouble();
return get_standard_value(k_speed_input).toDouble();
}
bool reverse() const
{
return GetStandardValue(kReverseInput).toBool();
return get_standard_value(k_reverse_input).toBool();
}
void set_reverse(bool e)
{
SetStandardValue(kReverseInput, e);
set_standard_value(k_reverse_input, e);
}
bool maintain_audio_pitch() const
{
return GetStandardValue(kMaintainAudioPitchInput).toBool();
return get_standard_value(k_maintain_audio_pitch_input).toBool();
}
void set_maintain_audio_pitch(bool e)
{
SetStandardValue(kMaintainAudioPitchInput, e);
set_standard_value(k_maintain_audio_pitch_input, e);
}
TransitionBlock *in_transition()
@@ -146,7 +146,7 @@ public:
FrameHashCache *connected_video_cache() const
{
if (Node *n = GetConnectedOutput(kBufferIn)) {
if (Node *n = get_connected_output(k_buffer_in)) {
return n->video_frame_cache();
} else {
return nullptr;
@@ -155,7 +155,7 @@ public:
AudioPlaybackCache *connected_audio_cache() const
{
if (Node *n = GetConnectedOutput(kBufferIn)) {
if (Node *n = get_connected_output(k_buffer_in)) {
return n->audio_playback_cache();
} else {
return nullptr;
@@ -164,7 +164,7 @@ public:
FrameHashCache *thumbnails()
{
if (Node *n = GetConnectedOutput(kBufferIn)) {
if (Node *n = get_connected_output(k_buffer_in)) {
return n->thumbnail_cache();
} else {
return nullptr;
@@ -173,26 +173,26 @@ public:
AudioWaveformCache *waveform()
{
if (Node *n = GetConnectedOutput(kBufferIn)) {
if (Node *n = get_connected_output(k_buffer_in)) {
return n->waveform_cache();
} else {
return nullptr;
}
}
void AddCachePassthroughFrom(ClipBlock *other);
void add_cache_passthrough_from(ClipBlock *other);
ViewerOutput *connected_viewer() const
{
return connected_viewer_;
}
virtual TimeRange GetVideoCacheRange() const override
virtual TimeRange get_video_cache_range() const override
{
return TimeRange(0, length());
}
virtual TimeRange GetAudioCacheRange() const override
virtual TimeRange get_audio_cache_range() const override
{
return TimeRange(0, length());
}
@@ -206,24 +206,24 @@ public:
*/
LoopMode loop_mode() const
{
return static_cast<LoopMode>(GetStandardValue(kLoopModeInput).toInt());
return static_cast<LoopMode>(get_standard_value(k_loop_mode_input).toInt());
}
void set_loop_mode(LoopMode l)
{
SetStandardValue(kLoopModeInput, int(l));
set_standard_value(k_loop_mode_input, int(l));
}
MultiCamNode *FindMulticam();
MultiCamNode *find_multicam();
static const QString kBufferIn;
static const QString kMediaInInput;
static const QString kSpeedInput;
static const QString kReverseInput;
static const QString kMaintainAudioPitchInput;
static const QString kLoopModeInput;
static const QString k_buffer_in;
static const QString k_media_in_input;
static const QString k_speed_input;
static const QString k_reverse_input;
static const QString k_maintain_audio_pitch_input;
static const QString k_loop_mode_input;
static const QString kAutoCacheInput;
static const QString k_auto_cache_input;
protected:
virtual void LinkChangeEvent() override;
@@ -239,26 +239,26 @@ protected:
private:
enum SequenceToMediaTimeFlag {
kSTMNone = 0x0,
kSTMIgnoreReverse = 0x1,
kSTMIgnoreSpeed = 0x2,
kSTMIgnoreLoop = 0x4
k_stm_none = 0x0,
k_stm_ignore_reverse = 0x1,
k_stm_ignore_speed = 0x2,
k_stm_ignore_loop = 0x4
};
rational SequenceToMediaTime(const rational &sequence_time,
uint64_t flags = kSTMNone) const;
Rational sequence_to_media_time(const Rational &sequence_time,
uint64_t flags = k_stm_none) const;
rational MediaToSequenceTime(const rational &media_time) const;
Rational media_to_sequence_time(const Rational &media_time) const;
void RequestRangeFromConnected(const TimeRange &range);
void request_range_from_connected(const TimeRange &range);
void RequestRangeForCache(PlaybackCache *cache, const TimeRange &max_range,
void request_range_for_cache(PlaybackCache *cache, const TimeRange &max_range,
const TimeRange &range, bool invalidate,
bool request);
void RequestInvalidatedForCache(PlaybackCache *cache,
void request_invalidated_for_cache(PlaybackCache *cache,
const TimeRange &max_range);
bool GetAdjustedThumbnailRange(TimeRange *r) const;
bool get_adjusted_thumbnail_range(TimeRange *r) const;
QVector<Block *> block_links_;
@@ -268,7 +268,7 @@ private:
ViewerOutput *connected_viewer_;
private:
rational last_media_in_;
Rational last_media_in_;
};
}