From 5bf095b6b98be761eed6a6ab38c065f8b2adc0aa Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Wed, 24 Dec 2014 20:08:14 +0100 Subject: [PATCH] Revert Zynaddsubfx changes --- .../zynaddsubfx/src/Effects/EQ.cpp | 8 ------ .../zynaddsubfx/zynaddsubfx/src/Effects/EQ.h | 2 +- .../zynaddsubfx/src/Misc/Config.cpp | 27 +++++++------------ .../zynaddsubfx/src/Synth/ADnote.cpp | 2 +- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp index 6468f16b1..e03fcef71 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.cpp @@ -43,14 +43,6 @@ 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 6192861cd..b2e9e89a9 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Effects/EQ.h @@ -30,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/Config.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Config.cpp index 72a8046f4..d38c88bca 100644 --- a/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Config.cpp +++ b/plugins/zynaddsubfx/zynaddsubfx/src/Misc/Config.cpp @@ -42,16 +42,10 @@ void Config::init() cfg.OscilSize = 1024; cfg.SwapStereo = 0; - if( cfg.LinuxOSSWaveOutDev == NULL ) //Check, if object already exists befroe creating it. - { - cfg.LinuxOSSWaveOutDev = new char[MAX_STRING_SIZE]; - snprintf(cfg.LinuxOSSWaveOutDev, MAX_STRING_SIZE, "/dev/dsp"); - } - if( cfg.LinuxOSSSeqInDev == NULL ) //Check, if object already exists befroe creating it. - { - cfg.LinuxOSSSeqInDev = new char[MAX_STRING_SIZE]; - snprintf(cfg.LinuxOSSSeqInDev, MAX_STRING_SIZE, "/dev/sequencer"); - } + cfg.LinuxOSSWaveOutDev = new char[MAX_STRING_SIZE]; + snprintf(cfg.LinuxOSSWaveOutDev, MAX_STRING_SIZE, "/dev/dsp"); + cfg.LinuxOSSSeqInDev = new char[MAX_STRING_SIZE]; + snprintf(cfg.LinuxOSSSeqInDev, MAX_STRING_SIZE, "/dev/sequencer"); cfg.DumpFile = "zynaddsubfx_dump.txt"; @@ -73,14 +67,11 @@ void Config::init() winwavemax = 1; winmidimax = 1; //try to find out how many input midi devices are there - if( winmididevices == NULL ) //Check, if object already exists befroe creating it. - { - winmididevices = new winmidionedevice[winmidimax]; - for(int i = 0; i < winmidimax; ++i) { - winmididevices[i].name = new char[MAX_STRING_SIZE]; - for(int j = 0; j < MAX_STRING_SIZE; ++j) - winmididevices[i].name[j] = '\0'; - } + winmididevices = new winmidionedevice[winmidimax]; + for(int i = 0; i < winmidimax; ++i) { + winmididevices[i].name = new char[MAX_STRING_SIZE]; + for(int j = 0; j < MAX_STRING_SIZE; ++j) + winmididevices[i].name[j] = '\0'; } diff --git a/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp b/plugins/zynaddsubfx/zynaddsubfx/src/Synth/ADnote.cpp index 5391b9a5f..c43f1fa3f 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; }