implemented auto-scaling

This commit is contained in:
itsmattkc
2018-09-24 14:40:58 +10:00
parent 64d6c3a874
commit b88468f9e3
11 changed files with 88 additions and 7 deletions
+9 -1
View File
@@ -782,7 +782,11 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
//<clip id="0" name="Brock_Drying_Pan.gif" clipin="0" in="44" out="144" track="-1" r="192" g="128" b="128" media="2" stream="0">
int media_id, stream_id;
Clip* c = new Clip(s);
c->media = NULL;
// backwards compatibility code
c->autoscale = false;
c->media = NULL;
for (int j=0;j<stream.attributes().size();j++) {
const QXmlStreamAttribute& attr = stream.attributes().at(j);
if (attr.name() == "name") {
@@ -803,6 +807,8 @@ bool Project::load_worker(QFile& f, QXmlStreamReader& stream, int type) {
c->color_g = attr.value().toInt();
} else if (attr.name() == "b") {
c->color_b = attr.value().toInt();
} else if (attr.name() == "autoscale") {
c->autoscale = (attr.value() == "1");
} else if (attr.name() == "type") {
c->media_type = attr.value().toInt();
} else if (attr.name() == "media") {
@@ -1107,6 +1113,8 @@ void Project::save_folder(QXmlStreamWriter& stream, QTreeWidgetItem* parent, int
stream.writeAttribute("g", QString::number(c->color_g));
stream.writeAttribute("b", QString::number(c->color_b));
stream.writeAttribute("autoscale", QString::number(c->autoscale));
stream.writeAttribute("type", QString::number(c->media_type));
switch (c->media_type) {
case MEDIA_TYPE_FOOTAGE: