fixed cache interrupts

This commit is contained in:
itsmattkc
2018-11-22 14:01:38 +11:00
parent 30baa45417
commit 6da9438509
19 changed files with 116 additions and 99 deletions
+10 -5
View File
@@ -1076,7 +1076,8 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
int effect_id = -1;
QString effect_name;
bool effect_enabled = true;
long effect_length = -1;
long effect_pre_length = -1;
long effect_post_length = -1;
for (int j=0;j<stream.attributes().size();j++) {
const QXmlStreamAttribute& attr = stream.attributes().at(j);
if (attr.name() == "id") {
@@ -1086,7 +1087,9 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
} else if (attr.name() == "name") {
effect_name = attr.value().toString();
} else if (attr.name() == "length") {
effect_length = attr.value().toLong();
effect_pre_length = attr.value().toLong();
} else if (attr.name() == "postlength") { // backwards compatibility
effect_post_length = attr.value().toLong();
}
}
@@ -1132,9 +1135,12 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
QString tag = stream.name().toString();
if (tag == "opening" || tag == "closing") {
int transition_index = create_transition(c, meta);
// TODO replace NULL/s with somethingn else
int transition_index = create_transition(c, NULL, meta);
Transition* t = c->sequence->transitions.at(transition_index);
if (effect_length > -1) t->length = effect_length;
if (effect_pre_length > -1) t->length = effect_pre_length;
if (effect_post_length > -1) t->length2 = effect_post_length;
t->set_enabled(effect_enabled);
t->load(stream);
@@ -1145,7 +1151,6 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
}
} else {
Effect* e = create_effect(c, meta);
if (effect_length > -1) e->length = effect_length;
e->set_enabled(effect_enabled);
e->load(stream);