finished new/load/save
This commit is contained in:
@@ -53,6 +53,7 @@ public:
|
||||
VolumeEffect(Clip* c);
|
||||
void process_audio(uint8_t* samples, int nb_bytes);
|
||||
Effect* copy();
|
||||
void load(QXmlStreamReader* stream);
|
||||
void save(QXmlStreamWriter* stream);
|
||||
|
||||
QSpinBox* volume_val;
|
||||
@@ -63,6 +64,7 @@ public:
|
||||
PanEffect(Clip* c);
|
||||
void process_audio(uint8_t* samples, int nb_bytes);
|
||||
Effect* copy();
|
||||
void load(QXmlStreamReader* stream);
|
||||
void save(QXmlStreamWriter* stream);
|
||||
|
||||
QSpinBox* pan_val;
|
||||
|
||||
@@ -31,6 +31,16 @@ Effect* PanEffect::copy() {
|
||||
return p;
|
||||
}
|
||||
|
||||
void PanEffect::load(QXmlStreamReader *stream) {
|
||||
while (!(stream->isEndElement() && stream->name() == "effect") && !stream->atEnd()) {
|
||||
stream->readNext();
|
||||
if (stream->isStartElement() && stream->name() == "pan") {
|
||||
stream->readNext();
|
||||
pan_val->setValue(stream->text().toInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PanEffect::save(QXmlStreamWriter *stream) {
|
||||
stream->writeTextElement("pan", QString::number(pan_val->value()));
|
||||
}
|
||||
|
||||
@@ -31,6 +31,16 @@ Effect* VolumeEffect::copy() {
|
||||
return v;
|
||||
}
|
||||
|
||||
void VolumeEffect::load(QXmlStreamReader *stream) {
|
||||
while (!(stream->isEndElement() && stream->name() == "effect") && !stream->atEnd()) {
|
||||
stream->readNext();
|
||||
if (stream->isStartElement() && stream->name() == "volume") {
|
||||
stream->readNext();
|
||||
volume_val->setValue(stream->text().toInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VolumeEffect::save(QXmlStreamWriter *stream) {
|
||||
stream->writeTextElement("volume", QString::number(volume_val->value()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user