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:
@@ -37,49 +37,49 @@ ExportVideoTab::ExportVideoTab(ColorManager *color_manager, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, color_manager_(color_manager)
|
||||
, threads_(0)
|
||||
, color_range_(VideoParams::kColorRangeDefault)
|
||||
, color_range_(VideoParams::k_color_range_default)
|
||||
{
|
||||
QVBoxLayout *outer_layout = new QVBoxLayout(this);
|
||||
|
||||
outer_layout->addWidget(SetupResolutionSection());
|
||||
outer_layout->addWidget(setup_resolution_section());
|
||||
|
||||
outer_layout->addWidget(SetupCodecSection());
|
||||
outer_layout->addWidget(setup_codec_section());
|
||||
|
||||
outer_layout->addWidget(SetupColorSection());
|
||||
outer_layout->addWidget(setup_color_section());
|
||||
|
||||
outer_layout->addStretch();
|
||||
}
|
||||
|
||||
int ExportVideoTab::SetFormat(ExportFormat::Format format)
|
||||
int ExportVideoTab::set_format(ExportFormat::Format format)
|
||||
{
|
||||
format_ = format;
|
||||
|
||||
QList<ExportCodec::Codec> vcodecs = ExportFormat::GetVideoCodecs(format);
|
||||
QList<ExportCodec::Codec> vcodecs = ExportFormat::get_video_codecs(format);
|
||||
setEnabled(!vcodecs.isEmpty());
|
||||
codec_combobox()->clear();
|
||||
foreach (ExportCodec::Codec vcodec, vcodecs) {
|
||||
codec_combobox()->addItem(ExportCodec::GetCodecName(vcodec), vcodec);
|
||||
codec_combobox()->addItem(ExportCodec::get_codec_name(vcodec), vcodec);
|
||||
}
|
||||
return vcodecs.size();
|
||||
}
|
||||
|
||||
bool ExportVideoTab::IsImageSequenceSet() const
|
||||
bool ExportVideoTab::is_image_sequence_set() const
|
||||
{
|
||||
ImageSection *img_section =
|
||||
dynamic_cast<ImageSection *>(codec_stack_->currentWidget());
|
||||
|
||||
return (img_section && img_section->IsImageSequenceChecked());
|
||||
return (img_section && img_section->is_image_sequence_checked());
|
||||
}
|
||||
|
||||
void ExportVideoTab::SetImageSequence(bool e) const
|
||||
void ExportVideoTab::set_image_sequence(bool e) const
|
||||
{
|
||||
if (ImageSection *img_section =
|
||||
dynamic_cast<ImageSection *>(codec_stack_->currentWidget())) {
|
||||
img_section->SetImageSequenceChecked(e);
|
||||
img_section->set_image_sequence_checked(e);
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *ExportVideoTab::SetupResolutionSection()
|
||||
QWidget *ExportVideoTab::setup_resolution_section()
|
||||
{
|
||||
int row = 0;
|
||||
|
||||
@@ -91,7 +91,7 @@ QWidget *ExportVideoTab::SetupResolutionSection()
|
||||
layout->addWidget(new QLabel(tr("Width:")), row, 0);
|
||||
|
||||
width_slider_ = new IntegerSlider();
|
||||
width_slider_->SetMinimum(1);
|
||||
width_slider_->set_minimum(1);
|
||||
layout->addWidget(width_slider_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -99,7 +99,7 @@ QWidget *ExportVideoTab::SetupResolutionSection()
|
||||
layout->addWidget(new QLabel(tr("Height:")), row, 0);
|
||||
|
||||
height_slider_ = new IntegerSlider();
|
||||
height_slider_->SetMinimum(1);
|
||||
height_slider_->set_minimum(1);
|
||||
layout->addWidget(height_slider_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -116,22 +116,22 @@ QWidget *ExportVideoTab::SetupResolutionSection()
|
||||
|
||||
scaling_method_combobox_ = new QComboBox();
|
||||
scaling_method_combobox_->setEnabled(false);
|
||||
scaling_method_combobox_->addItem(tr("Fit"), EncodingParams::kFit);
|
||||
scaling_method_combobox_->addItem(tr("Stretch"), EncodingParams::kStretch);
|
||||
scaling_method_combobox_->addItem(tr("Crop"), EncodingParams::kCrop);
|
||||
scaling_method_combobox_->addItem(tr("Fit"), EncodingParams::k_fit);
|
||||
scaling_method_combobox_->addItem(tr("Stretch"), EncodingParams::k_stretch);
|
||||
scaling_method_combobox_->addItem(tr("Crop"), EncodingParams::k_crop);
|
||||
layout->addWidget(scaling_method_combobox_, row, 1);
|
||||
|
||||
// Automatically enable/disable the scaling method depending on maintain aspect ratio
|
||||
connect(maintain_aspect_checkbox_, &QCheckBox::toggled, this,
|
||||
&ExportVideoTab::MaintainAspectRatioChanged);
|
||||
&ExportVideoTab::maintain_aspect_ratio_changed);
|
||||
|
||||
row++;
|
||||
|
||||
layout->addWidget(new QLabel(tr("Frame Rate:")), row, 0);
|
||||
|
||||
frame_rate_combobox_ = new FrameRateComboBox();
|
||||
connect(frame_rate_combobox_, &FrameRateComboBox::FrameRateChanged, this,
|
||||
&ExportVideoTab::UpdateFrameRate);
|
||||
connect(frame_rate_combobox_, &FrameRateComboBox::frame_rate_changed, this,
|
||||
&ExportVideoTab::update_frame_rate);
|
||||
layout->addWidget(frame_rate_combobox_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -158,15 +158,15 @@ QWidget *ExportVideoTab::SetupResolutionSection()
|
||||
return resolution_group;
|
||||
}
|
||||
|
||||
QWidget *ExportVideoTab::SetupColorSection()
|
||||
QWidget *ExportVideoTab::setup_color_section()
|
||||
{
|
||||
color_space_chooser_ = new ColorSpaceChooser(color_manager_, true, false);
|
||||
connect(color_space_chooser_, &ColorSpaceChooser::InputColorSpaceChanged,
|
||||
this, &ExportVideoTab::ColorSpaceChanged);
|
||||
connect(color_space_chooser_, &ColorSpaceChooser::input_color_space_changed,
|
||||
this, &ExportVideoTab::color_space_changed);
|
||||
return color_space_chooser_;
|
||||
}
|
||||
|
||||
QWidget *ExportVideoTab::SetupCodecSection()
|
||||
QWidget *ExportVideoTab::setup_codec_section()
|
||||
{
|
||||
int row = 0;
|
||||
|
||||
@@ -182,7 +182,7 @@ QWidget *ExportVideoTab::SetupCodecSection()
|
||||
connect(
|
||||
codec_combobox_,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &ExportVideoTab::VideoCodecChanged);
|
||||
this, &ExportVideoTab::video_codec_changed);
|
||||
|
||||
row++;
|
||||
|
||||
@@ -190,8 +190,8 @@ QWidget *ExportVideoTab::SetupCodecSection()
|
||||
codec_layout->addWidget(codec_stack_, row, 0, 1, 2);
|
||||
|
||||
image_section_ = new ImageSection();
|
||||
connect(image_section_, &ImageSection::TimeChanged, this,
|
||||
&ExportVideoTab::TimeChanged);
|
||||
connect(image_section_, &ImageSection::time_changed, this,
|
||||
&ExportVideoTab::time_changed);
|
||||
codec_stack_->addWidget(image_section_);
|
||||
|
||||
h264_section_ = new H264Section();
|
||||
@@ -210,22 +210,22 @@ QWidget *ExportVideoTab::SetupCodecSection()
|
||||
|
||||
QPushButton *advanced_btn = new QPushButton(tr("Advanced"));
|
||||
connect(advanced_btn, &QPushButton::clicked, this,
|
||||
&ExportVideoTab::OpenAdvancedDialog);
|
||||
&ExportVideoTab::open_advanced_dialog);
|
||||
codec_layout->addWidget(advanced_btn, row, 1);
|
||||
|
||||
return codec_group;
|
||||
}
|
||||
|
||||
void ExportVideoTab::MaintainAspectRatioChanged(bool val)
|
||||
void ExportVideoTab::maintain_aspect_ratio_changed(bool val)
|
||||
{
|
||||
scaling_method_combobox_->setEnabled(!val);
|
||||
}
|
||||
|
||||
void ExportVideoTab::OpenAdvancedDialog()
|
||||
void ExportVideoTab::open_advanced_dialog()
|
||||
{
|
||||
// Find export formats compatible with this encoder
|
||||
QStringList pixel_formats =
|
||||
ExportFormat::GetPixelFormatsForCodec(format_, GetSelectedCodec());
|
||||
ExportFormat::get_pixel_formats_for_codec(format_, get_selected_codec());
|
||||
|
||||
ExportAdvancedVideoDialog d(pixel_formats, this);
|
||||
|
||||
@@ -240,7 +240,7 @@ void ExportVideoTab::OpenAdvancedDialog()
|
||||
}
|
||||
}
|
||||
|
||||
void ExportVideoTab::UpdateFrameRate(rational r)
|
||||
void ExportVideoTab::update_frame_rate(Rational r)
|
||||
{
|
||||
// Convert frame rate to timebase
|
||||
r.flip();
|
||||
@@ -249,37 +249,37 @@ void ExportVideoTab::UpdateFrameRate(rational r)
|
||||
ImageSection *img =
|
||||
dynamic_cast<ImageSection *>(codec_stack_->widget(i));
|
||||
if (img) {
|
||||
img->SetTimebase(r);
|
||||
img->set_timebase(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ExportVideoTab::VideoCodecChanged()
|
||||
void ExportVideoTab::video_codec_changed()
|
||||
{
|
||||
ExportCodec::Codec codec = GetSelectedCodec();
|
||||
ExportCodec::Codec codec = get_selected_codec();
|
||||
|
||||
switch (codec) {
|
||||
case ExportCodec::kCodecH264:
|
||||
case ExportCodec::kCodecH264rgb:
|
||||
SetCodecSection(h264_section_);
|
||||
case ExportCodec::k_codec_h264:
|
||||
case ExportCodec::k_codec_h264rgb:
|
||||
set_codec_section(h264_section_);
|
||||
break;
|
||||
case ExportCodec::kCodecH265:
|
||||
SetCodecSection(h265_section_);
|
||||
case ExportCodec::k_codec_h265:
|
||||
set_codec_section(h265_section_);
|
||||
break;
|
||||
case ExportCodec::kCodecAV1:
|
||||
SetCodecSection(av1_section_);
|
||||
case ExportCodec::k_codec_a_v1:
|
||||
set_codec_section(av1_section_);
|
||||
break;
|
||||
case ExportCodec::kCodecCineform:
|
||||
SetCodecSection(cineform_section_);
|
||||
case ExportCodec::k_codec_cineform:
|
||||
set_codec_section(cineform_section_);
|
||||
break;
|
||||
default:
|
||||
SetCodecSection(
|
||||
ExportCodec::IsCodecAStillImage(codec) ? image_section_ : nullptr);
|
||||
set_codec_section(
|
||||
ExportCodec::is_codec_a_still_image(codec) ? image_section_ : nullptr);
|
||||
}
|
||||
|
||||
// Set default pixel format
|
||||
QStringList pix_fmts =
|
||||
ExportFormat::GetPixelFormatsForCodec(format_, codec);
|
||||
ExportFormat::get_pixel_formats_for_codec(format_, codec);
|
||||
if (!pix_fmts.isEmpty()) {
|
||||
pix_fmt_ = pix_fmts.first();
|
||||
} else {
|
||||
@@ -287,13 +287,13 @@ void ExportVideoTab::VideoCodecChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void ExportVideoTab::SetTime(const rational &time)
|
||||
void ExportVideoTab::set_time(const Rational &time)
|
||||
{
|
||||
for (int i = 0; i < codec_stack_->count(); i++) {
|
||||
ImageSection *img =
|
||||
dynamic_cast<ImageSection *>(codec_stack_->widget(i));
|
||||
if (img) {
|
||||
img->SetTime(time);
|
||||
img->set_time(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user