From e40fc849149dd97c248866a4a1d026dda5e57b62 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 7 Mar 2011 19:01:11 +0000 Subject: clean3 --- .../synti/zynaddsubfx/Params/EnvelopeParams.C | 227 +++++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 attic/muse_qt4_evolution/synti/zynaddsubfx/Params/EnvelopeParams.C (limited to 'attic/muse_qt4_evolution/synti/zynaddsubfx/Params/EnvelopeParams.C') diff --git a/attic/muse_qt4_evolution/synti/zynaddsubfx/Params/EnvelopeParams.C b/attic/muse_qt4_evolution/synti/zynaddsubfx/Params/EnvelopeParams.C new file mode 100644 index 00000000..074d6aee --- /dev/null +++ b/attic/muse_qt4_evolution/synti/zynaddsubfx/Params/EnvelopeParams.C @@ -0,0 +1,227 @@ +/* + ZynAddSubFX - a software synthesizer + + EnvelopeParams.C - Parameters for Envelope + Copyright (C) 2002-2005 Nasca Octavian Paul + Author: Nasca Octavian Paul + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License (version 2) for more details. + + You should have received a copy of the GNU General Public License (version 2) + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include + +#include +#include +#include "EnvelopeParams.h" + +EnvelopeParams::EnvelopeParams(unsigned char Penvstretch_,unsigned char Pforcedrelease_):Presets(){ + int i; + + PA_dt=10;PD_dt=10;PR_dt=10;PA_val=64;PD_val=64;PS_val=64;PR_val=64; + + for (i=0;iaddparbool("free_mode",Pfreemode); + xml->addpar("env_points",Penvpoints); + xml->addpar("env_sustain",Penvsustain); + xml->addpar("env_stretch",Penvstretch); + xml->addparbool("forced_release",Pforcedrelease); + xml->addparbool("linear_envelope",Plinearenvelope); + xml->addpar("A_dt",PA_dt); + xml->addpar("D_dt",PD_dt); + xml->addpar("R_dt",PR_dt); + xml->addpar("A_val",PA_val); + xml->addpar("D_val",PD_val); + xml->addpar("S_val",PS_val); + xml->addpar("R_val",PR_val); + + if ((Pfreemode!=0)||(!xml->minimal)){ + for (int i=0;ibeginbranch("POINT",i); + if (i!=0) xml->addpar("dt",Penvdt[i]); + xml->addpar("val",Penvval[i]); + xml->endbranch(); + }; + }; +}; + + + +void EnvelopeParams::getfromXML(XMLwrapper *xml){ + Pfreemode=xml->getparbool("free_mode",Pfreemode); + Penvpoints=xml->getpar127("env_points",Penvpoints); + Penvsustain=xml->getpar127("env_sustain",Penvsustain); + Penvstretch=xml->getpar127("env_stretch",Penvstretch); + Pforcedrelease=xml->getparbool("forced_release",Pforcedrelease); + Plinearenvelope=xml->getparbool("linear_envelope",Plinearenvelope); + + PA_dt=xml->getpar127("A_dt",PA_dt); + PD_dt=xml->getpar127("D_dt",PD_dt); + PR_dt=xml->getpar127("R_dt",PR_dt); + PA_val=xml->getpar127("A_val",PA_val); + PD_val=xml->getpar127("D_val",PD_val); + PS_val=xml->getpar127("S_val",PS_val); + PR_val=xml->getpar127("R_val",PR_val); + + for (int i=0;ienterbranch("POINT",i)==0) continue; + if (i!=0) Penvdt[i]=xml->getpar127("dt",Penvdt[i]); + Penvval[i]=xml->getpar127("val",Penvval[i]); + xml->exitbranch(); + }; + + if (!Pfreemode) converttofree(); +}; + + +void EnvelopeParams::defaults(){ + Penvstretch=Denvstretch; + Pforcedrelease=Dforcedrelease; + Plinearenvelope=Dlinearenvelope; + PA_dt=DA_dt; + PD_dt=DD_dt; + PR_dt=DR_dt; + PA_val=DA_val; + PD_val=DD_val; + PS_val=DS_val; + PR_val=DR_val; + Pfreemode=0; + converttofree(); +}; + +void EnvelopeParams::store2defaults(){ + Denvstretch=Penvstretch; + Dforcedrelease=Pforcedrelease; + Dlinearenvelope=Plinearenvelope; + DA_dt=PA_dt; + DD_dt=PD_dt; + DR_dt=PR_dt; + DA_val=PA_val; + DD_val=PD_val; + DS_val=PS_val; + DR_val=PR_val; +}; + + + -- cgit v1.2.3