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
+1 -1
View File
@@ -43,7 +43,7 @@ void DragButton::mouseMoveEvent(QMouseEvent *event)
QPushButton::mouseMoveEvent(event);
if (event->buttons() && !dragging_) {
emit DragStarted();
emit drag_started();
dragging_ = true;
}
}
+4 -4
View File
@@ -19,8 +19,8 @@
***/
#ifndef DRAGBUTTON_H
#define DRAGBUTTON_H
#ifndef OAK_DRAGBUTTON_H
#define OAK_DRAGBUTTON_H
#include <QPushButton>
@@ -35,7 +35,7 @@ public:
DragButton(QWidget *parent = nullptr);
signals:
void DragStarted();
void drag_started();
protected:
virtual void mousePressEvent(QMouseEvent *event) override;
@@ -50,4 +50,4 @@ private:
}
#endif // DRAGBUTTON_H
#endif // OAK_DRAGBUTTON_H
@@ -57,10 +57,10 @@ PlaybackControls::PlaybackControls(QWidget *parent)
lower_left_layout->setContentsMargins(0, 0, 0, 0);
cur_tc_lbl_ = new RationalSlider();
cur_tc_lbl_->SetDisplayType(RationalSlider::kTime);
cur_tc_lbl_->SetMinimum(0);
connect(cur_tc_lbl_, &RationalSlider::ValueChanged, this,
&PlaybackControls::TimeChanged);
cur_tc_lbl_->set_display_type(RationalSlider::k_time);
cur_tc_lbl_->set_minimum(0);
connect(cur_tc_lbl_, &RationalSlider::value_changed, this,
&PlaybackControls::time_changed);
lower_left_layout->addWidget(cur_tc_lbl_);
lower_left_layout->addStretch();
@@ -87,14 +87,14 @@ PlaybackControls::PlaybackControls(QWidget *parent)
go_to_start_btn_->setSizePolicy(btn_sz_policy);
lower_middle_layout->addWidget(go_to_start_btn_);
connect(go_to_start_btn_, &QPushButton::clicked, this,
&PlaybackControls::BeginClicked);
&PlaybackControls::begin_clicked);
// Prev Frame Button
prev_frame_btn_ = new QPushButton();
prev_frame_btn_->setSizePolicy(btn_sz_policy);
lower_middle_layout->addWidget(prev_frame_btn_);
connect(prev_frame_btn_, &QPushButton::clicked, this,
&PlaybackControls::PrevFrameClicked);
&PlaybackControls::prev_frame_clicked);
// Play/Pause Button
playpause_stack_ = new QStackedWidget();
@@ -104,12 +104,12 @@ PlaybackControls::PlaybackControls(QWidget *parent)
play_btn_ = new QPushButton();
playpause_stack_->addWidget(play_btn_);
connect(play_btn_, &QPushButton::clicked, this,
&PlaybackControls::PlayClicked);
&PlaybackControls::play_clicked);
pause_btn_ = new QPushButton();
playpause_stack_->addWidget(pause_btn_);
connect(pause_btn_, &QPushButton::clicked, this,
&PlaybackControls::PauseClicked);
&PlaybackControls::pause_clicked);
// Default to showing play button
playpause_stack_->setCurrentWidget(play_btn_);
@@ -119,14 +119,14 @@ PlaybackControls::PlaybackControls(QWidget *parent)
next_frame_btn_->setSizePolicy(btn_sz_policy);
lower_middle_layout->addWidget(next_frame_btn_);
connect(next_frame_btn_, &QPushButton::clicked, this,
&PlaybackControls::NextFrameClicked);
&PlaybackControls::next_frame_clicked);
// Go To End Button
go_to_end_btn_ = new QPushButton();
go_to_end_btn_->setSizePolicy(btn_sz_policy);
lower_middle_layout->addWidget(go_to_end_btn_);
connect(go_to_end_btn_, &QPushButton::clicked, this,
&PlaybackControls::EndClicked);
&PlaybackControls::end_clicked);
lower_middle_layout->addStretch();
@@ -137,15 +137,15 @@ PlaybackControls::PlaybackControls(QWidget *parent)
av_btn_layout->setContentsMargins(0, 0, 0, 0);
video_drag_btn_ = new DragButton();
connect(video_drag_btn_, &QPushButton::clicked, this,
&PlaybackControls::VideoClicked);
connect(video_drag_btn_, &DragButton::DragStarted, this,
&PlaybackControls::VideoDragged);
&PlaybackControls::video_clicked);
connect(video_drag_btn_, &DragButton::drag_started, this,
&PlaybackControls::video_dragged);
av_btn_layout->addWidget(video_drag_btn_);
audio_drag_btn_ = new DragButton();
connect(audio_drag_btn_, &QPushButton::clicked, this,
&PlaybackControls::AudioClicked);
connect(audio_drag_btn_, &DragButton::DragStarted, this,
&PlaybackControls::AudioDragged);
&PlaybackControls::audio_clicked);
connect(audio_drag_btn_, &DragButton::drag_started, this,
&PlaybackControls::audio_dragged);
av_btn_layout->addWidget(audio_drag_btn_);
lower_control_layout->addWidget(av_btn_widget);
@@ -163,31 +163,31 @@ PlaybackControls::PlaybackControls(QWidget *parent)
end_tc_lbl_ = new QLabel();
lower_right_layout->addWidget(end_tc_lbl_);
UpdateIcons();
update_icons();
SetTimebase(0);
set_timebase(0);
SetAudioVideoDragButtonsVisible(false);
set_audio_video_drag_buttons_visible(false);
connect(Core::instance(), &Core::TimecodeDisplayChanged, this,
&PlaybackControls::TimecodeChanged);
connect(Core::instance(), &Core::timecode_display_changed, this,
&PlaybackControls::timecode_changed);
play_blink_timer_ = new QTimer(this);
play_blink_timer_->setInterval(500);
connect(play_blink_timer_, &QTimer::timeout, this,
&PlaybackControls::PlayBlink);
&PlaybackControls::play_blink);
}
void PlaybackControls::SetTimecodeEnabled(bool enabled)
void PlaybackControls::set_timecode_enabled(bool enabled)
{
lower_left_container_->setVisible(enabled);
lower_right_container_->setVisible(enabled);
}
void PlaybackControls::SetTimebase(const rational &r)
void PlaybackControls::set_timebase(const Rational &r)
{
time_base_ = r;
cur_tc_lbl_->SetTimebase(r);
cur_tc_lbl_->set_timebase(r);
cur_tc_lbl_->setVisible(!r.isNull());
end_tc_lbl_->setVisible(!r.isNull());
@@ -195,18 +195,18 @@ void PlaybackControls::SetTimebase(const rational &r)
setEnabled(!r.isNull());
}
void PlaybackControls::SetAudioVideoDragButtonsVisible(bool e)
void PlaybackControls::set_audio_video_drag_buttons_visible(bool e)
{
video_drag_btn_->setVisible(e);
audio_drag_btn_->setVisible(e);
}
void PlaybackControls::SetTime(const rational &r)
void PlaybackControls::set_time(const Rational &r)
{
cur_tc_lbl_->SetValue(r);
cur_tc_lbl_->set_value(r);
}
void PlaybackControls::SetEndTime(const rational &r)
void PlaybackControls::set_end_time(const Rational &r)
{
if (time_base_.isNull()) {
return;
@@ -215,16 +215,16 @@ void PlaybackControls::SetEndTime(const rational &r)
end_time_ = r;
end_tc_lbl_->setText(QString::fromStdString(Timecode::time_to_timecode(
end_time_, time_base_, Core::instance()->GetTimecodeDisplay())));
end_time_, time_base_, Core::instance()->get_timecode_display())));
}
void PlaybackControls::ShowPauseButton()
void PlaybackControls::show_pause_button()
{
// Play was clicked, toggle to pause
playpause_stack_->setCurrentWidget(pause_btn_);
}
void PlaybackControls::ShowPlayButton()
void PlaybackControls::show_play_button()
{
playpause_stack_->setCurrentWidget(play_btn_);
}
@@ -234,36 +234,36 @@ void PlaybackControls::changeEvent(QEvent *e)
QWidget::changeEvent(e);
if (e->type() == QEvent::StyleChange) {
UpdateIcons();
update_icons();
}
}
void PlaybackControls::UpdateIcons()
void PlaybackControls::update_icons()
{
go_to_start_btn_->setIcon(icon::GoToStart);
prev_frame_btn_->setIcon(icon::PrevFrame);
play_btn_->setIcon(icon::Play);
pause_btn_->setIcon(icon::Pause);
next_frame_btn_->setIcon(icon::NextFrame);
go_to_end_btn_->setIcon(icon::GoToEnd);
video_drag_btn_->setIcon(icon::Video);
audio_drag_btn_->setIcon(icon::Audio);
go_to_start_btn_->setIcon(icon::go_to_start);
prev_frame_btn_->setIcon(icon::prev_frame);
play_btn_->setIcon(icon::play);
pause_btn_->setIcon(icon::pause);
next_frame_btn_->setIcon(icon::next_frame);
go_to_end_btn_->setIcon(icon::go_to_end);
video_drag_btn_->setIcon(icon::video);
audio_drag_btn_->setIcon(icon::audio);
}
void PlaybackControls::SetButtonRecordingState(QPushButton *btn, bool on)
void PlaybackControls::set_button_recording_state(QPushButton *btn, bool on)
{
btn->setStyleSheet(on ? QStringLiteral("background: red;") : QString());
}
void PlaybackControls::TimecodeChanged()
void PlaybackControls::timecode_changed()
{
// Update end time
SetEndTime(end_time_);
set_end_time(end_time_);
}
void PlaybackControls::PlayBlink()
void PlaybackControls::play_blink()
{
SetButtonRecordingState(play_btn_, play_btn_->styleSheet().isEmpty());
set_button_recording_state(play_btn_, play_btn_->styleSheet().isEmpty());
}
}
+33 -33
View File
@@ -19,8 +19,8 @@
***/
#ifndef PLAYBACKCONTROLS_H
#define PLAYBACKCONTROLS_H
#ifndef OAK_PLAYBACKCONTROLS_H
#define OAK_PLAYBACKCONTROLS_H
#include <QWidget>
#include <QLabel>
@@ -46,86 +46,86 @@ public:
/**
* @brief Set whether the timecodes should be shown or not
*/
void SetTimecodeEnabled(bool enabled);
void set_timecode_enabled(bool enabled);
void SetTimebase(const rational &r);
void set_timebase(const Rational &r);
void SetAudioVideoDragButtonsVisible(bool e);
void set_audio_video_drag_buttons_visible(bool e);
public slots:
void SetTime(const rational &r);
void set_time(const Rational &r);
void SetEndTime(const rational &r);
void set_end_time(const Rational &r);
void ShowPauseButton();
void show_pause_button();
void ShowPlayButton();
void show_play_button();
void StartPlayBlink()
void start_play_blink()
{
play_blink_timer_->start();
SetButtonRecordingState(play_btn_, true);
set_button_recording_state(play_btn_, true);
}
void StopPlayBlink()
void stop_play_blink()
{
play_blink_timer_->stop();
SetButtonRecordingState(play_btn_, false);
set_button_recording_state(play_btn_, false);
}
void SetPauseButtonRecordingState(bool on)
void set_pause_button_recording_state(bool on)
{
SetButtonRecordingState(pause_btn_, on);
set_button_recording_state(pause_btn_, on);
}
signals:
/**
* @brief Signal emitted when "Go to Start" is clicked
*/
void BeginClicked();
void begin_clicked();
/**
* @brief Signal emitted when "Previous Frame" is clicked
*/
void PrevFrameClicked();
void prev_frame_clicked();
/**
* @brief Signal emitted when "Play" is clicked
*/
void PlayClicked();
void play_clicked();
/**
* @brief Signal emitted when "Pause" is clicked
*/
void PauseClicked();
void pause_clicked();
/**
* @brief Signal emitted when "Next Frame" is clicked
*/
void NextFrameClicked();
void next_frame_clicked();
/**
* @brief Signal emitted when "Go to End" is clicked
*/
void EndClicked();
void end_clicked();
void AudioClicked();
void audio_clicked();
void VideoClicked();
void video_clicked();
void AudioDragged();
void audio_dragged();
void VideoDragged();
void video_dragged();
void TimeChanged(const rational &t);
void time_changed(const Rational &t);
protected:
virtual void changeEvent(QEvent *) override;
private:
void UpdateIcons();
void update_icons();
static void SetButtonRecordingState(QPushButton *btn, bool on);
static void set_button_recording_state(QPushButton *btn, bool on);
QWidget *lower_left_container_;
QWidget *lower_right_container_;
@@ -133,9 +133,9 @@ private:
RationalSlider *cur_tc_lbl_;
QLabel *end_tc_lbl_;
rational end_time_;
Rational end_time_;
rational time_base_;
Rational time_base_;
QPushButton *go_to_start_btn_;
QPushButton *prev_frame_btn_;
@@ -151,11 +151,11 @@ private:
QTimer *play_blink_timer_;
private slots:
void TimecodeChanged();
void timecode_changed();
void PlayBlink();
void play_blink();
};
}
#endif // PLAYBACKCONTROLS_H
#endif // OAK_PLAYBACKCONTROLS_H