zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 44b58574e307f212eed2010e7f040681ebdcfb61
parent c9aeba1dc230ab62deaf95ff0f7d501074d0cc59
Author: Friedolino <mkirchn@freenet.de>
Date:   Tue, 10 Mar 2020 19:24:52 +0100

part stores its xiz filename, /savexml saves there

Diffstat:
Msrc/Misc/Part.cpp | 13+++++++++++--
Msrc/Misc/Part.h | 1+
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp @@ -165,8 +165,12 @@ static const Ports partPorts = { //d.broadcast("/damage", "s", part_loc); }}, - - + {"savexml:", rProp(internal) rDoc("Save Part to the file it has been loaded from"), 0, + [](const char *, RtData &d) + { + Part *p = (Part*)d.obj; + p->saveXML(p->loaded_file); + }}, //{"kit#16::T:F", "::Enables or disables kit item", 0, // [](const char *m, RtData &d) { // auto loc = d.loc; @@ -1077,6 +1081,7 @@ int Part::saveXML(const char *filename) xml.endbranch(); int result = xml.saveXMLfile(filename, gzip_compression); + strcpy(loaded_file,filename); return result; } @@ -1089,6 +1094,10 @@ int Part::loadXMLinstrument(const char *filename) if(xml.enterbranch("INSTRUMENT") == 0) return -10; + + // store filename in member variable + strcpy(loaded_file,filename); + getfromXMLinstrument(xml); xml.exitbranch(); diff --git a/src/Misc/Part.h b/src/Misc/Part.h @@ -173,6 +173,7 @@ class Part bool Pefxbypass[NUM_PART_EFX]; //if the effects are bypassed int lastnote; + char loaded_file[256]; const static rtosc::Ports &ports;