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:
@@ -11,27 +11,27 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool Open() override
|
||||
bool open() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteFrame(olive::FramePtr, olive::core::rational) override
|
||||
bool write_frame(olive::FramePtr, olive::core::Rational) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteAudio(const olive::SampleBuffer &) override
|
||||
bool write_audio(const olive::SampleBuffer &) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WriteSubtitle(const olive::SubtitleBlock *) override
|
||||
bool write_subtitle(const olive::SubtitleBlock *) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Close() override
|
||||
void close() override
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -40,26 +40,26 @@ public:
|
||||
TEST(CodecEncoder, ImageSequenceFilenames)
|
||||
{
|
||||
olive::EncodingParams params;
|
||||
params.SetFilename(QStringLiteral("frame_[####].png"));
|
||||
params.set_filename(QStringLiteral("frame_[####].png"));
|
||||
params.set_video_is_image_sequence(true);
|
||||
|
||||
olive::VideoParams video_params;
|
||||
video_params.set_frame_rate(olive::core::rational(24, 1));
|
||||
params.EnableVideo(video_params, olive::ExportCodec::kCodecPNG);
|
||||
video_params.set_frame_rate(olive::core::Rational(24, 1));
|
||||
params.enable_video(video_params, olive::ExportCodec::k_codec_png);
|
||||
|
||||
TestEncoder encoder(params);
|
||||
|
||||
EXPECT_TRUE(olive::Encoder::FilenameContainsDigitPlaceholder(
|
||||
EXPECT_TRUE(olive::Encoder::filename_contains_digit_placeholder(
|
||||
QStringLiteral("frame_[####].png")));
|
||||
EXPECT_EQ(olive::Encoder::GetImageSequencePlaceholderDigitCount(
|
||||
EXPECT_EQ(olive::Encoder::get_image_sequence_placeholder_digit_count(
|
||||
QStringLiteral("frame_[####].png")),
|
||||
4);
|
||||
EXPECT_EQ(olive::Encoder::FilenameRemoveDigitPlaceholder(
|
||||
EXPECT_EQ(olive::Encoder::filename_remove_digit_placeholder(
|
||||
QStringLiteral("frame_[####].png")),
|
||||
QStringLiteral("frame.png"));
|
||||
|
||||
const QString filename =
|
||||
encoder.GetFilenameForFrame(olive::core::rational(1, 24));
|
||||
encoder.get_filename_for_frame(olive::core::Rational(1, 24));
|
||||
EXPECT_EQ(filename, QStringLiteral("frame_0001.png"));
|
||||
}
|
||||
|
||||
@@ -67,17 +67,17 @@ TEST(CodecEncoder, MatrixGeneration)
|
||||
{
|
||||
using Method = olive::EncodingParams::VideoScalingMethod;
|
||||
|
||||
QMatrix4x4 stretch = olive::EncodingParams::GenerateMatrix(
|
||||
Method::kStretch, 1920, 1080, 1280, 720);
|
||||
QMatrix4x4 stretch = olive::EncodingParams::generate_matrix(
|
||||
Method::k_stretch, 1920, 1080, 1280, 720);
|
||||
EXPECT_TRUE(qFuzzyCompare(stretch(0, 0), 1.0f));
|
||||
EXPECT_TRUE(qFuzzyCompare(stretch(1, 1), 1.0f));
|
||||
|
||||
QMatrix4x4 fit = olive::EncodingParams::GenerateMatrix(Method::kFit, 1920,
|
||||
QMatrix4x4 fit = olive::EncodingParams::generate_matrix(Method::k_fit, 1920,
|
||||
1080, 1024, 1024);
|
||||
EXPECT_TRUE(qFuzzyCompare(fit(0, 0), 1.0f));
|
||||
EXPECT_FALSE(qFuzzyCompare(fit(1, 1), 1.0f));
|
||||
|
||||
QMatrix4x4 crop = olive::EncodingParams::GenerateMatrix(Method::kCrop, 1920,
|
||||
QMatrix4x4 crop = olive::EncodingParams::generate_matrix(Method::k_crop, 1920,
|
||||
1080, 1024, 1024);
|
||||
EXPECT_FALSE(qFuzzyCompare(crop(0, 0), 1.0f));
|
||||
EXPECT_TRUE(qFuzzyCompare(crop(1, 1), 1.0f));
|
||||
@@ -88,10 +88,10 @@ TEST(CodecEncoder, TypeFromFormat)
|
||||
using olive::Encoder;
|
||||
using olive::ExportFormat;
|
||||
|
||||
EXPECT_EQ(Encoder::GetTypeFromFormat(ExportFormat::kFormatPNG),
|
||||
Encoder::kEncoderTypeOIIO);
|
||||
EXPECT_EQ(Encoder::GetTypeFromFormat(ExportFormat::kFormatDNxHD),
|
||||
Encoder::kEncoderTypeFFmpeg);
|
||||
EXPECT_EQ(Encoder::GetTypeFromFormat(ExportFormat::kFormatCount),
|
||||
Encoder::kEncoderTypeNone);
|
||||
EXPECT_EQ(Encoder::get_type_from_format(ExportFormat::k_format_png),
|
||||
Encoder::k_encoder_type_oiio);
|
||||
EXPECT_EQ(Encoder::get_type_from_format(ExportFormat::k_format_d_nx_hd),
|
||||
Encoder::k_encoder_type_f_fmpeg);
|
||||
EXPECT_EQ(Encoder::get_type_from_format(ExportFormat::k_format_count),
|
||||
Encoder::k_encoder_type_none);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user