some finishing touches
This commit is contained in:
+2
-3
@@ -540,15 +540,13 @@ void Effect::load(QXmlStreamReader& stream) {
|
||||
EffectField* field = row->Field(field_number);
|
||||
|
||||
// get current field value
|
||||
/*
|
||||
for (int k=0;k<stream.attributes().size();k++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(k);
|
||||
if (attr.name() == "value") {
|
||||
field->SetCurrentValue(field->GetValueFromString(attr.value().toString()));
|
||||
field->persistent_data_ = field->ConvertStringToValue(attr.value().toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
while (!stream.atEnd() && !(stream.name() == "field" && stream.isEndElement())) {
|
||||
stream.readNext();
|
||||
@@ -609,6 +607,7 @@ void Effect::save(QXmlStreamWriter& stream) {
|
||||
if (!field->id().isEmpty()) {
|
||||
stream.writeStartElement("field"); // field
|
||||
stream.writeAttribute("id", field->id());
|
||||
stream.writeAttribute("value", field->ConvertValueToString(field->persistent_data_));
|
||||
for (int k=0;k<field->keyframes.size();k++) {
|
||||
const EffectKeyframe& key = field->keyframes.at(k);
|
||||
stream.writeStartElement("key");
|
||||
|
||||
@@ -241,7 +241,9 @@ void EffectField::SetValueAt(double time, const QVariant &value)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
persistent_data_ = value;
|
||||
|
||||
}
|
||||
|
||||
emit Changed();
|
||||
|
||||
@@ -34,6 +34,8 @@ void BoolField::UpdateWidgetValue(QWidget *widget, double timecode)
|
||||
cb->setChecked(GetBoolAt(timecode));
|
||||
|
||||
cb->blockSignals(false);
|
||||
|
||||
emit Toggled(cb->isChecked());
|
||||
}
|
||||
|
||||
QVariant BoolField::ConvertStringToValue(const QString &s)
|
||||
|
||||
@@ -45,6 +45,8 @@ void ComboField::UpdateWidgetValue(QWidget *widget, double timecode)
|
||||
cb->blockSignals(true);
|
||||
cb->setCurrentIndex(i);
|
||||
cb->blockSignals(false);
|
||||
|
||||
emit DataChanged(data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
virtual void UpdateWidgetValue(QWidget* widget, double timecode) override;
|
||||
|
||||
signals:
|
||||
void IndexChanged(int i);
|
||||
void DataChanged(const QVariant&);
|
||||
|
||||
private:
|
||||
QVector<ComboFieldItem> items_;
|
||||
|
||||
@@ -74,6 +74,7 @@ QWidget *DoubleField::CreateWidget()
|
||||
ls->SetDisplayType(display_type_);
|
||||
ls->SetFrameRate(frame_rate_);
|
||||
|
||||
//qDebug() << "";
|
||||
ls->setEnabled(IsEnabled());
|
||||
|
||||
connect(ls, SIGNAL(valueChanged(double)), this, SLOT(UpdateFromWidget(double)));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "stringfield.h"
|
||||
|
||||
#include <QtMath>
|
||||
#include <QDebug>
|
||||
|
||||
#include "ui/texteditex.h"
|
||||
#include "global/config.h"
|
||||
|
||||
@@ -61,7 +61,7 @@ SolidEffect::SolidEffect(Clip* c, const EffectMeta* em) :
|
||||
checkerboard_size_field->SetMinimum(1);
|
||||
checkerboard_size_field->SetDefault(10);
|
||||
|
||||
connect(solid_type, SIGNAL(IndexChanged(int)), this, SLOT(ui_update(int)));
|
||||
connect(solid_type, SIGNAL(DataChanged(const QVariant&)), this, SLOT(ui_update(const QVariant&)));
|
||||
|
||||
// Set default UI
|
||||
solid_type->SetValueAt(0, SOLID_TYPE_COLOR);
|
||||
@@ -202,7 +202,9 @@ void SolidEffect::SetType(SolidEffect::SolidType type)
|
||||
solid_type->SetValueAt(0, type);
|
||||
}
|
||||
|
||||
void SolidEffect::ui_update(int i) {
|
||||
void SolidEffect::ui_update(const QVariant& d) {
|
||||
int i = d.toInt();
|
||||
|
||||
solid_color_field->SetEnabled(i == SOLID_TYPE_COLOR || i == SOLID_TYPE_CHECKERBOARD);
|
||||
checkerboard_size_field->SetEnabled(i == SOLID_TYPE_CHECKERBOARD);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
void SetType(SolidType type);
|
||||
private slots:
|
||||
void ui_update(int);
|
||||
void ui_update(const QVariant &d);
|
||||
private:
|
||||
ComboField* solid_type;
|
||||
ColorField* solid_color_field;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
class TransformEffect : public Effect {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TransformEffect(Clip* c, const EffectMeta* em);
|
||||
TransformEffect(Clip* c, const EffectMeta* em);
|
||||
void refresh();
|
||||
void process_coords(double timecode, GLTextureCoords& coords, int data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user