summaryrefslogtreecommitdiff
path: root/src/projectserialiser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-07-27 13:39:32 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2024-07-27 13:39:32 +0200
commitfc29354d86e6a8b5601e92405b89a1da27406ce7 (patch)
treee31069154ad5bd9497764b6205dd4d3a411b40eb /src/projectserialiser.cc
parent329110e3230a6518f024c612842b04afdea1cd03 (diff)
WIP
Diffstat (limited to 'src/projectserialiser.cc')
-rw-r--r--src/projectserialiser.cc36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/projectserialiser.cc b/src/projectserialiser.cc
index 6a204eb..8d9d824 100644
--- a/src/projectserialiser.cc
+++ b/src/projectserialiser.cc
@@ -188,15 +188,16 @@ QString ProjectSerialiser::serialise(const Project& project)
file.setAttribute("channel_map_id", audiofile.getChannelMapId());
file.setAttribute("master", i.master_file == audiofile.getAbsoluteFile());
file.setAttribute("main", audiofile.getMainChannel() ? "true" : "false");
+ file.setAttribute("pos", audiofile.getPositionChannel() ? "true" : "false");
file_list.appendChild(file);
}
auto regions = doc.createElement("regions");
- regions.setAttribute("nextid", i.selections.nextid);
- regions.setAttribute("act", i.selections.act);
+ regions.setAttribute("nextid", i.ranges.nextid);
+ regions.setAttribute("act", i.ranges.act);
instrument.appendChild(regions);
- for(auto r = i.selections.sels.begin(); r != i.selections.sels.end(); ++r)
+ for(auto r = i.ranges.sels.begin(); r != i.ranges.sels.end(); ++r)
{
auto region = doc.createElement("region");
region.setAttribute("id", (int)r.key());
@@ -205,6 +206,7 @@ QString ProjectSerialiser::serialise(const Project& project)
region.setAttribute("fadein", (int)r.value().fadein);
region.setAttribute("fadeout", (int)r.value().fadeout);
region.setAttribute("energy", r.value().energy);
+ region.setAttribute("position", r.value().position);
region.setAttribute("name", r.value().name);
regions.appendChild(region);
}
@@ -257,7 +259,7 @@ bool ProjectSerialiser::deserialise(const QString& data, Project& project)
for(auto& instrument : instruments)
{
auto id = instrument["id"].toInt();
- project.instruments.emplace_back(Instrument(project, id));
+ project.instruments.emplace_back(project, id);
auto& instr = project.instruments.back();
instr.instrument_name = instrument("instrument_name").text();
@@ -273,6 +275,7 @@ bool ProjectSerialiser::deserialise(const QString& data, Project& project)
audiofile.name = file["name"];
audiofile.channel_map_id = file["channel_map_id"].toInt();
audiofile.main_channel = file["main"] == "true";
+ audiofile.pos_channel = file["pos"] == "true";
if(file["master"] == "1")
{
@@ -292,20 +295,21 @@ bool ProjectSerialiser::deserialise(const QString& data, Project& project)
instr.prefix = instrument("prefix").text();
- auto selections = instrument("regions");
- instr.selections.nextid = selections["nextid"].toInt();
- instr.selections.act = selections["act"].toInt();
+ auto ranges = instrument("regions");
+ instr.ranges.nextid = ranges["nextid"].toInt();
+ instr.ranges.act = ranges["act"].toInt();
- for(auto& selection : selections.children())
+ for(auto& range : ranges.children())
{
- Selection s;
- s.from = selection["from"].toInt();
- s.to = selection["to"].toInt();
- s.fadein = selection["fadein"].toInt();
- s.fadeout = selection["fadeout"].toInt();
- s.energy = selection["energy"].toFloat();
- s.name = selection["name"];
- instr.selections.sels[selection["id"].toInt()] = s;
+ Range s;
+ s.from = range["from"].toInt();
+ s.to = range["to"].toInt();
+ s.fadein = range["fadein"].toInt();
+ s.fadeout = range["fadeout"].toInt();
+ s.energy = range["energy"].toFloat();
+ s.position = range["position"].toFloat();
+ s.name = range["name"];
+ instr.ranges.sels[range["id"].toInt()] = s;
}
}