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
+12 -12
View File
@@ -38,7 +38,7 @@ namespace olive
* If the mask is zero, fall back to a default layout derived from the
* channel count (stereo when unknown).
*/
static AudioParams FixChannelLayout(const AudioParams &params)
static AudioParams fix_channel_layout(const AudioParams &params)
{
AudioParams result = params;
@@ -66,10 +66,10 @@ AudioProcessor::AudioProcessor()
AudioProcessor::~AudioProcessor()
{
Close();
close();
}
bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to,
bool AudioProcessor::open(const AudioParams &from, const AudioParams &to,
double tempo)
{
if (graph_) {
@@ -77,8 +77,8 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to,
return false;
}
AudioParams from_fixed = FixChannelLayout(from);
AudioParams to_fixed = FixChannelLayout(to);
AudioParams from_fixed = fix_channel_layout(from);
AudioParams to_fixed = fix_channel_layout(to);
qDebug() << "AudioProcessor::Open: from sample_rate="
<< from_fixed.sample_rate() << "channels="
@@ -92,13 +92,13 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to,
config.in_sample_rate = from_fixed.sample_rate();
config.in_channel_layout_mask = from_fixed.channel_layout();
config.in_sample_format =
FFmpegUtils::GetFFmpegSampleFormat(from_fixed.format());
FFmpegUtils::get_f_fmpeg_sample_format(from_fixed.format());
config.in_channels = from_fixed.channel_count();
config.out_sample_rate = to_fixed.sample_rate();
config.out_channel_layout_mask = to_fixed.channel_layout();
config.out_sample_format =
FFmpegUtils::GetFFmpegSampleFormat(to_fixed.format());
FFmpegUtils::get_f_fmpeg_sample_format(to_fixed.format());
config.out_channels = to_fixed.channel_count();
config.out_is_planar = to_fixed.format().is_planar() ? 1 : 0;
@@ -113,7 +113,7 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to,
out_frame_ = fb_frame_alloc();
if (!out_frame_) {
qCritical() << "Failed to allocate output frame";
Close();
close();
return false;
}
@@ -123,7 +123,7 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to,
return true;
}
void AudioProcessor::Close()
void AudioProcessor::close()
{
if (graph_) {
fb_audio_graph_free(&graph_);
@@ -134,10 +134,10 @@ void AudioProcessor::Close()
}
}
int AudioProcessor::Convert(float **in, int nb_in_samples,
int AudioProcessor::convert(float **in, int nb_in_samples,
AudioProcessor::Buffer *output)
{
if (!IsOpen()) {
if (!is_open()) {
qCritical() << "Tried to convert on closed processor";
return -1;
}
@@ -197,7 +197,7 @@ int AudioProcessor::Convert(float **in, int nb_in_samples,
return r;
}
void AudioProcessor::Flush()
void AudioProcessor::flush()
{
int r = fb_audio_graph_push(graph_, nullptr, 0);
if (r < 0) {