commit b63fc32b21ef33f2aed72f7ecf356a644ffd2cef
parent 26ba603ccb7e00bdb0645b2f57ce8f12145f1dbd
Author: fundamental <[email protected]>
Date: Fri, 14 Jul 2017 21:43:32 -0400
Add Automation Saving To .xmz
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -631,7 +631,7 @@ void Master::saveAutomation(XMLwrapper &xml, const rtosc::AutomationMgr &midi)
for(int i=0; i<midi.nslots; ++i) {
const auto &slot = midi.slots[i];
if(!slot.used)
- return;
+ continue;
xml.beginbranch("slot", i);
XmlNode params("params");
params["midi-cc"] = to_s(slot.midi_cc);
@@ -639,7 +639,7 @@ void Master::saveAutomation(XMLwrapper &xml, const rtosc::AutomationMgr &midi)
for(int j=0; j<midi.per_slot; ++j) {
const auto &au = slot.automations[j];
if(!au.used)
- return;
+ continue;
xml.beginbranch("automation", j);
XmlNode automation("params");
automation["path"] = au.param_path;
@@ -1418,6 +1418,8 @@ void Master::add2XML(XMLwrapper& xml)
microtonal.add2XML(xml);
xml.endbranch();
+ saveAutomation(xml, automate);
+
for(int npart = 0; npart < NUM_MIDI_PARTS; ++npart) {
xml.beginbranch("PART", npart);
part[npart]->add2XML(xml);
@@ -1542,6 +1544,8 @@ void Master::getfromXML(XMLwrapper& xml)
xml.exitbranch();
}
+ loadAutomation(xml, automate);
+
sysefx[0]->changeeffect(0);
if(xml.enterbranch("SYSTEM_EFFECTS")) {
for(int nefx = 0; nefx < NUM_SYS_EFX; ++nefx) {
diff --git a/src/Tests/guitar-adnote.xmz b/src/Tests/guitar-adnote.xmz
@@ -28,6 +28,9 @@ version-revision="1" ZynAddSubFX-author="Nasca Octavian Paul">
<par name="a_note" value="69" />
<par_real name="a_freq" value="440" exact_value="0x43DC0000" />
</MICROTONAL>
+<automation>
+<mgr-info nslots="16" nautomations="4" ncontrol="8" />
+</automation>
<PART id="0">
<par_bool name="enabled" value="yes" />
<par name="volume" value="96" />