#include "nodeshader.h" NodeShader::NodeShader(Clip* c, const QString &name, const QString &id, const QString &category, const QString &filename) : OldEffectNode(c), name_(name), id_(id), category_(category), filename_(filename) { if (!filename_.isEmpty()) { QFile effect_file(filename_); if (effect_file.open(QFile::ReadOnly)) { QXmlStreamReader reader(&effect_file); while (!reader.atEnd()) { if (reader.name() == "field" && reader.isStartElement()) { int type = olive::nodes::kInvalid; QString id; QString name; // get field type const QXmlStreamAttributes& attributes = reader.attributes(); for (int i=0;iSetDefault(attr.value().toDouble()); } else if (attr.name() == "min") { double_field->SetMinimum(attr.value().toDouble()); } else if (attr.name() == "max") { double_field->SetMaximum(attr.value().toDouble()); } } field = double_field; } break; case olive::nodes::kColor: { QColor color; field = new ColorInput(this, id, name); for (int i=0;iSetValueAt(0, color); } break; case olive::nodes::kString: field = new StringInput(this, id, name); for (int i=0;iSetValueAt(0, attr.value().toString()); } } break; case olive::nodes::kBoolean: field = new BoolInput(this, id, name); for (int i=0;iSetValueAt(0, attr.value() == "1"); } } break; case olive::nodes::kCombo: { ComboInput* combo_field = new ComboInput(this, id, name); int combo_default_index = 0; for (int i=0;iAddItem(reader.text().toString(), combo_item_count); combo_item_count++; } } combo_field->SetValueAt(0, combo_default_index); field = combo_field; } break; case olive::nodes::kFont: field = new FontInput(this, id, name); for (int i=0;iSetValueAt(0, attr.value().toString()); } } break; case olive::nodes::kFile: field = new FileInput(this, id, name); for (int i=0;iSetValueAt(0, attr.value().toString()); } } break; } } } else if (reader.name() == "shader" && reader.isStartElement()) { SetFlags(Flags() | ShaderFlag); const QXmlStreamAttributes& attributes = reader.attributes(); for (int i=0;i