commit 7e0d2d173353d166cb22e6f35064e98bd061106d
parent 719959d10c5e377fc7593b1df8bcb1131bd26b0b
Author: paulnasca <paulnasca>
Date: Sat, 3 Jul 2004 10:26:55 +0000
*** empty log message ***
Diffstat:
9 files changed, 85 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -604,5 +604,7 @@
02 Iul 2004 - Continuat la DynamicFilter (adaugata auto-update, adaugat preset-uri)
- Terminat DynamicFilter
- Corectata o eroare la EQui care facea ca sa nu se actualizeze efectul curent si sa nu se obtina graficul egalizatorului
-
+03 Iul 2004 - Corectata o mica eroare care nu activa la EffectUI daca efectul anterior era dezactivat
+ - Actualizat Swap/Copy la efecte ca sa proceseze si parametrii la filtre
+ - Adaugat Bypass la efectele de instrument
diff --git a/src/Misc/Master.C b/src/Misc/Master.C
@@ -537,6 +537,7 @@ void Master::vuresetpeaks(){
*/
void Master::swapcopyeffects(int what,int type,int neff1,int neff2){
EffectMgr *eff1,*eff2;
+ FilterParams tmpfilterparams(0,64,64);
if (neff1==neff2) return;//to swap a effect with itself or copy to itself is meaningless
if (type==0) {
@@ -552,14 +553,19 @@ void Master::swapcopyeffects(int what,int type,int neff1,int neff2){
unsigned char preset=eff2->getpreset();
unsigned char par[128];
for (int i=0;i<128;i++) par[i]=eff2->geteffectpar(i);
+ if (eff2->filterpars!=NULL) tmpfilterparams.getfromFilterParams(eff2->filterpars);
+
//copy the eff1 to eff2
eff2->changeeffect(eff1->geteffect());
eff2->changepreset_nolock(eff1->getpreset());
for (int i=0;i<128;i++) eff2->seteffectpar_nolock(i,eff1->geteffectpar(i));
+ if (eff2->filterpars!=NULL) eff2->filterpars->getfromFilterParams(eff1->filterpars);
+
if (what==0){//if swapping is needed, copy the saved parameters to eff1
eff1->changeeffect(effect);
eff1->changepreset_nolock(preset);
for (int i=0;i<128;i++) eff1->seteffectpar_nolock(i,par[i]);
+ if (eff1->filterpars!=NULL) eff1->filterpars->getfromFilterParams(&tmpfilterparams);
};
};
diff --git a/src/Misc/Part.C b/src/Misc/Part.C
@@ -52,6 +52,7 @@ Part::Part(Microtonal *microtonal_,FFTwrapper *fft_, pthread_mutex_t *mutex_){
for (int n=0;n<NUM_PART_EFX+1;n++) {
partfxinputl[n]=new REALTYPE [SOUND_BUFFER_SIZE];
partfxinputr[n]=new REALTYPE [SOUND_BUFFER_SIZE];
+ Pefxbypass[n]=false;
};
killallnotes=0;
@@ -515,7 +516,7 @@ void Part::ComputePartSmps(){
//Apply part's effects and mix them
for (int nefx=0;nefx<NUM_PART_EFX;nefx++) {
- partefx[nefx]->out(partfxinputl[nefx],partfxinputr[nefx]);
+ if (!Pefxbypass[nefx]) partefx[nefx]->out(partfxinputl[nefx],partfxinputr[nefx]);
int routeto=(Pefxroute[nefx]==0 ? nefx+1 : NUM_PART_EFX);
for (i=0;i<SOUND_BUFFER_SIZE;i++){
partfxinputl[routeto][i]+=partfxinputl[nefx][i];
@@ -980,6 +981,7 @@ void Part::add2XMLinstrument(XMLwrapper *xml){
xml->endbranch();
xml->addpar("route",Pefxroute[nefx]);
+ xml->addparbool("bypass",Pefxbypass[nefx]);
xml->endbranch();
};
xml->endbranch();
@@ -1107,8 +1109,8 @@ void Part::getfromXMLinstrument(XMLwrapper *xml){
xml->exitbranch();
};
- xml->getpar("route",Pefxroute[nefx],0,NUM_PART_EFX);
-
+ Pefxroute[nefx]=xml->getpar("route",Pefxroute[nefx],0,NUM_PART_EFX);
+ Pefxbypass[nefx]=xml->getparbool("bypass",Pefxbypass[nefx]);
xml->exitbranch();
};
xml->exitbranch();
diff --git a/src/Misc/Part.h b/src/Misc/Part.h
@@ -135,6 +135,8 @@ class Part{
EffectMgr *partefx[NUM_PART_EFX];//insertion part effects (they are part of the instrument)
unsigned char Pefxroute[NUM_PART_EFX];//how the effect's output is routed(to next effect/to out)
+ bool Pefxbypass[NUM_PART_EFX];//if the effects are bypassed
+
pthread_mutex_t *mutex;
diff --git a/src/Params/FilterParams.C b/src/Params/FilterParams.C
@@ -69,6 +69,45 @@ void FilterParams::defaults(){
};
/*
+ * Get the parameters from other FilterParams
+ */
+
+void FilterParams::getfromFilterParams(FilterParams *pars){
+ defaults();
+
+ if (pars==NULL) return;
+
+ Ptype=pars->Ptype;
+ Pfreq=pars->Pfreq;
+ Pq=pars->Pq;
+
+ Pstages=pars->Pstages;
+ Pfreqtrack=pars->Pfreqtrack;
+ Pgain=pars->Pgain;
+ Pcategory=pars->Pcategory;
+
+ Pnumformants=pars->Pnumformants;
+ Pformantslowness=pars->Pformantslowness;
+ for (int j=0;j<FF_MAX_VOWELS;j++){
+ for (int i=0;i<FF_MAX_FORMANTS;i++){
+ Pvowels[j].formants[i].freq=pars->Pvowels[j].formants[i].freq;
+ Pvowels[j].formants[i].q=pars->Pvowels[j].formants[i].q;
+ Pvowels[j].formants[i].amp=pars->Pvowels[j].formants[i].amp;
+ };
+ };
+
+ Psequencesize=pars->Psequencesize;
+ for (int i=0;i<FF_MAX_SEQUENCE;i++) Psequence[i].nvowel=pars->Psequence[i].nvowel;
+
+ Psequencestretch=pars->Psequencestretch;
+ Psequencereversed=pars->Psequencereversed;
+ Pcenterfreq=pars->Pcenterfreq;
+ Poctavesfreq=pars->Poctavesfreq;
+ Pvowelclearness=pars->Pvowelclearness;
+};
+
+
+/*
* Parameter control
*/
REALTYPE FilterParams::getfreq(){
diff --git a/src/Params/FilterParams.h b/src/Params/FilterParams.h
@@ -37,6 +37,7 @@ class FilterParams{
void defaults();
void getfromXML(XMLwrapper *xml);
+ void getfromFilterParams(FilterParams *pars);
REALTYPE getfreq();
REALTYPE getq();
diff --git a/src/UI/EffUI.fl b/src/UI/EffUI.fl
@@ -152,7 +152,7 @@ return(log(freq/20.0)/log(1000.0));} {}
decl {int maxdB;} {}
}
-class EffUI {open : {public Fl_Group}
+class EffUI {: {public Fl_Group}
} {
Function {EffUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
code {eff=NULL;
@@ -1099,7 +1099,7 @@ eqgraph->redraw();}
}
}
Function {make_dynamicfilter_window()} {} {
- Fl_Window effdynamicfilterwindow {selected
+ Fl_Window effdynamicfilterwindow {
xywh {104 461 380 95} type Double box PLASTIC_UP_BOX color 221 labelfont 1 hide
class Fl_Group
} {
@@ -1259,7 +1259,8 @@ effdynamicfilterwindow->position(px,py);
refresh(eff);} {}
}
- Function {refresh(EffectMgr *eff_)} {} {
+ Function {refresh(EffectMgr *eff_)} {open
+ } {
code {eff=eff_;
this->hide();
@@ -1272,6 +1273,7 @@ effalienwahwindow->hide();
effdistorsionwindow->hide();
effeqwindow->hide();
effdynamicfilterwindow->hide();
+
eqband=0;
if (filterwindow!=NULL){
@@ -1405,7 +1407,8 @@ switch(eff->geteffect()){
break;
};
-this->show();} {}
+this->show();} {selected
+ }
}
decl {EffectMgr *eff;} {}
decl {int eqband;} {}
diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl
@@ -372,8 +372,8 @@ fl_alert("ZynAddSubFX could not be closed this way, because it's a VST plugin. P
\#else
if (fl_ask("Exit and leave the unsaved data?")) *exitprogram=1;
\#endif}
- xywh {188 182 390 465} type Double
- code0 {setfilelabel(NULL);} non_modal visible
+ xywh {188 182 390 465} type Double hide
+ code0 {setfilelabel(NULL);} non_modal
} {
Fl_Menu_Bar mastermenu {
xywh {0 0 690 25}
@@ -770,7 +770,7 @@ pthread_mutex_unlock(&master->mutex);}
} {
Fl_Group {} {
label {System Effects} open
- xywh {0 100 390 140} box ENGRAVED_FRAME labeltype EMBOSSED_LABEL labelsize 20 align 25
+ xywh {0 100 390 140} box ENGRAVED_FRAME labeltype EMBOSSED_LABEL labelsize 20 align 25 hide
} {
Fl_Counter syseffnocounter {
label {Sys.Effect No.}
@@ -830,7 +830,7 @@ syseffectui->refresh(master->sysefx[nsyseff]);}
Fl_Group syseffectuigroup {
xywh {5 140 380 95} box FLAT_BOX color 48
} {
- Fl_Group syseffectui {selected
+ Fl_Group syseffectui {
xywh {5 140 380 95}
code0 {o->init(master->sysefx[nsyseff]);}
class EffUI
@@ -851,7 +851,7 @@ swapeffwindow->show();}
}
Fl_Group {} {
label {Insertion Effects}
- xywh {0 100 390 140} box ENGRAVED_FRAME labeltype EMBOSSED_LABEL labelsize 20 align 25 hide
+ xywh {0 100 390 140} box ENGRAVED_FRAME labeltype EMBOSSED_LABEL labelsize 20 align 25
} {
Fl_Button {} {
label {Swap/Copy...}
@@ -866,13 +866,16 @@ swapeffwindow->show();}
insefftype->value(master->insefx[ninseff]->geteffect());
inseffpart->value(master->Pinsparts[ninseff]+2);
inseffectui->refresh(master->insefx[ninseff]);
+
if (master->Pinsparts[ninseff]!=-1) {
insefftype->activate();
inseffectui->activate();
+ inseffectuigroup->activate();
} else {
insefftype->deactivate();
inseffectui->deactivate();
-};}
+ inseffectuigroup->deactivate();
+};} selected
xywh {5 120 80 20} type Simple labelfont 1 labelsize 11 align 1 minimum 0 maximum 127 step 1 textfont 1
code0 {o->bounds(0,NUM_INS_EFX-1);}
code1 {o->value(ninseff);}
diff --git a/src/UI/PartUI.fl b/src/UI/PartUI.fl
@@ -582,7 +582,7 @@ part->ctl.portamento.updowntimestretch=x;}
}
Fl_Window partfx {
label {Part's Insert Effects}
- private xywh {112 331 390 145} type Double hide
+ private xywh {121 424 390 145} type Double hide
} {
Fl_Counter inseffnocounter {
label {Ins.Effect No.}
@@ -592,6 +592,8 @@ insefftype->value(part->partefx[ninseff]->geteffect());
inseffectui->refresh(part->partefx[ninseff]);
int x=part->Pefxroute[ninseff];
if (x==127) x=1;
+bypasseff->value(part->Pefxbypass[ninseff]);
+
sendtochoice->value(x);}
xywh {5 110 80 20} type Simple labelfont 1 labelsize 11 align 6 minimum 0 maximum 127 step 1 textfont 1
code0 {o->bounds(0,NUM_PART_EFX-1);}
@@ -602,8 +604,8 @@ sendtochoice->value(x);}
callback {pthread_mutex_lock(part->mutex);
part->partefx[ninseff]->changeeffect((int) o->value());
pthread_mutex_unlock(part->mutex);
-inseffectui->refresh(part->partefx[ninseff]);} selected
- xywh {95 110 70 15} down_box BORDER_BOX labelsize 11 align 6
+inseffectui->refresh(part->partefx[ninseff]);}
+ xywh {155 110 70 15} down_box BORDER_BOX labelsize 11 align 6
code0 {o->value(part->partefx[ninseff]->geteffect());}
} {
menuitem {} {
@@ -655,14 +657,14 @@ inseffectui->refresh(part->partefx[ninseff]);} selected
Fl_Button {} {
label Close
callback {partfx->hide();}
- xywh {315 120 70 20}
+ xywh {320 120 65 20}
}
Fl_Choice sendtochoice {
label {Send To.}
callback {int x=(int) o->value();
if (x==1) x=127;
part->Pefxroute[ninseff]=x;}
- xywh {175 110 80 15} down_box BORDER_BOX labelsize 11 align 6
+ xywh {235 110 80 15} down_box BORDER_BOX labelsize 11 align 6
code0 {int x=part->Pefxroute[ninseff]; if (x==127) x=1;}
code1 {o->value(x);}
} {
@@ -675,6 +677,12 @@ part->Pefxroute[ninseff]=x;}
xywh {55 55 100 20} labelfont 1 labelsize 11
}
}
+ Fl_Check_Button bypasseff {
+ label bypass
+ callback {part->Pefxbypass[ninseff]=(((int)o->value())!=0);} selected
+ tooltip {if the effect is not used (is bypassed)} xywh {90 110 60 15} down_box DOWN_BOX labelsize 12
+ code0 {int x=part->Pefxbypass[ninseff];}
+ }
}
Fl_Window instrumentkitlist {
label {Instrument Kit}