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:
@@ -33,7 +33,7 @@ namespace olive
|
||||
{
|
||||
|
||||
AV1Section::AV1Section(QWidget *parent)
|
||||
: AV1Section(AV1CRFSection::kDefaultAV1CRF, parent)
|
||||
: AV1Section(AV1CRFSection::k_default_a_v1_crf, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -89,15 +89,15 @@ AV1Section::AV1Section(int default_crf, QWidget *parent)
|
||||
compression_method_stack_, &QStackedWidget::setCurrentIndex);
|
||||
}
|
||||
|
||||
void AV1Section::AddOpts(EncodingParams *params)
|
||||
void AV1Section::add_opts(EncodingParams *params)
|
||||
{
|
||||
CompressionMethod method = static_cast<CompressionMethod>(
|
||||
compression_method_stack_->currentIndex());
|
||||
|
||||
if (method == kConstantRateFactor) {
|
||||
if (method == k_constant_rate_factor) {
|
||||
// Set Quantizer value
|
||||
params->set_video_option(QStringLiteral("qp"),
|
||||
QString::number(crf_section_->GetValue()));
|
||||
QString::number(crf_section_->get_value()));
|
||||
}
|
||||
|
||||
params->set_video_option(QStringLiteral("preset"),
|
||||
@@ -111,27 +111,27 @@ AV1CRFSection::AV1CRFSection(int default_crf, QWidget *parent)
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
crf_slider_ = new QSlider(Qt::Horizontal);
|
||||
crf_slider_->setMinimum(kMinimumCRF);
|
||||
crf_slider_->setMaximum(kMaximumCRF);
|
||||
crf_slider_->setMinimum(k_minimum_crf);
|
||||
crf_slider_->setMaximum(k_maximum_crf);
|
||||
crf_slider_->setValue(default_crf);
|
||||
layout->addWidget(crf_slider_);
|
||||
|
||||
IntegerSlider *crf_input = new IntegerSlider();
|
||||
crf_input->setMaximumWidth(QtUtils::QFontMetricsWidth(
|
||||
crf_input->setMaximumWidth(QtUtils::q_font_metrics_width(
|
||||
crf_input->fontMetrics(), QStringLiteral("HHHH")));
|
||||
crf_input->SetMinimum(kMinimumCRF);
|
||||
crf_input->SetMaximum(kMaximumCRF);
|
||||
crf_input->SetValue(default_crf);
|
||||
crf_input->set_minimum(k_minimum_crf);
|
||||
crf_input->set_maximum(k_maximum_crf);
|
||||
crf_input->set_value(default_crf);
|
||||
crf_input->SetDefaultValue(default_crf);
|
||||
layout->addWidget(crf_input);
|
||||
|
||||
connect(crf_slider_, &QSlider::valueChanged, crf_input,
|
||||
&IntegerSlider::SetValue);
|
||||
connect(crf_input, &IntegerSlider::ValueChanged, crf_slider_,
|
||||
&IntegerSlider::set_value);
|
||||
connect(crf_input, &IntegerSlider::value_changed, crf_slider_,
|
||||
&QSlider::setValue);
|
||||
}
|
||||
|
||||
int AV1CRFSection::GetValue() const
|
||||
int AV1CRFSection::get_value() const
|
||||
{
|
||||
return crf_slider_->value();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef AV1SECTION_H
|
||||
#define AV1SECTION_H
|
||||
#ifndef OAK_AV1SECTION_H
|
||||
#define OAK_AV1SECTION_H
|
||||
|
||||
#include <QSlider>
|
||||
#include <QStackedWidget>
|
||||
@@ -37,13 +37,13 @@ class AV1CRFSection : public QWidget {
|
||||
public:
|
||||
AV1CRFSection(int default_crf, QWidget *parent = nullptr);
|
||||
|
||||
int GetValue() const;
|
||||
int get_value() const;
|
||||
|
||||
static const int kDefaultAV1CRF = 30;
|
||||
static const int k_default_a_v1_crf = 30;
|
||||
|
||||
private:
|
||||
static const int kMinimumCRF = 0;
|
||||
static const int kMaximumCRF = 63;
|
||||
static const int k_minimum_crf = 0;
|
||||
static const int k_maximum_crf = 63;
|
||||
|
||||
QSlider *crf_slider_;
|
||||
};
|
||||
@@ -52,13 +52,13 @@ class AV1Section : public CodecSection {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum CompressionMethod {
|
||||
kConstantRateFactor,
|
||||
k_constant_rate_factor,
|
||||
};
|
||||
|
||||
AV1Section(QWidget *parent = nullptr);
|
||||
AV1Section(int default_crf, QWidget *parent);
|
||||
|
||||
virtual void AddOpts(EncodingParams *params) override;
|
||||
virtual void add_opts(EncodingParams *params) override;
|
||||
|
||||
private:
|
||||
QStackedWidget *compression_method_stack_;
|
||||
@@ -70,4 +70,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // AV1SECTION_H
|
||||
#endif // OAK_AV1SECTION_H
|
||||
|
||||
@@ -79,14 +79,14 @@ CineformSection::CineformSection(QWidget *parent)
|
||||
layout->addWidget(quality_combobox_, row, 1);
|
||||
}
|
||||
|
||||
void CineformSection::AddOpts(EncodingParams *params)
|
||||
void CineformSection::add_opts(EncodingParams *params)
|
||||
{
|
||||
params->set_video_option(
|
||||
QStringLiteral("quality"),
|
||||
QString::number(quality_combobox_->currentIndex()));
|
||||
}
|
||||
|
||||
void CineformSection::SetOpts(const EncodingParams *p)
|
||||
void CineformSection::set_opts(const EncodingParams *p)
|
||||
{
|
||||
quality_combobox_->setCurrentIndex(
|
||||
p->video_option(QStringLiteral("quality")).toInt());
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef CINEFORMSECTION_H
|
||||
#define CINEFORMSECTION_H
|
||||
#ifndef OAK_CINEFORMSECTION_H
|
||||
#define OAK_CINEFORMSECTION_H
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
@@ -34,9 +34,9 @@ class CineformSection : public CodecSection {
|
||||
public:
|
||||
CineformSection(QWidget *parent = nullptr);
|
||||
|
||||
virtual void AddOpts(EncodingParams *params) override;
|
||||
virtual void add_opts(EncodingParams *params) override;
|
||||
|
||||
virtual void SetOpts(const EncodingParams *p) override;
|
||||
virtual void set_opts(const EncodingParams *p) override;
|
||||
|
||||
private:
|
||||
QComboBox *quality_combobox_;
|
||||
@@ -44,4 +44,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // CINEFORMSECTION_H
|
||||
#endif // OAK_CINEFORMSECTION_H
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef CODECSECTION_H
|
||||
#define CODECSECTION_H
|
||||
#ifndef OAK_CODECSECTION_H
|
||||
#define OAK_CODECSECTION_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@@ -34,12 +34,12 @@ class CodecSection : public QWidget {
|
||||
public:
|
||||
CodecSection(QWidget *parent = nullptr);
|
||||
|
||||
virtual void AddOpts(EncodingParams *params)
|
||||
virtual void add_opts(EncodingParams *params)
|
||||
{
|
||||
Q_UNUSED(params)
|
||||
}
|
||||
|
||||
virtual void SetOpts(const EncodingParams *p)
|
||||
virtual void set_opts(const EncodingParams *p)
|
||||
{
|
||||
Q_UNUSED(p)
|
||||
}
|
||||
@@ -47,4 +47,4 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif // CODECSECTION_H
|
||||
#endif // OAK_CODECSECTION_H
|
||||
|
||||
@@ -29,17 +29,17 @@ namespace olive
|
||||
CodecStack::CodecStack(QWidget *parent)
|
||||
: super{ parent }
|
||||
{
|
||||
connect(this, &CodecStack::currentChanged, this, &CodecStack::OnChange);
|
||||
connect(this, &CodecStack::currentChanged, this, &CodecStack::on_change);
|
||||
}
|
||||
|
||||
void CodecStack::addWidget(QWidget *widget)
|
||||
{
|
||||
super::addWidget(widget);
|
||||
|
||||
OnChange(currentIndex());
|
||||
on_change(currentIndex());
|
||||
}
|
||||
|
||||
void CodecStack::OnChange(int index)
|
||||
void CodecStack::on_change(int index)
|
||||
{
|
||||
for (int i = 0; i < count(); i++) {
|
||||
if (i == index) {
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef CODECSTACK_H
|
||||
#define CODECSTACK_H
|
||||
#ifndef OAK_CODECSTACK_H
|
||||
#define OAK_CODECSTACK_H
|
||||
|
||||
#include <QStackedWidget>
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
signals:
|
||||
|
||||
private slots:
|
||||
void OnChange(int index);
|
||||
void on_change(int index);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // CODECSTACK_H
|
||||
#endif // OAK_CODECSTACK_H
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace olive
|
||||
{
|
||||
|
||||
H264Section::H264Section(QWidget *parent)
|
||||
: H264Section(H264CRFSection::kDefaultH264CRF, parent)
|
||||
: H264Section(H264CRFSection::k_default_h264_crf, parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ H264Section::H264Section(int default_crf, QWidget *parent)
|
||||
compression_method_stack_, &QStackedWidget::setCurrentIndex);
|
||||
}
|
||||
|
||||
void H264Section::AddOpts(EncodingParams *params)
|
||||
void H264Section::add_opts(EncodingParams *params)
|
||||
{
|
||||
// FIXME: Implement two-pass
|
||||
|
||||
@@ -113,24 +113,24 @@ void H264Section::AddOpts(EncodingParams *params)
|
||||
params->set_video_option(QStringLiteral("ove_compressionmethod"),
|
||||
QString::number(method));
|
||||
|
||||
if (method == kConstantRateFactor) {
|
||||
if (method == k_constant_rate_factor) {
|
||||
// Simply set CRF value
|
||||
params->set_video_option(QStringLiteral("crf"),
|
||||
QString::number(crf_section_->GetValue()));
|
||||
QString::number(crf_section_->get_value()));
|
||||
|
||||
} else {
|
||||
int64_t target_rate, max_rate, min_rate;
|
||||
|
||||
if (method == kTargetBitRate) {
|
||||
if (method == k_target_bit_rate) {
|
||||
// Use user-supplied values for the bit rate
|
||||
target_rate = bitrate_section_->GetTargetBitRate();
|
||||
target_rate = bitrate_section_->get_target_bit_rate();
|
||||
min_rate = 0;
|
||||
max_rate = bitrate_section_->GetMaximumBitRate();
|
||||
max_rate = bitrate_section_->get_maximum_bit_rate();
|
||||
} else {
|
||||
// Calculate the bit rate from the file size divided by the sequence length in seconds (bits per second)
|
||||
int64_t target_fs = filesize_section_->GetFileSize();
|
||||
int64_t target_fs = filesize_section_->get_file_size();
|
||||
target_rate = qRound64(static_cast<double>(target_fs) /
|
||||
params->GetExportLength().toDouble());
|
||||
params->get_export_length().to_double());
|
||||
min_rate = target_rate;
|
||||
max_rate = target_rate;
|
||||
|
||||
@@ -151,26 +151,26 @@ void H264Section::AddOpts(EncodingParams *params)
|
||||
QString::number(preset_combobox_->currentIndex()));
|
||||
}
|
||||
|
||||
void H264Section::SetOpts(const EncodingParams *p)
|
||||
void H264Section::set_opts(const EncodingParams *p)
|
||||
{
|
||||
CompressionMethod method = static_cast<CompressionMethod>(
|
||||
p->video_option(QStringLiteral("ove_compressionmethod")).toInt());
|
||||
|
||||
compression_method_stack_->setCurrentIndex(method);
|
||||
|
||||
if (method == kConstantRateFactor) {
|
||||
crf_section_->SetValue(p->video_option(QStringLiteral("crf")).toInt());
|
||||
if (method == k_constant_rate_factor) {
|
||||
crf_section_->set_value(p->video_option(QStringLiteral("crf")).toInt());
|
||||
} else {
|
||||
int64_t target_rate = p->video_bit_rate();
|
||||
int64_t max_rate = p->video_max_bit_rate();
|
||||
|
||||
if (method == kTargetBitRate) {
|
||||
if (method == k_target_bit_rate) {
|
||||
// Use user-supplied values for the bit rate
|
||||
bitrate_section_->SetTargetBitRate(target_rate);
|
||||
bitrate_section_->SetMaximumBitRate(max_rate);
|
||||
bitrate_section_->set_target_bit_rate(target_rate);
|
||||
bitrate_section_->set_maximum_bit_rate(max_rate);
|
||||
} else {
|
||||
// Calculate the bit rate from the file size divided by the sequence length in seconds (bits per second)
|
||||
filesize_section_->SetFileSize(
|
||||
filesize_section_->set_file_size(
|
||||
p->video_option(QStringLiteral("ove_targetfilesize"))
|
||||
.toLongLong());
|
||||
}
|
||||
@@ -184,32 +184,32 @@ H264CRFSection::H264CRFSection(int default_crf, QWidget *parent)
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
crf_slider_ = new QSlider(Qt::Horizontal);
|
||||
crf_slider_->setMinimum(kMinimumCRF);
|
||||
crf_slider_->setMaximum(kMaximumCRF);
|
||||
crf_slider_->setMinimum(k_minimum_crf);
|
||||
crf_slider_->setMaximum(k_maximum_crf);
|
||||
crf_slider_->setValue(default_crf);
|
||||
layout->addWidget(crf_slider_);
|
||||
|
||||
IntegerSlider *crf_input = new IntegerSlider();
|
||||
crf_input->setMaximumWidth(QtUtils::QFontMetricsWidth(
|
||||
crf_input->setMaximumWidth(QtUtils::q_font_metrics_width(
|
||||
crf_input->fontMetrics(), QStringLiteral("HHHH")));
|
||||
crf_input->SetMinimum(kMinimumCRF);
|
||||
crf_input->SetMaximum(kMaximumCRF);
|
||||
crf_input->SetValue(default_crf);
|
||||
crf_input->set_minimum(k_minimum_crf);
|
||||
crf_input->set_maximum(k_maximum_crf);
|
||||
crf_input->set_value(default_crf);
|
||||
crf_input->SetDefaultValue(default_crf);
|
||||
layout->addWidget(crf_input);
|
||||
|
||||
connect(crf_slider_, &QSlider::valueChanged, crf_input,
|
||||
&IntegerSlider::SetValue);
|
||||
connect(crf_input, &IntegerSlider::ValueChanged, crf_slider_,
|
||||
&IntegerSlider::set_value);
|
||||
connect(crf_input, &IntegerSlider::value_changed, crf_slider_,
|
||||
&QSlider::setValue);
|
||||
}
|
||||
|
||||
int H264CRFSection::GetValue() const
|
||||
int H264CRFSection::get_value() const
|
||||
{
|
||||
return crf_slider_->value();
|
||||
}
|
||||
|
||||
void H264CRFSection::SetValue(int c)
|
||||
void H264CRFSection::set_value(int c)
|
||||
{
|
||||
crf_slider_->setValue(c);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ H264BitRateSection::H264BitRateSection(QWidget *parent)
|
||||
layout->addWidget(new QLabel(tr("Target Bit Rate (Mbps):")), row, 0);
|
||||
|
||||
target_rate_ = new FloatSlider();
|
||||
target_rate_->SetMinimum(0);
|
||||
target_rate_->set_minimum(0);
|
||||
layout->addWidget(target_rate_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -233,7 +233,7 @@ H264BitRateSection::H264BitRateSection(QWidget *parent)
|
||||
layout->addWidget(new QLabel(tr("Maximum Bit Rate (Mbps):")), row, 0);
|
||||
|
||||
max_rate_ = new FloatSlider();
|
||||
max_rate_->SetMinimum(0);
|
||||
max_rate_->set_minimum(0);
|
||||
layout->addWidget(max_rate_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -244,28 +244,28 @@ H264BitRateSection::H264BitRateSection(QWidget *parent)
|
||||
layout->addWidget(two_pass_box, row, 1);
|
||||
|
||||
// Bit rate defaults
|
||||
target_rate_->SetValue(16.0);
|
||||
max_rate_->SetValue(32.0);
|
||||
target_rate_->set_value(16.0);
|
||||
max_rate_->set_value(32.0);
|
||||
}
|
||||
|
||||
int64_t H264BitRateSection::GetTargetBitRate() const
|
||||
int64_t H264BitRateSection::get_target_bit_rate() const
|
||||
{
|
||||
return qRound64(target_rate_->GetValue() * 1000000.0);
|
||||
return qRound64(target_rate_->get_value() * 1000000.0);
|
||||
}
|
||||
|
||||
void H264BitRateSection::SetTargetBitRate(int64_t b)
|
||||
void H264BitRateSection::set_target_bit_rate(int64_t b)
|
||||
{
|
||||
target_rate_->SetValue(double(b) * 0.000001);
|
||||
target_rate_->set_value(double(b) * 0.000001);
|
||||
}
|
||||
|
||||
int64_t H264BitRateSection::GetMaximumBitRate() const
|
||||
int64_t H264BitRateSection::get_maximum_bit_rate() const
|
||||
{
|
||||
return qRound64(max_rate_->GetValue() * 1000000.0);
|
||||
return qRound64(max_rate_->get_value() * 1000000.0);
|
||||
}
|
||||
|
||||
void H264BitRateSection::SetMaximumBitRate(int64_t b)
|
||||
void H264BitRateSection::set_maximum_bit_rate(int64_t b)
|
||||
{
|
||||
max_rate_->SetValue(double(b) * 0.000001);
|
||||
max_rate_->set_value(double(b) * 0.000001);
|
||||
}
|
||||
|
||||
H264FileSizeSection::H264FileSizeSection(QWidget *parent)
|
||||
@@ -279,7 +279,7 @@ H264FileSizeSection::H264FileSizeSection(QWidget *parent)
|
||||
layout->addWidget(new QLabel(tr("Target File Size (MB):")), row, 0);
|
||||
|
||||
file_size_ = new FloatSlider();
|
||||
file_size_->SetMinimum(0);
|
||||
file_size_->set_minimum(0);
|
||||
layout->addWidget(file_size_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -290,23 +290,23 @@ H264FileSizeSection::H264FileSizeSection(QWidget *parent)
|
||||
layout->addWidget(two_pass_box, row, 1);
|
||||
|
||||
// File size defaults
|
||||
file_size_->SetValue(700.0);
|
||||
file_size_->set_value(700.0);
|
||||
}
|
||||
|
||||
int64_t H264FileSizeSection::GetFileSize() const
|
||||
int64_t H264FileSizeSection::get_file_size() const
|
||||
{
|
||||
// Convert megabytes to BITS
|
||||
return qRound64(file_size_->GetValue() * 1024.0 * 1024.0 * 8.0);
|
||||
return qRound64(file_size_->get_value() * 1024.0 * 1024.0 * 8.0);
|
||||
}
|
||||
|
||||
void H264FileSizeSection::SetFileSize(int64_t f)
|
||||
void H264FileSizeSection::set_file_size(int64_t f)
|
||||
{
|
||||
// Convert bits back to megabytes
|
||||
file_size_->SetValue(double(f) / 8.0 / 1024.0 / 1024.0);
|
||||
file_size_->set_value(double(f) / 8.0 / 1024.0 / 1024.0);
|
||||
}
|
||||
|
||||
H265Section::H265Section(QWidget *parent)
|
||||
: H264Section(H264CRFSection::kDefaultH265CRF, parent)
|
||||
: H264Section(H264CRFSection::k_default_h265_crf, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef H264SECTION_H
|
||||
#define H264SECTION_H
|
||||
#ifndef OAK_H264SECTION_H
|
||||
#define OAK_H264SECTION_H
|
||||
|
||||
#include <QSlider>
|
||||
#include <QStackedWidget>
|
||||
@@ -37,15 +37,15 @@ class H264CRFSection : public QWidget {
|
||||
public:
|
||||
H264CRFSection(int default_crf, QWidget *parent = nullptr);
|
||||
|
||||
int GetValue() const;
|
||||
void SetValue(int c);
|
||||
int get_value() const;
|
||||
void set_value(int c);
|
||||
|
||||
static constexpr int kDefaultH264CRF = 18;
|
||||
static constexpr int kDefaultH265CRF = 23;
|
||||
static constexpr int k_default_h264_crf = 18;
|
||||
static constexpr int k_default_h265_crf = 23;
|
||||
|
||||
private:
|
||||
static constexpr int kMinimumCRF = 0;
|
||||
static constexpr int kMaximumCRF = 51;
|
||||
static constexpr int k_minimum_crf = 0;
|
||||
static constexpr int k_maximum_crf = 51;
|
||||
|
||||
QSlider *crf_slider_;
|
||||
};
|
||||
@@ -58,14 +58,14 @@ public:
|
||||
/**
|
||||
* @brief Get user-selected target bit rate (returns in BITS)
|
||||
*/
|
||||
int64_t GetTargetBitRate() const;
|
||||
void SetTargetBitRate(int64_t b);
|
||||
int64_t get_target_bit_rate() const;
|
||||
void set_target_bit_rate(int64_t b);
|
||||
|
||||
/**
|
||||
* @brief Get user-selected maximum bit rate (returns in BITS)
|
||||
*/
|
||||
int64_t GetMaximumBitRate() const;
|
||||
void SetMaximumBitRate(int64_t b);
|
||||
int64_t get_maximum_bit_rate() const;
|
||||
void set_maximum_bit_rate(int64_t b);
|
||||
|
||||
private:
|
||||
FloatSlider *target_rate_;
|
||||
@@ -81,8 +81,8 @@ public:
|
||||
/**
|
||||
* @brief Returns file size in BITS
|
||||
*/
|
||||
int64_t GetFileSize() const;
|
||||
void SetFileSize(int64_t f);
|
||||
int64_t get_file_size() const;
|
||||
void set_file_size(int64_t f);
|
||||
|
||||
private:
|
||||
FloatSlider *file_size_;
|
||||
@@ -92,17 +92,17 @@ class H264Section : public CodecSection {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum CompressionMethod {
|
||||
kConstantRateFactor,
|
||||
kTargetBitRate,
|
||||
kTargetFileSize
|
||||
k_constant_rate_factor,
|
||||
k_target_bit_rate,
|
||||
k_target_file_size
|
||||
};
|
||||
|
||||
H264Section(QWidget *parent = nullptr);
|
||||
H264Section(int default_crf, QWidget *parent);
|
||||
|
||||
virtual void AddOpts(EncodingParams *params) override;
|
||||
virtual void add_opts(EncodingParams *params) override;
|
||||
|
||||
virtual void SetOpts(const EncodingParams *p) override;
|
||||
virtual void set_opts(const EncodingParams *p) override;
|
||||
|
||||
private:
|
||||
QStackedWidget *compression_method_stack_;
|
||||
@@ -124,4 +124,4 @@ public:
|
||||
|
||||
}
|
||||
|
||||
#endif // H264SECTION_H
|
||||
#endif // OAK_H264SECTION_H
|
||||
|
||||
@@ -39,7 +39,7 @@ ImageSection::ImageSection(QWidget *parent)
|
||||
|
||||
image_sequence_checkbox_ = new QCheckBox();
|
||||
connect(image_sequence_checkbox_, &QCheckBox::toggled, this,
|
||||
&ImageSection::ImageSequenceCheckBoxToggled);
|
||||
&ImageSection::image_sequence_check_box_toggled);
|
||||
layout->addWidget(image_sequence_checkbox_, row, 1);
|
||||
|
||||
row++;
|
||||
@@ -47,15 +47,15 @@ ImageSection::ImageSection(QWidget *parent)
|
||||
layout->addWidget(new QLabel(tr("Frame to Export:")), row, 0);
|
||||
|
||||
frame_slider_ = new RationalSlider();
|
||||
frame_slider_->SetMinimum(0);
|
||||
frame_slider_->SetValue(0);
|
||||
frame_slider_->SetDisplayType(RationalSlider::kTime);
|
||||
connect(frame_slider_, &RationalSlider::ValueChanged, this,
|
||||
&ImageSection::TimeChanged);
|
||||
frame_slider_->set_minimum(0);
|
||||
frame_slider_->set_value(0);
|
||||
frame_slider_->set_display_type(RationalSlider::k_time);
|
||||
connect(frame_slider_, &RationalSlider::value_changed, this,
|
||||
&ImageSection::time_changed);
|
||||
layout->addWidget(frame_slider_, row, 1);
|
||||
}
|
||||
|
||||
void ImageSection::ImageSequenceCheckBoxToggled(bool e)
|
||||
void ImageSection::image_sequence_check_box_toggled(bool e)
|
||||
{
|
||||
frame_slider_->setEnabled(!e);
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef IMAGESECTION_H
|
||||
#define IMAGESECTION_H
|
||||
#ifndef OAK_IMAGESECTION_H
|
||||
#define OAK_IMAGESECTION_H
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
@@ -35,33 +35,33 @@ class ImageSection : public CodecSection {
|
||||
public:
|
||||
ImageSection(QWidget *parent = nullptr);
|
||||
|
||||
bool IsImageSequenceChecked() const
|
||||
bool is_image_sequence_checked() const
|
||||
{
|
||||
return image_sequence_checkbox_->isChecked();
|
||||
}
|
||||
|
||||
void SetImageSequenceChecked(bool e)
|
||||
void set_image_sequence_checked(bool e)
|
||||
{
|
||||
image_sequence_checkbox_->setChecked(e);
|
||||
}
|
||||
|
||||
void SetTimebase(const rational &r)
|
||||
void set_timebase(const Rational &r)
|
||||
{
|
||||
frame_slider_->SetTimebase(r);
|
||||
frame_slider_->set_timebase(r);
|
||||
}
|
||||
|
||||
rational GetTime() const
|
||||
Rational get_time() const
|
||||
{
|
||||
return frame_slider_->GetValue();
|
||||
return frame_slider_->get_value();
|
||||
}
|
||||
|
||||
void SetTime(const rational &t)
|
||||
void set_time(const Rational &t)
|
||||
{
|
||||
frame_slider_->SetValue(t);
|
||||
frame_slider_->set_value(t);
|
||||
}
|
||||
|
||||
signals:
|
||||
void TimeChanged(const rational &t);
|
||||
void time_changed(const Rational &t);
|
||||
|
||||
private:
|
||||
QCheckBox *image_sequence_checkbox_;
|
||||
@@ -69,9 +69,9 @@ private:
|
||||
RationalSlider *frame_slider_;
|
||||
|
||||
private slots:
|
||||
void ImageSequenceCheckBoxToggled(bool e);
|
||||
void image_sequence_check_box_toggled(bool e);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // IMAGESECTION_H
|
||||
#endif // OAK_IMAGESECTION_H
|
||||
|
||||
Reference in New Issue
Block a user