zynaddsubfx

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

commit 21745d8febb5adc4011eb137d41460dd2e296a88
parent 4bf4af2fc5735dcf55fce28603aeb053963541bd
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Sat, 14 Feb 2015 13:58:14 -0500

Refactor Includes

Diffstat:
Msrc/Misc/Master.h | 3---
Msrc/Misc/MiddleWare.cpp | 3+++
Msrc/Misc/Part.cpp | 12++++++------
Msrc/Misc/Part.h | 11-----------
Msrc/Misc/Util.h | 8++++++++
Msrc/Params/ADnoteParameters.h | 9---------
Msrc/Params/Controller.cpp | 1+
Msrc/Params/Controller.h | 1-
Msrc/Params/LFOParams.cpp | 5+++--
Msrc/Params/LFOParams.h | 2+-
Msrc/Params/PADnoteParameters.cpp | 5+++++
Msrc/Params/PADnoteParameters.h | 8--------
Msrc/Params/SUBnoteParameters.cpp | 3++-
Msrc/Params/SUBnoteParameters.h | 4----
Msrc/Synth/ADnote.cpp | 2++
Msrc/Synth/PADnote.cpp | 6+++++-
Msrc/Synth/PADnote.h | 3---
Msrc/Synth/SUBnote.cpp | 4++++
Msrc/Synth/SUBnote.h | 3---
Msrc/Synth/SynthNote.h | 1-
Msrc/Tests/InstrumentStats.cpp | 1+
Msrc/Tests/OscilGenTest.h | 2++
Msrc/Tests/PadNoteTest.h | 2++
Msrc/Tests/SubNoteTest.h | 1+
Msrc/UI/ADnoteUI.fl | 12++++--------
Msrc/UI/BankUI.fl | 18+++---------------
Msrc/UI/MasterUI.fl | 9---------
Msrc/UI/PADnoteUI.fl | 9---------
Msrc/UI/VirKeyboard.fl | 2+-
Msrc/globals.h | 5+++++
30 files changed, 59 insertions(+), 96 deletions(-)

diff --git a/src/Misc/Master.h b/src/Misc/Master.h @@ -23,8 +23,6 @@ #ifndef MASTER_H #define MASTER_H -#include <pthread.h> - #include "../globals.h" #include "Microtonal.h" #include <rtosc/miditable.h> @@ -32,7 +30,6 @@ #include "Bank.h" #include "Recorder.h" #include "Dump.h" -#include "XMLwrapper.h" #include "../Params/Controller.h" diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -19,11 +19,14 @@ #include <map> +#include "Util.h" #include "Master.h" #include "Part.h" #include "../Params/ADnoteParameters.h" #include "../Params/SUBnoteParameters.h" #include "../Params/PADnoteParameters.h" +#include "../DSP/FFTwrapper.h" +#include "../Synth/OscilGen.h" #include <string> #include <future> diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp @@ -29,13 +29,16 @@ #include "../Params/ADnoteParameters.h" #include "../Params/SUBnoteParameters.h" #include "../Params/PADnoteParameters.h" +#include "../Synth/Resonance.h" +#include "../Synth/SynthNote.h" #include "../Synth/ADnote.h" #include "../Synth/SUBnote.h" #include "../Synth/PADnote.h" #include "../DSP/FFTwrapper.h" -#include <stdlib.h> -#include <stdio.h> -#include <string.h> +#include "../Misc/Util.h" +#include <cstdlib> +#include <cstdio> +#include <cstring> #include <cassert> #include <rtosc/ports.h> @@ -1036,9 +1039,6 @@ void Part::setPpanning(char Ppanning_) panning = limit(Ppanning / 127.0f + ctl.panning.pan, 0.0f, 1.0f); } -template<class T> -static inline void nullify(T &t) {delete t; t = NULL; } - /* * Enable or disable a kit item */ diff --git a/src/Misc/Part.h b/src/Misc/Part.h @@ -27,21 +27,10 @@ #include "../globals.h" #include "../Params/Controller.h" -#include "../Misc/Microtonal.h" -#include <pthread.h> #include <functional> #include <list> // For the monomemnotes list. -class EffectMgr; -class ADnoteParameters; -class SUBnoteParameters; -class PADnoteParameters; -class SynthNote; -class XMLWrapper; -class FFTwrapper; -class Allocator; - /** Part implementation*/ class Part { diff --git a/src/Misc/Util.h b/src/Misc/Util.h @@ -26,9 +26,13 @@ #include <string> #include <sstream> #include <stdint.h> +#include <algorithm> #include "Config.h" #include "../globals.h" +using std::min; +using std::max; + //Velocity Sensing function extern float VelF(float velocity, unsigned char scaling); @@ -148,6 +152,10 @@ float cinterpolate(const float *data, size_t len, float pos); ///trims a path in recursions const char *message_snip(const char *m); +template<class T> +static inline void nullify(T &t) {delete t; t = NULL; } +template<class T> +static inline void arrayNullify(T &t) {delete [] t; t = NULL; } #define rParamZyn(name, ...) \ {STRINGIFY(name) "::i", rProp(parameter) rMap(min, 0) rMap(max, 127) DOC(__VA_ARGS__), NULL, rParamICb(name)} diff --git a/src/Params/ADnoteParameters.h b/src/Params/ADnoteParameters.h @@ -23,18 +23,9 @@ #ifndef AD_NOTE_PARAMETERS_H #define AD_NOTE_PARAMETERS_H - #include "../globals.h" -#include "../Misc/Util.h" #include "PresetsArray.h" -class EnvelopeParams; -class LFOParams; -class FilterParams; -class Resonance; -class OscilGen; -class FFTwrapper; - enum FMTYPE { NONE, MORPH, RING_MOD, PHASE_MOD, FREQ_MOD, PITCH_MOD }; diff --git a/src/Params/Controller.cpp b/src/Params/Controller.cpp @@ -22,6 +22,7 @@ #include "Controller.h" #include "../Misc/Util.h" +#include "../Misc/XMLwrapper.h" #include <cmath> #include <cstdio> diff --git a/src/Params/Controller.h b/src/Params/Controller.h @@ -25,7 +25,6 @@ #define CONTROLLER_H #include "../globals.h" -#include "../Misc/XMLwrapper.h" /**(Midi) Controllers implementation*/ class Controller diff --git a/src/Params/LFOParams.cpp b/src/Params/LFOParams.cpp @@ -20,10 +20,11 @@ */ -#include <math.h> -#include <stdio.h> +#include <cmath> +#include <cstdio> #include "../globals.h" #include "../Misc/Util.h" +#include "../Misc/XMLwrapper.h" #include "LFOParams.h" #include <rtosc/port-sugar.h> diff --git a/src/Params/LFOParams.h b/src/Params/LFOParams.h @@ -23,8 +23,8 @@ #ifndef LFO_PARAMS_H #define LFO_PARAMS_H -#include "../Misc/XMLwrapper.h" #include "Presets.h" +class XMLwrapper; class LFOParams:public Presets { diff --git a/src/Params/PADnoteParameters.cpp b/src/Params/PADnoteParameters.cpp @@ -21,6 +21,11 @@ */ #include <cmath> #include "PADnoteParameters.h" +#include "FilterParams.h" +#include "EnvelopeParams.h" +#include "LFOParams.h" +#include "../Synth/Resonance.h" +#include "../Synth/OscilGen.h" #include "../Misc/WavFile.h" #include <cstdio> diff --git a/src/Params/PADnoteParameters.h b/src/Params/PADnoteParameters.h @@ -23,16 +23,8 @@ #ifndef PAD_NOTE_PARAMETERS_H #define PAD_NOTE_PARAMETERS_H -#include "../Misc/XMLwrapper.h" -#include "../DSP/FFTwrapper.h" #include "../globals.h" -#include "../Synth/OscilGen.h" -#include "../Synth/Resonance.h" -#include "../Misc/Util.h" -#include "EnvelopeParams.h" -#include "LFOParams.h" -#include "FilterParams.h" #include "Presets.h" #include <string> #include <functional> diff --git a/src/Params/SUBnoteParameters.cpp b/src/Params/SUBnoteParameters.cpp @@ -23,8 +23,9 @@ #include "../globals.h" #include "SUBnoteParameters.h" #include "EnvelopeParams.h" +#include "FilterParams.h" #include "../Misc/Util.h" -#include <stdio.h> +#include <cstdio> #include <cmath> #include <rtosc/ports.h> diff --git a/src/Params/SUBnoteParameters.h b/src/Params/SUBnoteParameters.h @@ -24,11 +24,8 @@ #define SUB_NOTE_PARAMETERS_H #include "../globals.h" -#include "../Misc/XMLwrapper.h" -#include "FilterParams.h" #include "Presets.h" -class EnvelopeParams; class SUBnoteParameters:public Presets { public: @@ -106,7 +103,6 @@ class SUBnoteParameters:public Presets unsigned char Pstart; static rtosc::Ports &ports; - private: }; #endif diff --git a/src/Synth/ADnote.cpp b/src/Synth/ADnote.cpp @@ -30,6 +30,8 @@ #include "../Misc/Util.h" #include "../Misc/Allocator.h" #include "../DSP/Filter.h" +#include "../Params/ADnoteParameters.h" +#include "../Params/FilterParams.h" #include "OscilGen.h" #include "ADnote.h" diff --git a/src/Synth/PADnote.cpp b/src/Synth/PADnote.cpp @@ -18,11 +18,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <math.h> +#include <cmath> #include "PADnote.h" #include "../Misc/Config.h" #include "../Misc/Allocator.h" #include "../DSP/Filter.h" +#include "../Params/PADnoteParameters.h" +#include "../Params/Controller.h" +#include "../Params/FilterParams.h" +#include "../Misc/Util.h" PADnote::PADnote(PADnoteParameters *parameters, SynthParams pars) diff --git a/src/Synth/PADnote.h b/src/Synth/PADnote.h @@ -23,11 +23,8 @@ #include "SynthNote.h" #include "../globals.h" -#include "../Params/PADnoteParameters.h" -#include "../Params/Controller.h" #include "Envelope.h" #include "LFO.h" -#include "../Params/Controller.h" /**The "pad" synthesizer*/ class PADnote:public SynthNote diff --git a/src/Synth/SUBnote.cpp b/src/Synth/SUBnote.cpp @@ -26,6 +26,10 @@ #include <cassert> #include "../globals.h" #include "SUBnote.h" +#include "Envelope.h" +#include "../Params/Controller.h" +#include "../Params/SUBnoteParameters.h" +#include "../Params/FilterParams.h" #include "../Misc/Util.h" #include "../Misc/Allocator.h" diff --git a/src/Synth/SUBnote.h b/src/Synth/SUBnote.h @@ -25,9 +25,6 @@ #include "SynthNote.h" #include "../globals.h" -#include "../Params/SUBnoteParameters.h" -#include "../Params/Controller.h" -#include "Envelope.h" #include "../DSP/Filter.h" class SUBnote:public SynthNote diff --git a/src/Synth/SynthNote.h b/src/Synth/SynthNote.h @@ -22,7 +22,6 @@ #ifndef SYNTH_NOTE_H #define SYNTH_NOTE_H #include "../globals.h" -#include "../Params/FilterParams.h" class Allocator; class Controller; diff --git a/src/Tests/InstrumentStats.cpp b/src/Tests/InstrumentStats.cpp @@ -7,6 +7,7 @@ #include "../Misc/Part.h" #include "../Misc/Util.h" #include "../Misc/Allocator.h" +#include "../Misc/Microtonal.h" #include "../DSP/FFTwrapper.h" #include "../globals.h" SYNTH_T *synth; diff --git a/src/Tests/OscilGenTest.h b/src/Tests/OscilGenTest.h @@ -22,6 +22,8 @@ #include <cxxtest/TestSuite.h> #include <string> #include "../Synth/OscilGen.h" +#include "../DSP/FFTwrapper.h" +#include "../Misc/Util.h" #include "../globals.h" SYNTH_T *synth; diff --git a/src/Tests/PadNoteTest.h b/src/Tests/PadNoteTest.h @@ -32,6 +32,8 @@ #include "../Misc/Util.h" #include "../Misc/Allocator.h" #include "../Synth/PADnote.h" +#include "../Synth/OscilGen.h" +#include "../Params/PADnoteParameters.h" #include "../Params/Presets.h" #include "../DSP/FFTwrapper.h" #include "../globals.h" diff --git a/src/Tests/SubNoteTest.h b/src/Tests/SubNoteTest.h @@ -30,6 +30,7 @@ #include "../Misc/Allocator.h" #include "../Misc/Util.h" #include "../Synth/SUBnote.h" +#include "../Params/SUBnoteParameters.h" #include "../Params/Presets.h" #include "../globals.h" SYNTH_T *synth; diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl @@ -10,10 +10,6 @@ decl {//License: GNU GPL version 2 or later} {private local decl {\#include "../Params/ADnoteParameters.h"} {public local } - -decl {\#include "../Misc/Util.h"} {public local -} - decl {\#include "ResonanceUI.h"} {public local } @@ -26,16 +22,16 @@ decl {\#include <FL/Fl_Box.H>} {public local decl {\#include <FL/Fl_Group.H>} {public local } -decl {\#include <math.h>} {private local +decl {\#include <cmath>} {private local } -decl {\#include <stdio.h>} {private local +decl {\#include <cstdio>} {private local } -decl {\#include <stdlib.h>} {private local +decl {\#include <cstdlib>} {private local } -decl {\#include <string.h>} {private local +decl {\#include <cstring>} {private local } decl {\#include "Fl_Osc_Pane.H"} {public local diff --git a/src/UI/BankUI.fl b/src/UI/BankUI.fl @@ -8,13 +8,13 @@ decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local decl {//License: GNU GPL version 2 or later} {private local } -decl {\#include <stdlib.h>} {public local +decl {\#include <cstdlib>} {public local } -decl {\#include <stdio.h>} {public local +decl {\#include <cstdio>} {public local } -decl {\#include <string.h>} {public local +decl {\#include <cstring>} {public local } decl {\#include <FL/Fl_Button.H>} {public local @@ -26,18 +26,6 @@ decl {\#include <FL/Fl_File_Chooser.H>} {public local decl {\#include "Fl_Osc_Interface.h"} {public local } -decl {\#include "../Misc/Master.h"} {public local -} - -decl {\#include "../Misc/Part.h"} {public local -} - -decl {\#include "../Misc/Bank.h"} {public local -} - -decl {\#include "../Misc/Config.h"} {public local -} - decl {\#include "../Misc/Util.h"} {public local } diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl @@ -62,15 +62,6 @@ decl {\#include "VuMasterMeter.h"} {public local decl {\#include "PartNameButton.h"} {public local } -decl {\#include "../Misc/Master.h"} {public local -} - -decl {\#include "../Misc/Part.h"} {public local -} - -decl {\#include "../Misc/Util.h"} {public local -} - decl {\#include "common.H"} {public local } diff --git a/src/UI/PADnoteUI.fl b/src/UI/PADnoteUI.fl @@ -5,15 +5,6 @@ code_name {.cc} decl {\#include "../Params/PADnoteParameters.h"} {public local } -decl {\#include "../Misc/Util.h"} {public local -} - -decl {\#include "../Misc/Master.h"} {public local -} - -decl {\#include "../Misc/MiddleWare.h"} {public local -} - decl {\#include "ResonanceUI.h"} {public local } diff --git a/src/UI/VirKeyboard.fl b/src/UI/VirKeyboard.fl @@ -8,7 +8,7 @@ decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local decl {//License: GNU GPL version 2 or later} {private local } -decl {\#include <stdlib.h>} {public local +decl {\#include <cstdlib>} {public local } decl {\#include <FL/fl_draw.H>} {public local diff --git a/src/globals.h b/src/globals.h @@ -46,14 +46,19 @@ class SUBnoteParameters; class PADnoteParameters; class SynthNote; +class Allocator; + class Microtonal; class XMLwrapper; class Resonance; class FFTwrapper; +class EnvelopeParams; class LFOParams; class FilterParams; + class LFO; class Envelope; +class OscilGen; class Controller; class Master;