commit 3c0b2c748170f6425d42d1adf7ecf69f41306dfd parent e6e6fced96d95a37012a5296d739bdae75c2ba2a Author: fundamental <fundamental> Date: Fri, 20 Feb 2009 21:12:57 +0000 Fixed 'const char' warnings Fixed improper dealocation (changed delete to delete []) Fixed -pedantic errors Added tooltip functionality to dials Added external programs Makefiles Removed old compile.sh and clean.sh scripts for external programs Diffstat:
33 files changed, 364 insertions(+), 216 deletions(-)
diff --git a/ChangeLog b/ChangeLog @@ -828,6 +828,20 @@ - Codul de recorder wav a fost rescris - Adaugata functia de export la sample-urile din PADsynth +20 Feb 2009 (Mark McCurry) + - Made several functions accept 'constant char' over 'char' to + prevent warnings + - Changed several 'delete' operations to 'delete []' based upon + the usage of 'new []' + - Gave external programs Makefiles + - Gave dials tooltips showing their value when they are being + moved + - Gave dials the ability to have normal tooltips when the mouse + hovers over them + - Created tooltips for the effects knobs + - Standardized the code, so it could compile with pedantic without + errors + diff --git a/ExternalPrograms/Controller/Makefile b/ExternalPrograms/Controller/Makefile @@ -0,0 +1,18 @@ +controller: main.o Controller.o ControllerUI.o + gcc -o controller *.o `fltk-config --ldflags` -lasound -lpthread -lm -lstdc++ + +ControllerUI.cxx ControllerUI.h: ControllerUI.fl + fluid -c ControllerUI.fl + +ControllerUI.o: ControllerUI.cxx ControllerUI.h + gcc `fltk-config --cflags` -c ControllerUI.cxx -o ControllerUI.o + +Controller.o: Controller.C Controller.h + gcc `fltk-config --cflags` -c Controller.C -o Controller.o + +main.o: main.C Controller.h ControllerUI.h + gcc `fltk-config --cflags` -c main.C -o main.o + +clean: + rm -f *.o controller ControllerUI.cxx ControllerUI.h + diff --git a/ExternalPrograms/Controller/clean.sh b/ExternalPrograms/Controller/clean.sh @@ -1 +0,0 @@ -rm -f *.o controller ControllerUI.cxx ControllerUI.h diff --git a/ExternalPrograms/Controller/compile.sh b/ExternalPrograms/Controller/compile.sh @@ -1,10 +0,0 @@ -./clean.sh -fluid -c ControllerUI.fl -gcc `fltk-config --cflags` -c ControllerUI.cxx -o ControllerUI.o -gcc `fltk-config --cflags` -c Controller.C -o Controller.o -gcc `fltk-config --cflags` -c main.C -o main.o - - - -gcc -o controller *.o `fltk-config --ldflags` -lasound -lpthread -lm - diff --git a/ExternalPrograms/Spliter/Makefile b/ExternalPrograms/Spliter/Makefile @@ -0,0 +1,17 @@ +spliter: main.o Spliter.o SpliterUI.o + gcc -o spliter *.o `fltk-config --ldflags` -lasound -lstdc++ + +SplitterUI.cxx SpliterUI.h: SpliterUI.fl + fluid -c SpliterUI.fl + +SpliterUI.o: SplitterUI.cxx SpliterUI.h + gcc -g `fltk-config --cflags` -c SpliterUI.cxx -o SpliterUI.o + +Spliter.o: Spliter.C Spliter.h + gcc -g `fltk-config --cflags` -c Spliter.C -o Spliter.o + +main.o: main.C Spliter.h SpliterUI.h + gcc -g `fltk-config --cflags` -c main.C -o main.o + +clean: + rm -f *.o spliter SpliterUI.cxx SpliterUI.h diff --git a/ExternalPrograms/Spliter/clean.sh b/ExternalPrograms/Spliter/clean.sh @@ -1 +0,0 @@ -rm -f *.o spliter SpliterUI.cxx SpliterUI.h diff --git a/ExternalPrograms/Spliter/compile.sh b/ExternalPrograms/Spliter/compile.sh @@ -1,8 +0,0 @@ -./clean.sh -fluid -c SpliterUI.fl -gcc `fltk-config --cflags` -c SpliterUI.cxx -o SpliterUI.o -gcc `fltk-config --cflags` -c Spliter.C -o Spliter.o -gcc `fltk-config --cflags` -c main.C -o main.o - -gcc -o spliter *.o `fltk-config --ldflags` -lasound - diff --git a/ExternalPrograms/Spliter/readme.txt b/ExternalPrograms/Spliter/readme.txt @@ -4,7 +4,7 @@ Spliter This program splits the keyboard and alows you to play two instruments same time. You can use this program with ZynAddSubFX or any other synthesizer. This requires ALSA 0.9.x. -To compile it, run the file "compile.sh". There is no Makefile, yet. +To compile it, run "make". If you want to use with ZynAddSubFX send the midi events thru Spliter with aconnect like this: - connect the keyboard port to "Spliter IN" port diff --git a/ExternalPrograms/readme.txt b/ExternalPrograms/readme.txt @@ -1,2 +1,2 @@ -Theese are external programs, which can use with ZynAddSubFX or any other midi device. More information is in the documentation (html - webpages). -There is no Makefile for theese, yet. -\ No newline at end of file +These are external programs, which can use with ZynAddSubFX or any other midi device. More information is in the documentation (html - webpages). + diff --git a/src/DSP/AnalogFilter.C b/src/DSP/AnalogFilter.C @@ -332,7 +332,7 @@ void AnalogFilter::filterout(REALTYPE *smp){ REALTYPE x=i/(REALTYPE) SOUND_BUFFER_SIZE; smp[i]=ismp[i]*(1.0-x)+smp[i]*x; }; - delete (ismp); + delete [] ismp; needsinterpolation=0; }; diff --git a/src/DSP/SVFilter.C b/src/DSP/SVFilter.C @@ -142,7 +142,7 @@ void SVFilter::filterout(REALTYPE *smp){ REALTYPE x=i/(REALTYPE) SOUND_BUFFER_SIZE; smp[i]=ismp[i]*(1.0-x)+smp[i]*x; }; - delete (ismp); + delete [] ismp; needsinterpolation=0; }; diff --git a/src/Effects/Reverb.C b/src/Effects/Reverb.C @@ -78,8 +78,8 @@ Reverb::~Reverb(){ if (hpf!=NULL) delete hpf; if (lpf!=NULL) delete lpf; - for (i=0;i<REV_APS*2;i++) delete ap[i]; - for (i=0;i<REV_COMBS*2;i++) delete comb[i]; + for (i=0;i<REV_APS*2;i++) delete [] ap[i]; + for (i=0;i<REV_COMBS*2;i++) delete [] comb[i]; delete [] inputbuf; }; diff --git a/src/Misc/Bank.C b/src/Misc/Bank.C @@ -436,7 +436,7 @@ void Bank::scanrootdir(char *rootdir){ char name[maxdirsize]; }bank; - char *separator="/"; + const char *separator="/"; if (strlen(rootdir)) { char tmp=rootdir[strlen(rootdir)-1]; if ((tmp=='/') || (tmp=='\\')) separator=""; diff --git a/src/Misc/Config.C b/src/Misc/Config.C @@ -174,12 +174,12 @@ void Config::init(){ Config::~Config(){ - delete(cfg.LinuxOSSWaveOutDev); - delete(cfg.LinuxOSSSeqInDev); - delete(cfg.DumpFile); + delete [] cfg.LinuxOSSWaveOutDev; + delete [] cfg.LinuxOSSSeqInDev; + delete [] cfg.DumpFile; - for (int i=0;i<winmidimax;i++) delete (winmididevices[i].name); - delete(winmididevices); + for (int i=0;i<winmidimax;i++) delete [] winmididevices[i].name; + delete [] winmididevices; }; @@ -203,7 +203,7 @@ void Config::clearpresetsdirlist(){ }; }; -void Config::readConfig(char *filename){ +void Config::readConfig(const char *filename){ XMLwrapper *xmlcfg=new XMLwrapper(); if (xmlcfg->loadXMLfile(filename)<0) return; if (xmlcfg->enterbranch("CONFIGURATION")){ @@ -262,7 +262,7 @@ void Config::readConfig(char *filename){ }; -void Config::saveConfig(char *filename){ +void Config::saveConfig(const char *filename){ XMLwrapper *xmlcfg=new XMLwrapper(); xmlcfg->beginbranch("CONFIGURATION"); diff --git a/src/Misc/Config.h b/src/Misc/Config.h @@ -59,8 +59,8 @@ class Config{ void save(); private: - void readConfig(char *filename); - void saveConfig(char *filename); + void readConfig(const char *filename); + void saveConfig(const char *filename); void getConfigFileName(char *name,int namesize); }; #endif diff --git a/src/Misc/Master.C b/src/Misc/Master.C @@ -482,9 +482,9 @@ void Master::GetAudioOutSamples(int nsamples,int samplerate,REALTYPE *outl,REALT Master::~Master(){ - for (int npart=0;npart<NUM_MIDI_PARTS;npart++) delete (part[npart]); - for (int nefx=0;nefx<NUM_INS_EFX;nefx++) delete (insefx[nefx]); - for (int nefx=0;nefx<NUM_SYS_EFX;nefx++) delete (sysefx[nefx]); + for (int npart=0;npart<NUM_MIDI_PARTS;npart++) delete part[npart]; + for (int nefx=0;nefx<NUM_INS_EFX;nefx++) delete insefx[nefx]; + for (int nefx=0;nefx<NUM_SYS_EFX;nefx++) delete sysefx[nefx]; delete [] audiooutl; delete [] audiooutr; diff --git a/src/Misc/Microtonal.C b/src/Misc/Microtonal.C @@ -64,8 +64,8 @@ void Microtonal::defaults(){ }; Microtonal::~Microtonal(){ - delete (Pname); - delete (Pcomment); + delete [] Pname; + delete [] Pcomment; }; /* diff --git a/src/Misc/Part.C b/src/Misc/Part.C @@ -163,20 +163,20 @@ Part::~Part(){ if (kit[n].subpars!=NULL) delete (kit[n].subpars); if (kit[n].padpars!=NULL) delete (kit[n].padpars); kit[n].adpars=NULL;kit[n].subpars=NULL;kit[n].padpars=NULL; - delete(kit[n].Pname); + delete [] kit[n].Pname; }; - delete (Pname); - delete (partoutl); - delete (partoutr); - delete (tmpoutl); - delete (tmpoutr); + delete [] Pname; + delete [] partoutl; + delete [] partoutr; + delete [] tmpoutl; + delete [] tmpoutr; for (int nefx=0;nefx<NUM_PART_EFX;nefx++) delete (partefx[nefx]); for (int n=0;n<NUM_PART_EFX+1;n++) { - delete (partfxinputl[n]); - delete (partfxinputr[n]); - }; + delete [] partfxinputl[n]; + delete [] partfxinputr[n]; + } }; /* diff --git a/src/Misc/XMLwrapper.C b/src/Misc/XMLwrapper.C @@ -110,7 +110,7 @@ XMLwrapper::~XMLwrapper(){ if (tree!=NULL) mxmlDelete(tree); }; -bool XMLwrapper::checkfileinformation(char *filename){ +bool XMLwrapper::checkfileinformation(const char *filename){ stackpos=0; ZERO(&parentstack,(int)sizeof(parentstack)); information.PADsynth_used=false; @@ -162,7 +162,7 @@ bool XMLwrapper::checkfileinformation(char *filename){ /* SAVE XML members */ -int XMLwrapper::saveXMLfile(char *filename){ +int XMLwrapper::saveXMLfile(const char *filename){ char *xmldata=getXMLdata(); if (xmldata==NULL) return(-2); @@ -175,7 +175,7 @@ int XMLwrapper::saveXMLfile(char *filename){ int result=dosavefile(filenamenew,compression,xmldata); delete []filenamenew; - delete []xmldata; + free(xmldata); return(result); }; @@ -196,7 +196,7 @@ char *XMLwrapper::getXMLdata(){ }; -int XMLwrapper::dosavefile(char *filename,int compression,char *xmldata){ +int XMLwrapper::dosavefile(const char *filename,int compression,const char *xmldata){ if (compression==0){ FILE *file; file=fopen(filename,"w"); @@ -221,32 +221,32 @@ int XMLwrapper::dosavefile(char *filename,int compression,char *xmldata){ -void XMLwrapper::addpar(char *name,int val){ +void XMLwrapper::addpar(const char *name,int val){ addparams2("par","name",name,"value",int2str(val)); }; -void XMLwrapper::addparreal(char *name,REALTYPE val){ +void XMLwrapper::addparreal(const char *name,REALTYPE val){ addparams2("par_real","name",name,"value",real2str(val)); }; -void XMLwrapper::addparbool(char *name,int val){ +void XMLwrapper::addparbool(const char *name,int val){ if (val!=0) addparams2("par_bool","name",name,"value","yes"); else addparams2("par_bool","name",name,"value","no"); }; -void XMLwrapper::addparstr(char *name,char *val){ +void XMLwrapper::addparstr(const char *name,const char *val){ mxml_node_t *element=mxmlNewElement(node,"string"); mxmlElementSetAttr(element,"name",name); mxmlNewText(element,0,val); }; -void XMLwrapper::beginbranch(char *name){ +void XMLwrapper::beginbranch(const char *name){ push(node); node=addparams0(name); }; -void XMLwrapper::beginbranch(char *name,int id){ +void XMLwrapper::beginbranch(const char *name,int id){ push(node); node=addparams1(name,"id",int2str(id)); }; @@ -268,7 +268,7 @@ int XMLwrapper::loadXMLfile(const char *filename){ stackpos=0; - char *xmldata=doloadfile(filename); + const char *xmldata=doloadfile(filename); if (xmldata==NULL) return(-1);//the file could not be loaded or uncompressed root=tree=mxmlLoadString(NULL,xmldata,MXML_OPAQUE_CALLBACK); @@ -333,7 +333,7 @@ char *XMLwrapper::doloadfile(const char *filename){ }; }; -bool XMLwrapper::putXMLdata(char *xmldata){ +bool XMLwrapper::putXMLdata(const char *xmldata){ if (tree!=NULL) mxmlDelete(tree); tree=NULL; @@ -357,7 +357,7 @@ bool XMLwrapper::putXMLdata(char *xmldata){ -int XMLwrapper::enterbranch(char *name){ +int XMLwrapper::enterbranch(const char *name){ node=mxmlFindElement(peek(),peek(),name,NULL,NULL,MXML_DESCEND_FIRST); if (node==NULL) return(0); @@ -365,7 +365,7 @@ int XMLwrapper::enterbranch(char *name){ return(1); }; -int XMLwrapper::enterbranch(char *name,int id){ +int XMLwrapper::enterbranch(const char *name,int id){ snprintf(tmpstr,TMPSTR_SIZE,"%d",id); node=mxmlFindElement(peek(),peek(),name,"id",tmpstr,MXML_DESCEND_FIRST); if (node==NULL) return(0); @@ -390,7 +390,7 @@ int XMLwrapper::getbranchid(int min, int max){ return(id); }; -int XMLwrapper::getpar(char *name,int defaultpar,int min,int max){ +int XMLwrapper::getpar(const char *name,int defaultpar,int min,int max){ node=mxmlFindElement(peek(),peek(),"par","name",name,MXML_DESCEND_FIRST); if (node==NULL) return(defaultpar); @@ -404,11 +404,11 @@ int XMLwrapper::getpar(char *name,int defaultpar,int min,int max){ return(val); }; -int XMLwrapper::getpar127(char *name,int defaultpar){ +int XMLwrapper::getpar127(const char *name,int defaultpar){ return(getpar(name,defaultpar,0,127)); }; -int XMLwrapper::getparbool(char *name,int defaultpar){ +int XMLwrapper::getparbool(const char *name,int defaultpar){ node=mxmlFindElement(peek(),peek(),"par_bool","name",name,MXML_DESCEND_FIRST); if (node==NULL) return(defaultpar); @@ -419,7 +419,7 @@ int XMLwrapper::getparbool(char *name,int defaultpar){ else return(0); }; -void XMLwrapper::getparstr(char *name,char *par,int maxstrlen){ +void XMLwrapper::getparstr(const char *name,char *par,int maxstrlen){ ZERO(par,maxstrlen); node=mxmlFindElement(peek(),peek(),"string","name",name,MXML_DESCEND_FIRST); @@ -431,7 +431,7 @@ void XMLwrapper::getparstr(char *name,char *par,int maxstrlen){ }; -REALTYPE XMLwrapper::getparreal(char *name,REALTYPE defaultpar){ +REALTYPE XMLwrapper::getparreal(const char *name,REALTYPE defaultpar){ node=mxmlFindElement(peek(),peek(),"par_real","name",name,MXML_DESCEND_FIRST); if (node==NULL) return(defaultpar); @@ -441,7 +441,7 @@ REALTYPE XMLwrapper::getparreal(char *name,REALTYPE defaultpar){ return(str2real(strval)); }; -REALTYPE XMLwrapper::getparreal(char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max){ +REALTYPE XMLwrapper::getparreal(const char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max){ REALTYPE result=getparreal(name,defaultpar); if (result<min) result=min; @@ -475,18 +475,18 @@ REALTYPE XMLwrapper::str2real(const char *str){ }; -mxml_node_t *XMLwrapper::addparams0(char *name){ +mxml_node_t *XMLwrapper::addparams0(const char *name){ mxml_node_t *element=mxmlNewElement(node,name); return(element); }; -mxml_node_t *XMLwrapper::addparams1(char *name,char *par1,char *val1){ +mxml_node_t *XMLwrapper::addparams1(const char *name,const char *par1,const char *val1){ mxml_node_t *element=mxmlNewElement(node,name); mxmlElementSetAttr(element,par1,val1); return(element); }; -mxml_node_t *XMLwrapper::addparams2(char *name,char *par1,char *val1,char *par2, char *val2){ +mxml_node_t *XMLwrapper::addparams2(const char *name,const char *par1,const char *val1,const char *par2, const char *val2){ mxml_node_t *element=mxmlNewElement(node,name); mxmlElementSetAttr(element,par1,val1); mxmlElementSetAttr(element,par2,val2); diff --git a/src/Misc/XMLwrapper.h b/src/Misc/XMLwrapper.h @@ -43,26 +43,26 @@ class XMLwrapper{ /********************************/ //returns 0 if ok or -1 if the file cannot be saved - int saveXMLfile(char *filename); + int saveXMLfile(const char *filename); //returns the new allocated string that contains the XML data (used for clipboard) //the string is NULL terminated char *getXMLdata(); //add simple parameter (name and value) - void addpar(char *name,int val); - void addparreal(char *name,REALTYPE val); + void addpar(const char *name,int val); + void addparreal(const char *name,REALTYPE val); //add boolean parameter (name and boolean value) //if the value is 0 => "yes", else "no" - void addparbool(char *name,int val); + void addparbool(const char *name,int val); //add string parameter (name and string) - void addparstr(char *name,char *val); + void addparstr(const char *name,const char *val); //add a branch - void beginbranch(char *name); - void beginbranch(char *name, int id); + void beginbranch(const char *name); + void beginbranch(const char *name, int id); //this must be called after each branch (nodes that contains child nodes) void endbranch(); @@ -75,16 +75,16 @@ class XMLwrapper{ int loadXMLfile(const char *filename); //used by the clipboard - bool putXMLdata(char *xmldata); + bool putXMLdata(const char *xmldata); //enter into the branch //returns 1 if is ok, or 0 otherwise - int enterbranch(char *name); + int enterbranch(const char *name); //enter into the branch with id //returns 1 if is ok, or 0 otherwise - int enterbranch(char *name, int id); + int enterbranch(const char *name, int id); //exits from a branch void exitbranch(); @@ -98,16 +98,16 @@ class XMLwrapper{ //it returns the parameter and limits it between min and max //if min==max==0, it will not limit it //if no parameter will be here, the defaultpar will be returned - int getpar(char *name,int defaultpar,int min,int max); + int getpar(const char *name,int defaultpar,int min,int max); //the same as getpar, but the limits are 0 and 127 - int getpar127(char *name,int defaultpar); + int getpar127(const char *name,int defaultpar); - int getparbool(char *name,int defaultpar); + int getparbool(const char *name,int defaultpar); - void getparstr(char *name,char *par,int maxstrlen); - REALTYPE getparreal(char *name,REALTYPE defaultpar); - REALTYPE getparreal(char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max); + void getparstr(const char *name,char *par,int maxstrlen); + REALTYPE getparreal(const char *name,REALTYPE defaultpar); + REALTYPE getparreal(const char *name,REALTYPE defaultpar,REALTYPE min,REALTYPE max); bool minimal;//false if all parameters will be stored (used only for clipboard) @@ -117,11 +117,11 @@ class XMLwrapper{ //opens a file and parse only the "information" data on it //returns "true" if all went ok or "false" on errors - bool checkfileinformation(char *filename); + bool checkfileinformation(const char *filename); private: - int dosavefile(char *filename,int compression,char *xmldata); + int dosavefile(const char *filename,int compression,const char *xmldata); char *doloadfile(const char *filename); @@ -133,17 +133,17 @@ class XMLwrapper{ //adds params like this: // <name> //returns the node - mxml_node_t *addparams0(char *name); + mxml_node_t *addparams0(const char *name); //adds params like this: // <name par1="val1"> //returns the node - mxml_node_t *addparams1(char *name,char *par1,char *val1); + mxml_node_t *addparams1(const char *name,const char *par1,const char *val1); //adds params like this: // <name par1="val1" par2="val2"> //returns the node - mxml_node_t *addparams2(char *name,char *par1,char *val1,char *par2, char *val2); + mxml_node_t *addparams2(const char *name,const char *par1,const char *val1,const char *par2, const char *val2); char *int2str(int x); char *real2str(REALTYPE x); diff --git a/src/Params/Presets.C b/src/Params/Presets.C @@ -32,7 +32,7 @@ Presets::Presets(){ Presets::~Presets(){ }; -void Presets::setpresettype(char *type){ +void Presets::setpresettype(const char *type){ strcpy(this->type,type); }; diff --git a/src/Params/Presets.h b/src/Params/Presets.h @@ -43,7 +43,7 @@ class Presets{ void rescanforpresets(); protected: - void setpresettype(char *type); + void setpresettype(const char *type); private: virtual void add2XML(XMLwrapper *xml)=0; virtual void getfromXML(XMLwrapper *xml)=0; diff --git a/src/Params/PresetsStore.C b/src/Params/PresetsStore.C @@ -110,8 +110,9 @@ void PresetsStore::rescanforpresets(char *type){ presets[presetk].file=new char [MAX_STRING_SIZE]; presets[presetk].name=new char [MAX_STRING_SIZE]; char tmpc=dirname[strlen(dirname)-1]; - char *tmps="/"; + const char *tmps; if ((tmpc=='/')||(tmpc=='\\')) tmps=""; + else tmps="/"; snprintf(presets[presetk].file,MAX_STRING_SIZE,"%s%s%s",dirname,tmps,filename); snprintf(presets[presetk].name,MAX_STRING_SIZE,"%s",filename); @@ -152,10 +153,11 @@ void PresetsStore::copypreset(XMLwrapper *xml,char *type, const char *name){ tmpfilename[i]='_'; }; - char *dirname=config.cfg.presetsDirList[0]; + const char *dirname=config.cfg.presetsDirList[0]; char tmpc=dirname[strlen(dirname)-1]; - char *tmps="/"; + const char *tmps; if ((tmpc=='/')||(tmpc=='\\')) tmps=""; + else tmps="/"; snprintf(filename,MAX_STRING_SIZE,"%s%s%s.%s.xpz",dirname,tmps,name,type); diff --git a/src/Seq/MIDIFile.C b/src/Seq/MIDIFile.C @@ -37,7 +37,7 @@ MIDIFile::~MIDIFile(){ clearmidifile(); }; -int MIDIFile::loadfile(char *filename){ +int MIDIFile::loadfile(const char *filename){ clearmidifile(); FILE *file=fopen(filename,"r"); diff --git a/src/Seq/MIDIFile.h b/src/Seq/MIDIFile.h @@ -32,7 +32,7 @@ class MIDIFile{ ~MIDIFile(); //returns -1 if there is an error, otherwise 0 - int loadfile(char *filename); + int loadfile(const char *filename); //returns -1 if there is an error, otherwise 0 int parsemidifile(MIDIEvents *me_); diff --git a/src/Seq/Sequencer.C b/src/Seq/Sequencer.C @@ -58,7 +58,7 @@ Sequencer::~Sequencer(){ }; -int Sequencer::importmidifile(char *filename){ +int Sequencer::importmidifile(const char *filename){ if (midifile.loadfile(filename)<0) return(-1); for (int i=0;i<NUM_MIDI_TRACKS;i++){ diff --git a/src/Seq/Sequencer.h b/src/Seq/Sequencer.h @@ -42,7 +42,7 @@ class Sequencer:public MIDIEvents{ int getevent(char ntrack, int *midich,int *type,int *par1, int *par2); //returns 0 if ok or -1 if there is a error loading file - int importmidifile(char *filename); + int importmidifile(const char *filename); void startplay(); void stopplay(); diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C @@ -543,7 +543,7 @@ void OscilGen::modulation(){ tmpsmps[i]=in[poshi]*(1.0-poslo)+in[poshi+1]*poslo; }; - delete(in); + delete [] in; fft->smps2freqs(tmpsmps,oscilFFTfreqs);//perform FFT }; diff --git a/src/Synth/PADnote.C b/src/Synth/PADnote.C @@ -242,7 +242,7 @@ PADnote::~PADnote(){ delete (NoteGlobalPar.GlobalFilterR); delete (NoteGlobalPar.FilterEnvelope); delete (NoteGlobalPar.FilterLfo); - delete (tmpwave); + delete [] tmpwave; }; diff --git a/src/UI/EffUI.fl b/src/UI/EffUI.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0107 +version 1.0109 header_name {.h} code_name {.cc} decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {} @@ -155,7 +155,7 @@ return(log(freq/20.0)/log(1000.0));} {} decl {int maxdB;} {} } -class EffUI {open : {public Fl_Group,public PresetsUI_} +class EffUI {: {public Fl_Group,public PresetsUI_} } { Function {EffUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} { code {eff=NULL; @@ -190,7 +190,7 @@ if (filterwindow!=NULL){ } Function {make_reverb_window()} {} { Fl_Window effreverbwindow { - xywh {262 421 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {343 337 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Text_Display {} { @@ -274,7 +274,7 @@ refresh(eff);} Fl_Dial revp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp1 { @@ -286,19 +286,19 @@ refresh(eff);} Fl_Dial revp2 { label Time callback {eff->seteffectpar(2,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Duration of Effect} xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp3 { label {I.del} callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {Initial Delay} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial revp4 { label {I.delfb} callback {eff->seteffectpar(4,(int) o->value());} - xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Initial Delay Feedback} xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp5 { @@ -316,19 +316,19 @@ refresh(eff);} Fl_Dial revp7 { label LPF callback {eff->seteffectpar(7,(int) o->value());} - xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Low Pass Filter} xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp8 { label HPF callback {eff->seteffectpar(8,(int) o->value());} - xywh {305 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {High Pass Filter} xywh {305 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp9 { label Damp callback {eff->seteffectpar(9,(int) o->value());} - xywh {340 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 minimum 64 maximum 127 step 1 + tooltip Dampening xywh {340 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 minimum 64 maximum 127 step 1 class WidgetPDial } Fl_Dial revp11 { @@ -336,7 +336,7 @@ refresh(eff);} callback {int x=64; if (Fl::event_button1()) x=(int)o->value(); else o->value(x); -eff->seteffectpar(11,x);} +eff->seteffectpar(11,x);} selected tooltip RoomSize xywh {190 10 25 25} box ROUND_UP_BOX labelfont 1 labelsize 8 align 8 minimum 1 maximum 127 step 1 class WidgetPDial } @@ -344,7 +344,7 @@ eff->seteffectpar(11,x);} } Function {make_echo_window()} {} { Fl_Window effechowindow { - xywh {178 394 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {318 364 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice echop { @@ -397,7 +397,7 @@ refresh(eff);} Fl_Dial echop0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial echop1 { @@ -415,32 +415,32 @@ refresh(eff);} Fl_Dial echop3 { label {LRdl.} callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {Delay Between L/R} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial echop4 { label {LRc.} callback {eff->seteffectpar(4,(int) o->value());} - xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {L/R Crossover} xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial echop5 { label {Fb.} callback {eff->seteffectpar(5,(int) o->value());} - xywh {195 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {195 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial echop6 { label Damp callback {eff->seteffectpar(6,(int) o->value());} - xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Dampening xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } } } Function {make_chorus_window()} {} { Fl_Window effchoruswindow { - xywh {210 263 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {372 287 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice chorusp { @@ -509,25 +509,25 @@ refresh(eff);} Fl_Dial chorusp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Frequency} xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp3 { label Rnd callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {LFO Randomness} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial chorusp5 { label {St.df} callback {eff->seteffectpar(5,(int) o->value());} - xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {L/R Phase Shift} xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Depth} xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp7 { @@ -539,13 +539,13 @@ refresh(eff);} Fl_Dial chorusp8 { label Fb callback {eff->seteffectpar(8,(int) o->value());} - xywh {305 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {305 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp9 { label {L/R} callback {eff->seteffectpar(9,(int) o->value());} - xywh {340 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Channel Routing} xywh {340 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Check_Button {} { @@ -557,7 +557,7 @@ refresh(eff);} Fl_Check_Button chorusp11 { label Substract callback {eff->seteffectpar(11,(int) o->value());} - xywh {185 10 70 20} box THIN_UP_BOX down_box DOWN_BOX color 230 labelfont 1 labelsize 10 + tooltip {inverts the output} xywh {185 10 70 20} box THIN_UP_BOX down_box DOWN_BOX color 230 labelfont 1 labelsize 10 } Fl_Choice chorusp4 { label {LFO type} @@ -575,10 +575,9 @@ refresh(eff);} } } } - Function {make_phaser_window()} {open - } { - Fl_Window effphaserwindow {selected - xywh {458 210 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + Function {make_phaser_window()} {} { + Fl_Window effphaserwindow { + xywh {389 213 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice phaserp { @@ -619,7 +618,7 @@ refresh(eff);} Fl_Dial phaserp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp1 { @@ -631,43 +630,43 @@ refresh(eff);} Fl_Dial phaserp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO frequency} xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp3 { label Rnd callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {LFO randomness} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial phaserp5 { label {St.df} callback {eff->seteffectpar(5,(int) o->value());} - xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Left/Right Channel Phase Shift} xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Depth} xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp7 { label Fb callback {eff->seteffectpar(7,(int) o->value());} - xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp9 { label {L/R} callback {eff->seteffectpar(9,(int) o->value());} - xywh {345 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Channel Routing} xywh {345 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Check_Button phaserp10 { label Substract callback {eff->seteffectpar(10,(int) o->value());} - xywh {185 10 74 20} box THIN_UP_BOX down_box DOWN_BOX color 230 labelfont 1 labelsize 10 + tooltip {inverts output} xywh {185 10 74 20} box THIN_UP_BOX down_box DOWN_BOX color 230 labelfont 1 labelsize 10 } Fl_Choice phaserp4 { label {LFO type} @@ -699,7 +698,7 @@ refresh(eff);} } Function {make_alienwah_window()} {} { Fl_Window effalienwahwindow { - xywh {230 283 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {538 250 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice awp { @@ -732,7 +731,7 @@ refresh(eff);} Fl_Dial awp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp1 { @@ -744,31 +743,31 @@ refresh(eff);} Fl_Dial awp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Frequency} xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp3 { label Rnd callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {LFO Randomness} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial awp5 { label {St.df} callback {eff->seteffectpar(5,(int) o->value());} - xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Left/Right Channel Phase Shift} xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Depth xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp7 { label Fb callback {eff->seteffectpar(7,(int) o->value());} - xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {270 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp9 { @@ -807,7 +806,7 @@ refresh(eff);} } Function {make_distorsion_window()} {} { Fl_Window effdistorsionwindow { - xywh {259 186 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {409 143 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice distp { @@ -848,7 +847,7 @@ refresh(eff);} Fl_Dial distp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial distp1 { @@ -860,31 +859,31 @@ refresh(eff);} Fl_Dial distp2 { label {LRc.} callback {eff->seteffectpar(2,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {L/R Mix} xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial distp3 { label Drive callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {Input Amplification} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial distp4 { label Level callback {eff->seteffectpar(4,(int) o->value());} - xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Output Amplification} xywh {155 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial distp7 { label LPF callback {eff->seteffectpar(7,(int) o->value());} - xywh {285 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Low Pass Filter} xywh {285 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial distp8 { label HPF callback {eff->seteffectpar(8,(int) o->value());} - xywh {320 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {High Pass Filter} xywh {320 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Choice distp5 { @@ -1035,7 +1034,7 @@ eqgraph->redraw();} callback {int np=eqband*5+13; eff->seteffectpar(np,(int) o->value()); eqgraph->redraw();} - xywh {310 50 25 25} box ROUND_UP_BOX labelfont 1 labelsize 10 when 3 maximum 127 + tooltip {Resonance/Bandwidth} xywh {310 50 25 25} box ROUND_UP_BOX labelfont 1 labelsize 10 when 3 maximum 127 class WidgetPDial } Fl_Counter stagescounter { @@ -1105,7 +1104,7 @@ eqgraph->redraw();} } Function {make_dynamicfilter_window()} {} { Fl_Window effdynamicfilterwindow { - xywh {104 461 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {570 56 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice dfp { @@ -1142,7 +1141,7 @@ refresh(eff);} Fl_Dial dfp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp1 { @@ -1154,25 +1153,25 @@ refresh(eff);} Fl_Dial dfp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Frequency} xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp3 { label Rnd callback {eff->seteffectpar(3,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {LFO Randomness} xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial dfp5 { label {St.df} callback {eff->seteffectpar(5,(int) o->value());} - xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Left/Right Channel Phase Shift} xywh {200 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp6 { label LfoD callback {eff->seteffectpar(6,(int) o->value());} - xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Depth} xywh {235 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Choice dfp4 { @@ -1194,25 +1193,25 @@ refresh(eff);} callback {filterwindow->show();} xywh {115 10 55 25} box PLASTIC_THIN_UP_BOX } - Fl_Group {} {open + Fl_Group {} { xywh {270 40 105 45} box BORDER_BOX color 181 } { Fl_Dial dfp7 { label {A.S.} callback {eff->seteffectpar(7,(int) o->value());} - xywh {275 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Filter vs Amplitude} xywh {275 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp9 { label {A.M} callback {eff->seteffectpar(9,(int) o->value());} - xywh {305 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {rate that amplitude changes the filter} xywh {305 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Check_Button dfp8 { label {A.Inv.} callback {eff->seteffectpar(8,(int) o->value());} - xywh {345 55 15 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 2 + tooltip {enable for filter frequency to lower with higher input amplitude} xywh {345 55 15 15} down_box DOWN_BOX labelfont 1 labelsize 11 align 2 } } } @@ -1223,7 +1222,7 @@ refresh(eff);} xywh {212 170 290 110} type Double hide } { Fl_Group {} { - label {DynFilter effect - Filter} open + label {DynFilter effect - Filter} xywh {5 5 275 75} box FLAT_BOX color 50 align 144 code0 {o->init(eff->filterpars,NULL,NULL);} code1 {o->use_for_dynamic_filter();} @@ -1449,7 +1448,7 @@ effdynamicfilterwindow->hide();//delete (effdynamicfilterwindow);} {} } Function {make_reverb_window()} {} { Fl_Window effreverbwindow { - xywh {151 285 233 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {398 298 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Text_Display {} { @@ -1519,32 +1518,32 @@ refresh(eff);} Fl_Dial revp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp2 { label Time callback {eff->seteffectpar(2,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Duration of Reverb} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial revp3 { label {I.del} callback {eff->seteffectpar(3,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {Initial Delay} xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial revp9 { label Damp callback {eff->seteffectpar(9,(int) o->value());} - xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 minimum 64 maximum 127 step 1 + tooltip Dampening xywh {120 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 minimum 64 maximum 127 step 1 class WidgetPDial } } } Function {make_echo_window()} {} { Fl_Window effechowindow { - xywh {243 350 231 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {243 350 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice echop { @@ -1597,7 +1596,7 @@ refresh(eff);} Fl_Dial echop0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial echop2 { @@ -1609,14 +1608,14 @@ refresh(eff);} Fl_Dial echop5 { label {Fb.} callback {eff->seteffectpar(5,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } } } Function {make_chorus_window()} {} { Fl_Window effchoruswindow { - xywh {234 353 233 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {234 353 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice chorusp { @@ -1673,19 +1672,19 @@ refresh(eff);} Fl_Dial chorusp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO Frequency} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Depth xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial chorusp7 { @@ -1697,7 +1696,7 @@ refresh(eff);} Fl_Dial chorusp8 { label Fb callback {eff->seteffectpar(8,(int) o->value());} - xywh {150 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {150 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Check_Button {} { @@ -1710,7 +1709,7 @@ refresh(eff);} } Function {make_phaser_window()} {} { Fl_Window effphaserwindow { - xywh {171 303 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {661 430 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice phaserp { @@ -1751,31 +1750,31 @@ refresh(eff);} Fl_Dial phaserp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO frequency} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp5 { label {St.df} callback {eff->seteffectpar(5,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Left/Right Channel Phase Shift} xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {115 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Depth xywh {115 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial phaserp7 { label Fb callback {eff->seteffectpar(7,(int) o->value());} - xywh {150 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Feedback xywh {150 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Counter phaserp8 { @@ -1788,7 +1787,7 @@ refresh(eff);} } Function {make_alienwah_window()} {} { Fl_Window effalienwahwindow { - xywh {183 344 234 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {367 170 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice awp { @@ -1821,19 +1820,19 @@ refresh(eff);} Fl_Dial awp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO frequency} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial awp6 { label Dpth callback {eff->seteffectpar(6,(int) o->value());} - xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip Depth xywh {85 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Counter awp8 { @@ -1846,7 +1845,7 @@ refresh(eff);} } Function {make_distorsion_window()} {} { Fl_Window effdistorsionwindow { - xywh {257 432 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {353 412 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice distp { @@ -1887,25 +1886,25 @@ refresh(eff);} Fl_Dial distp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial distp3 { label Drive callback {eff->seteffectpar(3,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 + tooltip {Input amplification} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 when 4 maximum 127 class WidgetPDial } Fl_Dial distp4 { label Level callback {eff->seteffectpar(4,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Output Amplification} xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial distp7 { label LPF callback {eff->seteffectpar(7,(int) o->value());} - xywh {190 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Low Pass Filter} xywh {190 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Choice distp5 { @@ -1974,7 +1973,7 @@ refresh(eff);} } Function {make_eq_window()} {} { Fl_Window effeqwindow { - xywh {258 307 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {318 309 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Text_Display {} { @@ -2034,7 +2033,7 @@ eqgraph->redraw();} callback {int np=eqband*5+13; eff->seteffectpar(np,(int) o->value()); eqgraph->redraw();} - xywh {10 50 25 25} box ROUND_UP_BOX labelfont 1 labelsize 10 when 3 maximum 127 + tooltip {Bandwidth/Resonance} xywh {10 50 25 25} box ROUND_UP_BOX labelfont 1 labelsize 10 when 3 maximum 127 class WidgetPDial } Fl_Counter stagescounter { @@ -2104,7 +2103,7 @@ eqgraph->redraw();} } Function {make_dynamicfilter_window()} {} { Fl_Window effdynamicfilterwindow { - xywh {271 375 232 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide + xywh {475 471 230 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide class Fl_Group } { Fl_Choice dfp { @@ -2141,34 +2140,34 @@ refresh(eff);} Fl_Dial dfp0 { label Vol callback {eff->seteffectpar(0,(int) o->value());} - xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {Effect Volume} xywh {10 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp2 { label Freq callback {eff->seteffectpar(2,(int) o->value());} - xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO frequency} xywh {45 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp6 { label LfoD callback {eff->seteffectpar(6,(int) o->value());} - xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {LFO depth} xywh {80 40 30 30} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } - Fl_Group {} {open + Fl_Group {} { xywh {115 40 65 45} box BORDER_BOX color 181 } { Fl_Dial dfp7 { label {A.S.} callback {eff->seteffectpar(7,(int) o->value());} - xywh {120 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {how filter varies with amplitude} xywh {120 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } Fl_Dial dfp9 { label {A.M} callback {eff->seteffectpar(9,(int) o->value());} - xywh {150 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 + tooltip {how quickly the filter varies with amplitude} xywh {150 45 25 25} box ROUND_UP_BOX labelfont 1 labelsize 11 maximum 127 class WidgetPDial } } @@ -2202,8 +2201,7 @@ effdynamicfilterwindow->position(px,py); refresh(eff);} {} } - Function {refresh(EffectMgr *eff_)} {open - } { + Function {refresh(EffectMgr *eff_)} {} { code {eff=eff_; this->hide(); diff --git a/src/UI/FilterUI.fl b/src/UI/FilterUI.fl @@ -141,7 +141,7 @@ for (i=1;i<lx;i++){ };} {} } Function {~FormantFilterGraph()} {} { - code {delete(graphpoints);} {} + code {delete [] graphpoints;} {} } decl {FilterParams *pars;} {} decl {int oldx,oldy;} {} diff --git a/src/UI/WidgetPDial.fl b/src/UI/WidgetPDial.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0105 +version 1.0109 header_name {.h} code_name {.cc} decl {//Copyright (c) 2003-2005 Nasca Octavian Paul} {} @@ -12,16 +12,95 @@ decl {\#include <FL/Fl_Dial.H>} {public decl {\#include <FL/fl_draw.H>} {public } -decl {\#include <stdio.h>} {public +decl {\#include <FL/Fl_Tooltip.H>} {public } decl {\#include <math.h>} {public } +decl {\#include <string.h>} {public +} + +decl {\#include <stdio.h>} {public +} + +decl {\#include <FL/Fl_Group.H>} {public +} + +decl {\#include <FL/Fl_Menu_Window.H>} {public +} + +class TipWin {: {public Fl_Menu_Window} +} { + Function {TipWin():Fl_Menu_Window(1,1)} {} { + code {strcpy(tip, "X.XX"); +set_override(); +end();} {} + } + Function {draw()} {return_type void + } { + code {draw_box(FL_BORDER_BOX, 0, 0, w(), h(), Fl_Color(175)); + fl_color(FL_BLACK); + fl_font(labelfont(), labelsize()); + if(textmode) + fl_draw(text, 3, 3, w()-6, h()-6, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP)); + else + fl_draw(tip, 3, 3, w()-6, h()-6, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP));} {} + } + Function {value(float f)} {return_type void + } { + code {sprintf(tip, "%.2f", f); +textmode=false; + // Recalc size of window + fl_font(labelfont(), labelsize()); + int W = w(), H = h(); + fl_measure(tip, W, H, 0); + W += 8; + size(W, H); + redraw();} {} + } + Function {setText(const char * c)} {return_type void + } { + code {strcpy(text,c); +textmode=true; + // Recalc size of window + fl_font(labelfont(), labelsize()); + int W = w(), H = h(); + fl_measure(text, W, H, 0); + W += 8; + size(W, H); + redraw();} {} + } + Function {setTextmode()} {return_type void + } { + code {textmode=true; + // Recalc size of window + fl_font(labelfont(), labelsize()); + int W = w(), H = h(); + fl_measure(text, W, H, 0); + W += 8; + size(W, H); + redraw();} {} + } + decl {char tip[40];} {} + decl {bool textmode;} {} + decl {char text[400];//bad stuff will happen if too much is put in this (perhaps dynamically allocate?)} {} +} + class WidgetPDial {: {public Fl_Dial} } { Function {WidgetPDial(int x,int y, int w, int h, const char *label=0):Fl_Dial(x,y,w,h,label)} {} { - code {oldvalue=0.0;} {} + code {callback(value_cb, (void*)this); +Fl_Group *save = Fl_Group::current(); +tipwin = new TipWin(); +tipwin->hide(); +Fl_Group::current(save); +oldvalue=0.0; +pos=false; +textset=false;} {} + } + Function {~WidgetPDial()} {} { + code {delete tipwin;} {} } Function {handle(int event)} {return_type int } { @@ -29,8 +108,15 @@ class WidgetPDial {: {public Fl_Dial} int my; switch (event){ -case FL_PUSH:oldvalue=value(); +case FL_PUSH: + oldvalue=value(); case FL_DRAG: + if(!pos){ + tipwin->position(Fl::event_x_root(), Fl::event_y_root()+20); + pos=true; + } + tipwin->value(value()); + tipwin->show(); my=-(Fl::event_y()-y()-h()/2); dragsize=200.0; @@ -45,7 +131,24 @@ case FL_DRAG: if (this->when()!=0) do_callback(); return(1); break; +case FL_ENTER: + if(textset){ + if(!pos){ + tipwin->position(Fl::event_x_root(), Fl::event_y_root()+20); + pos=true; + } + tipwin->setTextmode(); + tipwin->show(); + return(1);} + break; +case FL_HIDE: +case FL_LEAVE: + tipwin->hide(); + pos=false; + break; case FL_RELEASE: + tipwin->hide(); + pos=false; if (this->when()==0) do_callback(); return(1); break; @@ -127,5 +230,22 @@ fl_pop_matrix();} {} code {if (active_r()) fl_color(r,g,b); else fl_color(160-(160-r)/3,160-(160-b)/3,160-(160-b)/3);} {} } + Function {value_cb2()} {return_type void + } { + code {tipwin->value(value());} {} + } + Function {value_cb(Fl_Widget*, void*data)} {return_type {static void} + } { + code {WidgetPDial *val = (WidgetPDial*)data; + val->value_cb2();} {} + } + Function {tooltip(const char * c)} {return_type void + } { + code {tipwin->setText(c); +textset=true;} {} + } + decl {bool textset;} {} + decl {bool pos;} {} decl {double oldvalue;} {} + decl {TipWin *tipwin;} {} } diff --git a/src/main.C b/src/main.C @@ -341,8 +341,8 @@ void exitprogram(){ #endif // pthread_mutex_unlock(&master->mutex); - delete(denormalkillbuf); - delete(OscilGen::tmpsmps); + delete [] denormalkillbuf; + delete [] OscilGen::tmpsmps; deleteFFTFREQS(&OscilGen::outoscilFFTfreqs); };