From ebfdc0491afc896b24372ff39d51b0506dde109d Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sat, 22 Jul 2017 04:21:04 -0400 Subject: [PATCH] Sync zyn with repo version (#3715) Sync zyn plugin with zyn repo fixes --- plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp | 8 ++++++++ plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h | 7 +++---- plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp | 4 ++-- plugins/zynaddsubfx/zynaddsubfx/src/Misc/Util.cpp | 3 ++- plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp | 2 +- plugins/zynaddsubfx/zynaddsubfx/src/UI/EnvelopeUI.fl | 6 ++---- plugins/zynaddsubfx/zynaddsubfx/src/UI/ResonanceUI.fl | 6 ++---- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp index e03fcef71..35db4d44c 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp @@ -43,6 +43,14 @@ EQ::EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, in cleanup(); } +EQ::~EQ() +{ + for(int i = 0; i < MAX_EQ_BANDS; ++i) { + delete filter[i].l; + delete filter[i].r; + } +} + // Cleanup the effect void EQ::cleanup(void) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h index f62aeb1f8..209b27740 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h @@ -6,9 +6,8 @@ Author: Nasca Octavian Paul This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + 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 @@ -31,7 +30,7 @@ class EQ:public Effect { public: EQ(bool insertion_, float *efxoutl_, float *efxoutr_, unsigned int srate, int bufsize); - ~EQ() {} + ~EQ(); void out(const Stereo &smp); void setpreset(unsigned char npreset); void changepar(int npar, unsigned char value); diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp index 080814a9e..427797bfd 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/QtXmlWrapper.cpp @@ -47,8 +47,8 @@ */ -#include -#include +#include +#include #include "QtXmlWrapper.h" #include #include diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Util.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Util.cpp index 173adb77a..9025c622a 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Util.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Util.cpp @@ -189,7 +189,8 @@ void returnTmpBuffer(float *buf) return; } fprintf(stderr, - "ERROR: invalid buffer returned src/Misc/Util.cpp %d\n", + "ERROR: invalid buffer returned %s %d\n", + __FILE__, __LINE__); } diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp index c43f1fa3f..6c7023900 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp @@ -694,7 +694,7 @@ void ADnote::KillNote() KillVoice(nvoice); if(NoteVoicePar[nvoice].VoiceOut) - delete NoteVoicePar[nvoice].VoiceOut; + delete[] NoteVoicePar[nvoice].VoiceOut; NoteVoicePar[nvoice].VoiceOut = NULL; } diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/UI/EnvelopeUI.fl b/plugins/zynaddsubfx/zynaddsubfx/src/UI/EnvelopeUI.fl index db706777b..359f64caf 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/UI/EnvelopeUI.fl +++ b/plugins/zynaddsubfx/zynaddsubfx/src/UI/EnvelopeUI.fl @@ -204,14 +204,12 @@ if (event==FL_RELEASE){ if ((event==FL_DRAG)&&(currentpoint>=0)){ int ny=127-(int) (y_*127.0/h()); - if (ny<0) ny=0; - if (ny>127) ny=127; + if (ny<0) ny=0;if (ny>127) ny=127; env->Penvval[currentpoint]=ny; int dx=(int)((x_-cpx)*0.1); int newdt=cpdt+dx; - if (newdt<0) newdt=0; - if (newdt>127) newdt=127; + if (newdt<0) newdt=0;if (newdt>127) newdt=127; if (currentpoint!=0) env->Penvdt[currentpoint]=newdt; else env->Penvdt[currentpoint]=0; diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/UI/ResonanceUI.fl b/plugins/zynaddsubfx/zynaddsubfx/src/UI/ResonanceUI.fl index 5ab7290a5..f1b887cd5 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/UI/ResonanceUI.fl +++ b/plugins/zynaddsubfx/zynaddsubfx/src/UI/ResonanceUI.fl @@ -133,10 +133,8 @@ if ( (x_>=0)&&(x_=0)&&(y_=w()) x_=w(); - if (y_>=h()-1) y_=h()-1; + if (x_<0) x_=0;if (y_<0) y_=0; + if (x_>=w()) x_=w();if (y_>=h()-1) y_=h()-1; if ((oldx<0)||(oldx==x_)){ int sn=(int)(x_*1.0/w()*N_RES_POINTS);