change: change code style to Linux style except indent.
This commit is contained in:
@@ -28,145 +28,156 @@
|
||||
#include "dialog/sequence/presetmanager.h"
|
||||
#include "render/videoparams.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
class SequencePreset : public Preset {
|
||||
public:
|
||||
SequencePreset() = default;
|
||||
SequencePreset() = default;
|
||||
|
||||
SequencePreset(const QString& name,
|
||||
int width,
|
||||
int height,
|
||||
const rational& frame_rate,
|
||||
const rational& pixel_aspect,
|
||||
VideoParams::Interlacing interlacing,
|
||||
int sample_rate,
|
||||
AVChannelLayout &channel_layout,
|
||||
int preview_divider,
|
||||
PixelFormat preview_format,
|
||||
bool preview_autocache) :
|
||||
width_(width),
|
||||
height_(height),
|
||||
frame_rate_(frame_rate),
|
||||
pixel_aspect_(pixel_aspect),
|
||||
interlacing_(interlacing),
|
||||
sample_rate_(sample_rate),
|
||||
channel_layout_(channel_layout),
|
||||
preview_divider_(preview_divider),
|
||||
preview_format_(preview_format),
|
||||
preview_autocache_(preview_autocache)
|
||||
{
|
||||
SetName(name);
|
||||
}
|
||||
SequencePreset(const QString &name, int width, int height,
|
||||
const rational &frame_rate, const rational &pixel_aspect,
|
||||
VideoParams::Interlacing interlacing, int sample_rate,
|
||||
AVChannelLayout &channel_layout, int preview_divider,
|
||||
PixelFormat preview_format, bool preview_autocache)
|
||||
: width_(width)
|
||||
, height_(height)
|
||||
, frame_rate_(frame_rate)
|
||||
, pixel_aspect_(pixel_aspect)
|
||||
, interlacing_(interlacing)
|
||||
, sample_rate_(sample_rate)
|
||||
, channel_layout_(channel_layout)
|
||||
, preview_divider_(preview_divider)
|
||||
, preview_format_(preview_format)
|
||||
, preview_autocache_(preview_autocache)
|
||||
{
|
||||
SetName(name);
|
||||
}
|
||||
|
||||
virtual void Load(QXmlStreamReader* reader) override
|
||||
{
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
if (reader->name() == QStringLiteral("name")) {
|
||||
SetName(reader->readElementText());
|
||||
} else if (reader->name() == QStringLiteral("width")) {
|
||||
width_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("height")) {
|
||||
height_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("framerate")) {
|
||||
frame_rate_ = rational::fromString(reader->readElementText().toStdString());
|
||||
} else if (reader->name() == QStringLiteral("pixelaspect")) {
|
||||
pixel_aspect_ = rational::fromString(reader->readElementText().toStdString());
|
||||
} else if (reader->name() == QStringLiteral("interlacing")) {
|
||||
interlacing_ = static_cast<VideoParams::Interlacing>(reader->readElementText().toInt());
|
||||
} else if (reader->name() == QStringLiteral("samplerate")) {
|
||||
sample_rate_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("chlayout")) {
|
||||
channel_layout_.u.mask = reader->readElementText().toULongLong();
|
||||
} else if (reader->name() == QStringLiteral("divider")) {
|
||||
preview_divider_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("format")) {
|
||||
preview_format_ = static_cast<PixelFormat::Format>(reader->readElementText().toInt());
|
||||
} else if (reader->name() == QStringLiteral("autocache")) {
|
||||
preview_autocache_ = reader->readElementText().toInt();
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void Load(QXmlStreamReader *reader) override
|
||||
{
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
if (reader->name() == QStringLiteral("name")) {
|
||||
SetName(reader->readElementText());
|
||||
} else if (reader->name() == QStringLiteral("width")) {
|
||||
width_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("height")) {
|
||||
height_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("framerate")) {
|
||||
frame_rate_ = rational::fromString(
|
||||
reader->readElementText().toStdString());
|
||||
} else if (reader->name() == QStringLiteral("pixelaspect")) {
|
||||
pixel_aspect_ = rational::fromString(
|
||||
reader->readElementText().toStdString());
|
||||
} else if (reader->name() == QStringLiteral("interlacing")) {
|
||||
interlacing_ = static_cast<VideoParams::Interlacing>(
|
||||
reader->readElementText().toInt());
|
||||
} else if (reader->name() == QStringLiteral("samplerate")) {
|
||||
sample_rate_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("chlayout")) {
|
||||
channel_layout_.u.mask =
|
||||
reader->readElementText().toULongLong();
|
||||
} else if (reader->name() == QStringLiteral("divider")) {
|
||||
preview_divider_ = reader->readElementText().toInt();
|
||||
} else if (reader->name() == QStringLiteral("format")) {
|
||||
preview_format_ = static_cast<PixelFormat::Format>(
|
||||
reader->readElementText().toInt());
|
||||
} else if (reader->name() == QStringLiteral("autocache")) {
|
||||
preview_autocache_ = reader->readElementText().toInt();
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Save(QXmlStreamWriter* writer) const override
|
||||
{
|
||||
writer->writeTextElement(QStringLiteral("name"), GetName());
|
||||
writer->writeTextElement(QStringLiteral("width"), QString::number(width_));
|
||||
writer->writeTextElement(QStringLiteral("height"), QString::number(height_));
|
||||
writer->writeTextElement(QStringLiteral("framerate"), QString::fromStdString(frame_rate_.toString()));
|
||||
writer->writeTextElement(QStringLiteral("pixelaspect"), QString::fromStdString(pixel_aspect_.toString()));
|
||||
writer->writeTextElement(QStringLiteral("interlacing_"), QString::number(interlacing_));
|
||||
writer->writeTextElement(QStringLiteral("samplerate"), QString::number(sample_rate_));
|
||||
writer->writeTextElement(QStringLiteral("chlayout"), QString::number(channel_layout_.u.mask));
|
||||
writer->writeTextElement(QStringLiteral("divider"), QString::number(preview_divider_));
|
||||
writer->writeTextElement(QStringLiteral("format"), QString::number(preview_format_));
|
||||
writer->writeTextElement(QStringLiteral("autocache"), QString::number(preview_autocache_));
|
||||
}
|
||||
virtual void Save(QXmlStreamWriter *writer) const override
|
||||
{
|
||||
writer->writeTextElement(QStringLiteral("name"), GetName());
|
||||
writer->writeTextElement(QStringLiteral("width"),
|
||||
QString::number(width_));
|
||||
writer->writeTextElement(QStringLiteral("height"),
|
||||
QString::number(height_));
|
||||
writer->writeTextElement(
|
||||
QStringLiteral("framerate"),
|
||||
QString::fromStdString(frame_rate_.toString()));
|
||||
writer->writeTextElement(
|
||||
QStringLiteral("pixelaspect"),
|
||||
QString::fromStdString(pixel_aspect_.toString()));
|
||||
writer->writeTextElement(QStringLiteral("interlacing_"),
|
||||
QString::number(interlacing_));
|
||||
writer->writeTextElement(QStringLiteral("samplerate"),
|
||||
QString::number(sample_rate_));
|
||||
writer->writeTextElement(QStringLiteral("chlayout"),
|
||||
QString::number(channel_layout_.u.mask));
|
||||
writer->writeTextElement(QStringLiteral("divider"),
|
||||
QString::number(preview_divider_));
|
||||
writer->writeTextElement(QStringLiteral("format"),
|
||||
QString::number(preview_format_));
|
||||
writer->writeTextElement(QStringLiteral("autocache"),
|
||||
QString::number(preview_autocache_));
|
||||
}
|
||||
|
||||
int width() const
|
||||
{
|
||||
return width_;
|
||||
}
|
||||
int width() const
|
||||
{
|
||||
return width_;
|
||||
}
|
||||
|
||||
int height() const
|
||||
{
|
||||
return height_;
|
||||
}
|
||||
int height() const
|
||||
{
|
||||
return height_;
|
||||
}
|
||||
|
||||
const rational& frame_rate() const
|
||||
{
|
||||
return frame_rate_;
|
||||
}
|
||||
const rational &frame_rate() const
|
||||
{
|
||||
return frame_rate_;
|
||||
}
|
||||
|
||||
const rational& pixel_aspect() const
|
||||
{
|
||||
return pixel_aspect_;
|
||||
}
|
||||
const rational &pixel_aspect() const
|
||||
{
|
||||
return pixel_aspect_;
|
||||
}
|
||||
|
||||
VideoParams::Interlacing interlacing() const
|
||||
{
|
||||
return interlacing_;
|
||||
}
|
||||
VideoParams::Interlacing interlacing() const
|
||||
{
|
||||
return interlacing_;
|
||||
}
|
||||
|
||||
int sample_rate() const
|
||||
{
|
||||
return sample_rate_;
|
||||
}
|
||||
int sample_rate() const
|
||||
{
|
||||
return sample_rate_;
|
||||
}
|
||||
|
||||
AVChannelLayout channel_layout() const
|
||||
{
|
||||
return channel_layout_;
|
||||
}
|
||||
AVChannelLayout channel_layout() const
|
||||
{
|
||||
return channel_layout_;
|
||||
}
|
||||
|
||||
int preview_divider() const
|
||||
{
|
||||
return preview_divider_;
|
||||
}
|
||||
int preview_divider() const
|
||||
{
|
||||
return preview_divider_;
|
||||
}
|
||||
|
||||
PixelFormat preview_format() const
|
||||
{
|
||||
return preview_format_;
|
||||
}
|
||||
PixelFormat preview_format() const
|
||||
{
|
||||
return preview_format_;
|
||||
}
|
||||
|
||||
bool preview_autocache() const
|
||||
{
|
||||
return preview_autocache_;
|
||||
}
|
||||
bool preview_autocache() const
|
||||
{
|
||||
return preview_autocache_;
|
||||
}
|
||||
|
||||
private:
|
||||
int width_;
|
||||
int height_;
|
||||
rational frame_rate_;
|
||||
rational pixel_aspect_;
|
||||
VideoParams::Interlacing interlacing_;
|
||||
int sample_rate_;
|
||||
AVChannelLayout channel_layout_;
|
||||
int preview_divider_;
|
||||
PixelFormat preview_format_;
|
||||
bool preview_autocache_;
|
||||
|
||||
int width_;
|
||||
int height_;
|
||||
rational frame_rate_;
|
||||
rational pixel_aspect_;
|
||||
VideoParams::Interlacing interlacing_;
|
||||
int sample_rate_;
|
||||
AVChannelLayout channel_layout_;
|
||||
int preview_divider_;
|
||||
PixelFormat preview_format_;
|
||||
bool preview_autocache_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user