moved serialization
This commit is contained in:
@@ -195,6 +195,24 @@ void Track::SetTrackHeight(const double &height)
|
||||
emit TrackHeightChanged(track_height_);
|
||||
}
|
||||
|
||||
bool Track::LoadCustom(QXmlStreamReader *reader, SerializedData *data)
|
||||
{
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
if (reader->name() == QStringLiteral("height")) {
|
||||
this->SetTrackHeight(reader->readElementText().toDouble());
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Track::SaveCustom(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writer->writeTextElement(QStringLiteral("height"), QString::number(this->GetTrackHeight()));
|
||||
}
|
||||
|
||||
void Track::InputValueChangedEvent(const QString &input, int element)
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
|
||||
@@ -102,6 +102,9 @@ public:
|
||||
SetTrackHeight(PixelHeightToInternalHeight(h));
|
||||
}
|
||||
|
||||
virtual bool LoadCustom(QXmlStreamReader *reader, SerializedData *data) override;
|
||||
virtual void SaveCustom(QXmlStreamWriter *writer) const override;
|
||||
|
||||
static int InternalHeightToPixelHeight(double h)
|
||||
{
|
||||
return qRound(h * QFontMetrics(QFont()).height());
|
||||
|
||||
@@ -430,6 +430,36 @@ void ViewerOutput::Value(const NodeValueRow &value, const NodeGlobals &globals,
|
||||
}
|
||||
}
|
||||
|
||||
bool ViewerOutput::LoadCustom(QXmlStreamReader *reader, SerializedData *data)
|
||||
{
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
if (reader->name() == QStringLiteral("markers")) {
|
||||
if (!this->GetMarkers()->load(reader)) {
|
||||
return false;
|
||||
}
|
||||
} else if (reader->name() == QStringLiteral("workarea")) {
|
||||
if (!this->GetWorkArea()->load(reader)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ViewerOutput::SaveCustom(QXmlStreamWriter *writer) const
|
||||
{
|
||||
writer->writeStartElement(QStringLiteral("workarea"));
|
||||
this->GetWorkArea()->save(writer);
|
||||
writer->writeEndElement(); // workarea
|
||||
|
||||
writer->writeStartElement(QStringLiteral("markers"));
|
||||
this->GetMarkers()->save(writer);
|
||||
writer->writeEndElement(); // markers
|
||||
}
|
||||
|
||||
void ViewerOutput::InputValueChangedEvent(const QString &input, int element)
|
||||
{
|
||||
if (element == 0) {
|
||||
|
||||
@@ -191,6 +191,9 @@ public:
|
||||
const EncodingParams &GetLastUsedEncodingParams() const { return last_used_encoding_params_; }
|
||||
void SetLastUsedEncodingParams(const EncodingParams &p) { last_used_encoding_params_ = p; }
|
||||
|
||||
virtual bool LoadCustom(QXmlStreamReader *reader, SerializedData *data) override;
|
||||
virtual void SaveCustom(QXmlStreamWriter *writer) const override;
|
||||
|
||||
static const QString kVideoParamsInput;
|
||||
static const QString kAudioParamsInput;
|
||||
static const QString kSubtitleParamsInput;
|
||||
|
||||
Reference in New Issue
Block a user