|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885 |
- # data file for the Fltk User Interface Designer (fluid)
- version 1.0110
- header_name {.h}
- code_name {.cc}
- decl {//Copyright (c) 2002-2009 Nasca Octavian Paul} {}
-
- decl {//License: GNU GPL version 2 or later} {}
-
- decl {\#include <stdlib.h>} {public
- }
-
- decl {\#include <stdio.h>} {public
- }
-
- decl {\#include <string.h>} {public
- }
-
- decl {\#include "WidgetPDial.h"} {public
- }
-
- decl {\#include "ADnoteUI.h"} {public
- }
-
- decl {\#include "SUBnoteUI.h"} {public
- }
-
- decl {\#include "EffUI.h"} {public
- }
-
- decl {\#include "VirKeyboard.h"} {public
- }
-
- decl {\#include "ConfigUI.h"} {public
- }
-
- decl {\#include "BankUI.h"} {public
- }
-
- decl {\#include "PartUI.h"} {public
- }
-
- decl {\#include "MicrotonalUI.h"} {public
- }
-
- decl {\#include "PresetsUI.h"} {public
- }
-
- decl {\#include "NioUI.h"} {public global
- }
-
- decl {\#include "../Misc/Master.h"} {public
- }
-
- decl {\#include "../Misc/Part.h"} {public
- }
-
- decl {\#include "../Misc/Util.h"} {public
- }
-
- decl {\#include "common.H"} {public
- }
-
- decl {\#if USE_NSM
- \#include "NSM.H"
- extern NSM_Client *nsm;
- \#endif} {public
- }
-
- decl {\#include "../globals.h"} {public
- }
-
- class VUMeter {: {public Fl_Box}
- } {
- Function {VUMeter(int x,int y, int w, int h, const char *label=0):Fl_Box(x,y,w,h,label)} {} {
- code {master=NULL;
- npart=-1;} {}
- }
- Function {init(Master *master_,int part_)} {} {
- code {//the "part_" parameters sets the part (if it is >=0), else it sets the master
- master=master_;
- label(NULL);
- npart=part_;
- olddbl=0.0;
- olddbr=0.0;
- oldrmsdbl=0.0;
- oldrmsdbr=0.0;} {}
- }
- Function {draw_master()} {} {
- code {\#define MIN_DB (-48)
-
- int ox=x(); int oy=y(); int lx=w(); int ly=h();
-
- vuData data = master->getVuData();
-
- //pthread_mutex_lock(&master->mutex);
- float dbl=rap2dB(data.outpeakl);
- float dbr=rap2dB(data.outpeakr);
- float rmsdbl=rap2dB(data.rmspeakl);
- float rmsdbr=rap2dB(data.rmspeakr);
- float maxdbl=rap2dB(data.maxoutpeakl);
- float maxdbr=rap2dB(data.maxoutpeakr);
- int clipped=data.clipped;
- //pthread_mutex_unlock(&master->mutex);
-
- dbl=(MIN_DB-dbl)/MIN_DB;
- if (dbl<0.0) dbl=0.0;
- else if (dbl>1.0)dbl=1.0;
-
- dbr=(MIN_DB-dbr)/MIN_DB;
- if (dbr<0.0) dbr=0.0;
- else if (dbr>1.0) dbr=1.0;
-
- dbl=dbl*0.4+olddbl*0.6;
- dbr=dbr*0.4+olddbr*0.6;
-
- if ( damage() & FL_DAMAGE_USER1 )
- {
- if ( olddbl == dbl && olddbr == dbr )
- return;
- }
-
- olddbl=dbl;
- olddbr=dbr;
-
- \#define VULENX (lx-35)
- \#define VULENY (ly/2-3)
-
- dbl*=VULENX;dbr*=VULENX;
-
- int idbl=(int) dbl;
- int idbr=(int) dbr;
-
- //compute RMS - start
- rmsdbl=(MIN_DB-rmsdbl)/MIN_DB;
- if (rmsdbl<0.0) rmsdbl=0.0;
- else if (rmsdbl>1.0) rmsdbl=1.0;
-
- rmsdbr=(MIN_DB-rmsdbr)/MIN_DB;
- if (rmsdbr<0.0) rmsdbr=0.0;
- else if (rmsdbr>1.0) rmsdbr=1.0;
-
- rmsdbl=rmsdbl*0.4+oldrmsdbl*0.6;
- rmsdbr=rmsdbr*0.4+oldrmsdbr*0.6;
-
- oldrmsdbl=rmsdbl;
- oldrmsdbr=rmsdbr;
-
-
- rmsdbl*=VULENX;rmsdbr*=VULENX;
-
- int irmsdbl=(int) rmsdbl;
- int irmsdbr=(int) rmsdbr;
- //compute RMS - end
-
-
-
- //draw the vu-meter lines
- //db
- fl_rectf(ox,oy,idbr,VULENY,0,200,255);
- fl_rectf(ox,oy+ly/2,idbl,VULENY,0,200,255);
- //black
- fl_rectf(ox+idbr,oy,VULENX-idbr,VULENY,0,0,0);
- fl_rectf(ox+idbl,oy+ly/2,VULENX-idbl,VULENY,0,0,0);
-
- //draw the scales
- float tmp=VULENX*1.0/MIN_DB;
- for (int i=1;i<1-MIN_DB;i++){
- int tx=VULENX+(int) (tmp*i);
- fl_rectf(ox+tx,oy,1,VULENY+ly/2,0,160,200);
- if (i%5==0) fl_rectf(ox+tx,oy,1,VULENY+ly/2,0,230,240);
- if (i%10==0) fl_rectf(ox+tx-1,oy,2,VULENY+ly/2,0,225,255);
- };
-
- //rms
- if (irmsdbr>2) fl_rectf(ox+irmsdbr-1,oy,3,VULENY,255,255,0);
- if (irmsdbl>2) fl_rectf(ox+irmsdbl-1,oy+ly/2,3,VULENY,255,255,0);
-
-
- //draw the red box if clipping has occured
- if (clipped==0) fl_rectf(ox+VULENX+2,oy+1,lx-VULENX-3,ly-4,0,0,10);
- else fl_rectf(ox+VULENX+2,oy+1,lx-VULENX-3,ly-4,250,10,10);
-
- //draw the maxdB
- fl_font(FL_HELVETICA|FL_BOLD,10);
- fl_color(255,255,255);
- char tmpstr[10];
- if ((maxdbl>MIN_DB-20)){
- snprintf((char *)&tmpstr,10,"%ddB",(int)maxdbr);
- fl_draw(tmpstr,ox+VULENX+1,oy+1,lx-VULENX-1,VULENY,FL_ALIGN_RIGHT,NULL,0);
- };
- if ((maxdbr>MIN_DB-20)){
- snprintf((char *)&tmpstr,10,"%ddB",(int)maxdbl);
- fl_draw(tmpstr,ox+VULENX+1,oy+ly/2+1,lx-VULENX-1,VULENY,FL_ALIGN_RIGHT,NULL,0);
- };} {}
- }
- Function {draw_part()} {} {
- code {\#define MIN_DB (-48)
- int ox=x(); int oy=y(); int lx=w(); int ly=h();
-
- if (!active_r()){
- pthread_mutex_lock(&master->vumutex);
- int fakedb=master->fakepeakpart[npart];
- pthread_mutex_unlock(&master->vumutex);
- fl_rectf(ox,oy,lx,ly,140,140,140);
- if (fakedb>0){
- fakedb=(int)(fakedb/255.0*ly)+4;
- fl_rectf(ox+2,oy+ly-fakedb,lx-4,fakedb,0,0,0);
- };
-
- return;
- };
-
- //draw the vu lines
- pthread_mutex_lock(&master->vumutex);
- float db=rap2dB(master->vuoutpeakpart[npart]);
- pthread_mutex_unlock(&master->vumutex);
-
- db=(MIN_DB-db)/MIN_DB;
- if (db<0.0) db=0.0;
- else if (db>1.0) db=1.0;
-
- db*=ly-2;
-
- int idb=(int) db;
-
- fl_rectf(ox,oy+ly-idb,lx,idb,0,200,255);
- fl_rectf(ox,oy,lx,ly-idb,0,0,0);
-
-
- //draw the scales
- float tmp=ly*1.0/MIN_DB;
- for (int i=1;i<1-MIN_DB;i++){
- int ty=ly+(int) (tmp*i);
- if (i%5==0) fl_rectf(ox,oy+ly-ty,lx,1,0,160,200);
- if (i%10==0) fl_rectf(ox,oy+ly-ty,lx,1,0,230,240);
- };} {}
- }
- Function {draw()} {} {
- code {if (npart>=0) draw_part();
- else draw_master();} {}
- }
- Function {tickdraw(VUMeter *o)} {return_type {static void}
- } {
- code {o->damage(FL_DAMAGE_USER1);} {}
- }
- Function {tick(void *v)} {return_type {static void}
- } {
- code {tickdraw((VUMeter *) v);
- Fl::repeat_timeout(1.0/18.0,tick,v);//18 fps} {}
- }
- Function {handle(int event)} {return_type int
- } {
- code {switch(event){
- case FL_SHOW:
- Fl::add_timeout(1.0/18.0,tick,this);
- break;
- case FL_HIDE:
- Fl::remove_timeout(tick,this);
- break;
- case FL_PUSH:
- if (npart>=0) break;
- pthread_mutex_lock(&master->mutex);
- master->vuresetpeaks();
- pthread_mutex_unlock(&master->mutex);
- break;
- };
- return(1);} {}
- }
- decl {Master *master;} {}
- decl {int npart;} {}
- decl {float olddbl,olddbr;} {}
- decl {float oldrmsdbl,oldrmsdbr;} {}
- }
-
- class SysEffSend {open : {public WidgetPDial}
- } {
- Function {SysEffSend(int x,int y, int w, int h, const char *label=0):WidgetPDial(x,y,w,h,label)} {} {
- code {master=NULL;
- neff1=0;
- neff2=0;} {}
- }
- Function {init(Master *master_,int neff1_,int neff2_)} {} {
- code {neff1=neff1_;
- neff2=neff2_;
- master=master_;
- minimum(0);
- maximum(127);
- step(1);
- labelfont(1);
- labelsize(10);
- align(FL_ALIGN_TOP);
-
- value(master->Psysefxsend[neff1][neff2]);
- char tmp[20];snprintf(tmp,20,"%d->%d",neff1+1,neff2+1);
- this->copy_label(tmp);} {}
- }
- Function {~SysEffSend()} {} {
- code {hide();} {}
- }
- Function {handle(int event)} {return_type int
- } {
- code {if ((event==FL_PUSH) || (event==FL_DRAG)){
- master->setPsysefxsend(neff1,neff2,(int) value());
- };
-
- return(WidgetPDial::handle(event));} {}
- }
- decl {Master *master;} {}
- decl {int neff1;} {}
- decl {int neff2;} {}
- }
-
- class Panellistitem {open : {public Fl_Group}
- } {
- Function {make_window()} {open private
- } {
- Fl_Window panellistitem {open
- private xywh {608 711 100 260} type Double box NO_BOX
- class Fl_Group visible
- } {
- Fl_Group panellistitemgroup {open
- private xywh {0 20 70 240} box UP_FRAME
- code0 {if (master->part[npart]->Penabled==0) o->deactivate();}
- code1 {set_module_parameters( o );}
- } {
- Fl_Group {} {
- xywh {45 65 15 110} box ENGRAVED_FRAME
- } {
- Fl_Box {} {
- label {V U}
- xywh {45 65 15 110} box FLAT_BOX color 0 selection_color 75 labelcolor 55 align 128
- code0 {o->init(master,npart);}
- class VUMeter
- }
- }
- Fl_Button partname {
- label { }
- callback {if ((int)bankui->cbwig->value()!=(npart+1)){
- bankui->cbwig->value(npart+1);
- bankui->cbwig->do_callback();
- };
- bankui->show();}
- xywh {5 27 60 30} box THIN_DOWN_BOX down_box FLAT_BOX labelfont 1 labelsize 10 align 208
- }
- Fl_Slider partvolume {
- callback {master->part[npart]->setPvolume((int) o->value());}
- xywh {10 65 30 110} type {Vert Knob} box NO_BOX minimum 127 maximum 0 step 1 value 127
- code0 {o->value(master->part[npart]->Pvolume);}
- }
- Fl_Dial partpanning {
- callback {master->part[npart]->setPpanning((int) o->value());}
- xywh {20 180 30 30} maximum 127 step 1
- code0 {o->value(master->part[npart]->Ppanning);}
- class WidgetPDial
- }
- Fl_Button {} {
- label edit
- callback {if ((int)bankui->cbwig->value()!=(npart+1)){
- bankui->cbwig->value(npart+1);
- bankui->cbwig->do_callback();
- };}
- xywh {15 235 40 20} labelsize 10
- }
- Fl_Choice partrcv {
- callback {master->part[npart]->Prcvchn=(int) o->value();}
- tooltip {receive from Midi channel} xywh {10 213 50 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
- code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Ch%d",i+1);if (i!=9) o->add(nrstr); else o->add("Dr10");};}
- code1 {o->value(master->part[npart]->Prcvchn);}
- } {}
- }
- Fl_Check_Button partenabled {
- label 01
- callback {pthread_mutex_lock(&master->mutex);
- master->partonoff(npart,(int) o->value());
- pthread_mutex_unlock(&master->mutex);
-
- if ((int) o->value()==0) panellistitemgroup->deactivate();
- else {
- panellistitemgroup->activate();
- if ((int)bankui->cbwig->value()!=(npart+1)){
- bankui->cbwig->value(npart+1);
- bankui->cbwig->do_callback();
- };
- };
-
- o->redraw();}
- private xywh {5 0 45 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 24
- code0 {char tmp[10];snprintf(tmp,10,"%d",npart+1);o->copy_label(tmp);}
- code1 {o->value(master->part[npart]->Penabled);}
- }
- }
- }
- Function {Panellistitem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
- code {npart=0;
- master=NULL;
- bankui=NULL;} {}
- }
- Function {init(Master *master_, int npart_,BankUI *bankui_)} {} {
- code {npart=npart_;
- master=master_;
- bankui=bankui_;
-
- make_window();
- panellistitem->show();
- end();} {}
- }
- Function {refresh()} {} {
- code {partenabled->value(master->part[npart]->Penabled);
- if (master->part[npart]->Penabled!=0) panellistitemgroup->activate();
- else panellistitemgroup->deactivate();
-
- partvolume->value(master->part[npart]->Pvolume);
- partpanning->value(master->part[npart]->Ppanning);
- partrcv->value(master->part[npart]->Prcvchn);
-
- partname->label((char *)master->part[npart]->Pname);
-
- if ((int)bankui->cbwig->value()!=(npart+1))
- panellistitemgroup->color(fl_rgb_color(160,160,160));
- else
- panellistitemgroup->color(fl_rgb_color(50,190,240));
-
- panellistitemgroup->redraw();} {}
- }
- Function {~Panellistitem()} {} {
- code {panellistitem->hide();
- //delete(panellistitem);} {}
- }
- decl {int npart;} {}
- decl {Master *master;} {}
- decl {BankUI *bankui;} {}
- }
-
- class MasterUI {open
- } {
- Function {make_window()} {open
- } {
- Fl_Window masterwindow {
- label zynaddsubfx
- callback {if ((
- \#ifdef PLUGINVERSION
- 1
- \#elif USE_NSM
- (nsm && nsm->is_active())
- \#else
- 0
- \#endif
- || fl_choice("Exit and leave the unsaved data?","No","Yes",NULL))) {
- config.save();
- *exitprogram=1;
- };
- } open
- xywh {80 370 390 525} type Double xclass zynaddsubfx visible
- } {
- Fl_Menu_Bar mastermenu {
- xywh {-5 0 690 25}
- } {
- Submenu {} {
- label {&File}
- xywh {0 0 100 20}
- } {
- MenuItem {} {
- label {&New (erase all)...}
- callback {do_new_master();}
- xywh {20 20 100 20}
- }
- MenuItem {} {
- label {&Open Parameters...}
- callback {\#if USE_NSM
- if ( nsm && nsm->is_active() )
- {
- do_load_master();
- do_save_master( nsm->project_filename );
- }
- else
- \#endif
- {
- do_load_master();
- }}
- xywh {20 20 100 20}
- }
- MenuItem {} {
- label {&Save All Parameters...}
- callback {\#if USE_NSM
- if ( nsm && nsm->is_active() )
- {
- do_save_master( nsm->project_filename );
- }
- else
- \#endif
- {
- do_save_master();
- }}
- xywh {10 10 100 20} divider
- }
- MenuItem {} {
- label {&Load Scale Settings...}
- callback {char *filename;
- filename=fl_file_chooser("Open:","({*.xsz})",NULL,0);
- if (filename==NULL) return;
-
- pthread_mutex_lock(&master->mutex);
- //clear all parameters
- master->microtonal.defaults();
-
- //load the data
- int result=master->microtonal.loadXML(filename);
- pthread_mutex_unlock(&master->mutex);
-
-
- delete microtonalui;
- microtonalui=new MicrotonalUI(&master->microtonal);
-
- if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not a scale file.");
- else if (result<0) fl_alert("Error: Could not load the file.");}
- xywh {35 35 100 20}
- }
- MenuItem {} {
- label {Save Sc&ale Settings ..}
- callback {char *filename;
- int result=0;
-
- filename=fl_file_chooser("Save:","({*.xsz})",NULL,0);
- if (filename==NULL) return;
- filename=fl_filename_setext(filename,".xsz");
-
- result=fileexists(filename);
- if (result) {
- result=0;
- if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return;
-
- };
-
-
- pthread_mutex_lock(&master->mutex);
- result=master->microtonal.saveXML(filename);
- pthread_mutex_unlock(&master->mutex);
-
- if (result<0) fl_alert("Error: Could not save the file.");
-
-
- updatepanel();}
- xywh {25 25 100 20}
- }
- MenuItem {} {
- label {Show Scale Settings...}
- callback {microtonalui->show();}
- xywh {0 0 100 20} divider
- }
- MenuItem {} {
- label {&Settings...}
- callback {configui->show();}
- xywh {25 25 100 20}
- }
- MenuItem {} {
- label {N&io Settings}
- callback {nioui.refresh();
- nioui.show();}
- xywh {0 0 36 21} divider
- }
- MenuItem {} {
- label {&Copyright...}
- callback {aboutwindow->show();}
- xywh {15 15 100 20} divider
- }
- MenuItem {} {
- label {E&xit}
- callback {masterwindow->do_callback();}
- xywh {10 10 100 20}
- }
- }
- Submenu {} {
- label {&Instrument}
- xywh {10 10 100 20}
- } {
- MenuItem {} {
- label {&Clear Instrument...}
- callback {if (fl_choice("Clear instrument's parameters ?","No","Yes",NULL)){
- // int npart=(int)npartcounter->value()-1;
- pthread_mutex_lock(&master->mutex);
- master->part[npart]->defaultsinstrument();
- pthread_mutex_unlock(&master->mutex);
-
- npartcounter->do_callback();
- };
-
- updatepanel();}
- xywh {35 35 100 20}
- }
- MenuItem {} {
- label {&Open Instrument...}
- callback {const char *filename;
- filename=fl_file_chooser("Load:","({*.xiz})",NULL,0);
- if (filename==NULL) return;
-
-
- pthread_mutex_lock(&master->mutex);
- // int npart=(int)npartcounter->value()-1;
-
- //clear all instrument parameters, first
- master->part[npart]->defaultsinstrument();
-
- //load the instr. parameters
- int result=master->part[npart]->loadXMLinstrument(filename);
-
- pthread_mutex_unlock(&master->mutex);
- master->part[npart]->applyparameters();
-
- npartcounter->do_callback();
- updatepanel();
-
- if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not an instrument file.");
- else if (result<0) fl_alert("Error: Could not load the file.");}
- xywh {30 30 100 20}
- }
- MenuItem {} {
- label {&Save Instrument ...}
- callback {char *filename;
-
- filename=fl_file_chooser("Save:","({*.xiz})",NULL,0);
- if (filename==NULL) return;
- filename=fl_filename_setext(filename,".xiz");
-
- int result=fileexists(filename);
- if (result) {
- result=0;
- if (!fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL)) return;
-
- };
-
-
- pthread_mutex_lock(&master->mutex);
- result=master->part[npart]->saveXML(filename);
- pthread_mutex_unlock(&master->mutex);
-
- if (result<0) fl_alert("Error: Could not save the file.");
-
- updatepanel();}
- xywh {20 20 100 20} divider
- }
- MenuItem {} {
- label {Show Instrument &Bank...}
- callback {bankui->show();}
- xywh {0 0 100 20} divider
- }
- MenuItem {} {
- label {&Virtual Keyboard...}
- callback {virkeyboard->show();}
- xywh {10 10 100 20}
- }
- }
- Submenu recordmenu {
- label {&Record}
- xywh {0 0 100 20}
- } {
- MenuItem {} {
- label {&Choose WAV file...}
- callback {char *filename;
- recordbutton->deactivate();
- pausebutton->deactivate();
- pauselabel->deactivate();
- stopbutton->deactivate();
- filename=fl_file_chooser("Record to audio file:","(*.wav)",NULL,0);
- if (filename==NULL) return;
- fl_filename_setext(filename,".wav");
-
- int result=master->HDDRecorder.preparefile(filename,0);
- if (result==1) {
- result=0;
- if (fl_choice("The file exists. \\nOverwrite it?","No","Yes",NULL))
- master->HDDRecorder.preparefile(filename,1);
- };
- if (result==0) recordbutton->activate();
-
- if (result!=0) fl_alert("Error: Could not save the file.");}
- xywh {0 0 100 20}
- }
- }
- Submenu {} {
- label Misc
- xywh {10 10 100 20}
- } {
- MenuItem {} {
- label {Switch User Interface Mode}
- callback {if (fl_choice("Switch the User Interface to Beginner mode ?","No","Yes",NULL)){
- masterwindow->hide();
- refresh_master_ui();
- simplemasterwindow->show();
- config.cfg.UserInterfaceMode=2;
- };}
- xywh {10 10 100 20}
- }
- }
- }
- Fl_Dial mastervolumedial {
- label {Master Volume}
- callback {master->setPvolume((int) o->value());}
- tooltip {Master Volume} xywh {15 32 55 55} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1
- code0 {o->value(master->Pvolume);}
- class WidgetPDial
- }
- Fl_Counter masterkeyshiftcounter {
- label {Master KeyShift}
- callback {master->setPkeyshift((int) o->value()+64);}
- xywh {150 97 120 23} type Simple labelsize 9 minimum -64 maximum 64 step 1
- code0 {o->lstep(12);}
- code1 {o->value(master->Pkeyshift-64);}
- }
- Fl_Button {} {
- label {Panic!}
- callback {virkeyboard->relaseallkeys();
- pthread_mutex_lock(&master->mutex);
- master->shutup=1;
- pthread_mutex_unlock(&master->mutex);}
- xywh {280 29 105 53} color 90 labelfont 1
- }
- Fl_Group partuigroup {open
- xywh {0 310 390 205}
- } {
- Fl_Group partui {open selected
- xywh {0 310 383 175}
- code0 {o->init(master->part[0],master,0,bankui);}
- code1 {o->show();}
- class PartUI
- } {}
- }
- Fl_Tabs {} {open
- xywh {0 145 390 165} box UP_FRAME
- } {
- Fl_Group {} {
- label {System Effects} open
- xywh {0 162 390 145} labelsize 15 align 9
- } {
- Fl_Counter syseffnocounter {
- label {Sys.Effect No.}
- callback {nsyseff=(int) o->value()-1;
- sysefftype->value(master->sysefx[nsyseff]->geteffect());
- syseffectui->refresh(master->sysefx[nsyseff]);}
- xywh {5 181 80 22} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_SYS_EFX);}
- code1 {o->value(nsyseff+1);}
- }
- Fl_Choice sysefftype {
- label EffType
- callback {pthread_mutex_lock(&master->mutex);
- master->sysefx[nsyseff]->changeeffect((int) o->value());
- pthread_mutex_unlock(&master->mutex);
- syseffectui->refresh(master->sysefx[nsyseff]);}
- xywh {285 176 100 22} down_box BORDER_BOX labelsize 10
- code0 {o->value(master->sysefx[nsyseff]->geteffect());}
- } {
- MenuItem {} {
- label {No Effect}
- xywh {10 10 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Reverb
- xywh {20 20 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Echo
- xywh {30 30 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Chorus
- xywh {40 40 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Phaser
- xywh {50 50 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label AlienWah
- xywh {60 60 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Distortion
- xywh {70 70 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label EQ
- xywh {80 80 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label DynFilter
- xywh {90 90 100 20} labelfont 1 labelsize 10
- }
- }
- Fl_Group syseffectuigroup {open
- xywh {5 203 380 95} color 48
- } {
- Fl_Group syseffectui {
- xywh {5 203 380 95}
- code0 {o->init(master->sysefx[nsyseff]);}
- class EffUI
- } {}
- }
- Fl_Button {} {
- label {Send to...}
- callback {syseffsendwindow->show();}
- xywh {90 181 85 22} box THIN_UP_BOX labelfont 1 labelsize 11
- }
- Fl_Button {} {
- label C
- callback {presetsui->copy(master->sysefx[nsyseff]);}
- xywh {180 187 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {pthread_mutex_lock(&master->mutex);
- presetsui->paste(master->sysefx[nsyseff],syseffectui);
- pthread_mutex_unlock(&master->mutex);}
- xywh {210 187 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- }
- Fl_Group {} {
- label {Insertion Effects} open
- xywh {0 165 390 145} labelsize 15 align 9 hide
- } {
- Fl_Counter inseffnocounter {
- label {Ins.Effect No.}
- callback {ninseff=(int) o->value()-1;
- 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();
- };}
- xywh {5 183 80 22} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_INS_EFX);}
- code1 {o->value(ninseff+1);}
- }
- Fl_Choice insefftype {
- label EffType
- callback {pthread_mutex_lock(&master->mutex);
- master->insefx[ninseff]->changeeffect((int) o->value());
- pthread_mutex_unlock(&master->mutex);
- inseffectui->refresh(master->insefx[ninseff]);
- inseffectui->show();}
- xywh {285 173 100 22} down_box BORDER_BOX labelsize 10
- code0 {o->value(master->insefx[ninseff]->geteffect());}
- code1 {if (master->Pinsparts[ninseff]== -1) o->deactivate();}
- } {
- MenuItem {} {
- label {No Effect}
- xywh {25 25 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Reverb
- xywh {35 35 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Echo
- xywh {45 45 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Chorus
- xywh {55 55 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Phaser
- xywh {60 60 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label AlienWah
- xywh {70 70 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Distortion
- xywh {80 80 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label EQ
- xywh {90 90 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label DynFilter
- xywh {100 100 100 20} labelfont 1 labelsize 10
- }
- }
- Fl_Group inseffectuigroup {open
- xywh {5 205 380 95} box FLAT_BOX color 48
- } {
- Fl_Group inseffectui {
- xywh {5 205 380 90} box UP_FRAME
- code0 {o->init(master->insefx[ninseff]);}
- code1 {if (master->Pinsparts[ninseff]== -1) o->deactivate();}
- class EffUI
- } {}
- }
- Fl_Choice inseffpart {
- label {Insert To.}
- callback {master->Pinsparts[ninseff]=(int) o->value()-2;
- if ((int) o->value()==1){
- inseffectuigroup->deactivate();
- insefftype->deactivate();
- inseffectui->deactivate();
- } else {
- inseffectuigroup->activate();
- insefftype->activate();
- inseffectui->activate();
- };
- master->insefx[ninseff]->cleanup();} open
- xywh {95 183 80 22} down_box BORDER_BOX labelfont 1 labelsize 10 align 5 textsize 10
- code0 {o->add("Master Out");o->add("Off");}
- code1 {char tmp[50]; for (int i=0;i<NUM_MIDI_PARTS;i++) {sprintf(tmp,"Part %2d",i+1);o->add(tmp);};}
- code3 {o->value(master->Pinsparts[ninseff]+2);}
- } {}
- Fl_Button {} {
- label C
- callback {presetsui->copy(master->insefx[ninseff]);}
- xywh {180 185 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- Fl_Button {} {
- label P
- callback {pthread_mutex_lock(&master->mutex);
- presetsui->paste(master->insefx[ninseff],inseffectui);
- pthread_mutex_unlock(&master->mutex);}
- xywh {210 185 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- }
- }
- Fl_Button {} {
- label Scales
- callback {microtonalui->show();}
- xywh {320 87 65 23} color 51 labelfont 1
- }
- Fl_Group {} {
- xywh {150 40 117 45} box UP_FRAME
- } {
- Fl_Button recordbutton {
- label {Rec.}
- callback {o->deactivate();
- recordmenu->deactivate();
- recordmenu->label("&Record(*)");
- stopbutton->activate();
- pausebutton->activate();
- pauselabel->activate();
- master->HDDRecorder.start();
- master->vuresetpeaks();
- mastermenu->redraw();}
- tooltip {Start Recording} xywh {159 46 21 21} box ROUND_UP_BOX color 88 labelfont 1 labelsize 10 align 2 deactivate
- }
- Fl_Button stopbutton {
- label Stop
- callback {o->deactivate();
- master->HDDRecorder.stop();
- recordbutton->deactivate();
- pausebutton->deactivate();
- pauselabel->deactivate();
- recordmenu->activate();
- recordmenu->label("&Record");
- mastermenu->redraw();}
- tooltip {Stop Recording and close the audio file} xywh {237 46 21 21} box THIN_UP_BOX color 4 labelfont 1 labelsize 10 align 2 deactivate
- }
- Fl_Button pausebutton {
- label {@||}
- callback {o->deactivate();
- master->HDDRecorder.pause();
- recordbutton->activate();
- mastermenu->redraw();}
- tooltip {Pause Recording} xywh {198 46 21 21} box THIN_UP_BOX color 4 selection_color 4 labelfont 1 labelcolor 3 align 16 deactivate
- }
- Fl_Box pauselabel {
- label Pause
- xywh {192 66 30 15} labelfont 1 labelsize 10 deactivate
- }
- }
- Fl_Group {} {open
- xywh {1 490 389 55}
- } {
- Fl_Box {} {
- label {VU-Meter}
- xywh {5 490 380 30} box FLAT_BOX color 48 selection_color 75
- code0 {o->init(master,-1);}
- class VUMeter
- }
- }
- Fl_Check_Button nrpnbutton {
- label NRPN
- callback {master->ctl.NRPN.receive=(int) o->value();}
- tooltip {Receive NRPNs} xywh {10 115 60 25} down_box DOWN_BOX labelsize 12
- code0 {o->value(master->ctl.NRPN.receive);}
- }
- Fl_Counter npartcounter {
- callback {int nval=(int) o->value()-1;
- partuigroup->remove(partui);
- delete partui;
- partui=new PartUI(0,0,765,525);
- partuigroup->add(partui);
- partui->init(master->part[nval],master,nval,bankui);
- partui->redraw();
- o->redraw();
- npart=nval;
-
- updatepanel();
- simplenpartcounter->value(nval+1);
- simplenpartcounter->do_callback();}
- tooltip {The part number} xywh {5 312 50 18} type Simple labelfont 1 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_MIDI_PARTS);}
- code1 {bankui->init(o);}
- }
- Fl_Button {} {
- label vK
- callback {virkeyboard->show();}
- tooltip {Virtual Keyboard} xywh {280 87 40 23} color 51 labelfont 1
- }
- Fl_Group {} {open
- xywh {85 32 55 110} box UP_FRAME
- } {
- Fl_Button {} {
- label Reset
- callback {globalfinedetuneslider->value(64.0);
- globalfinedetuneslider->do_callback();}
- tooltip {Master fine detune reset} xywh {90 37 45 23} box THIN_UP_BOX labelsize 10
- }
- Fl_Dial globalfinedetuneslider {
- label {Fine Detune}
- callback {master->microtonal.Pglobalfinedetune=(int) o->value();}
- tooltip {global fine detune} xywh {90 68 45 45} box ROUND_UP_BOX labelsize 9 align 130 maximum 127 step 1 value 64
- code0 {o->value(master->microtonal.Pglobalfinedetune);}
- class WidgetPDial
- }
- }
- Fl_Button {} {
- label {Panel Window}
- callback {updatepanel();
- panelwindow->show();}
- tooltip {Panel Window} xywh {280 112 105 23} color 51 labelfont 1 labelsize 10
- }
- Fl_Button sm_indicator1 {
- label SM
- xywh {350 5 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 45 selection_color 93 labelfont 3 labelcolor 39 deactivate
- }
- }
- Fl_Window aboutwindow {
- label {Copyright...}
- xywh {411 344 365 280} type Double hide
- } {
- Fl_Box {} {
- label {Copyright (c) 2002-2009 Nasca O. PAUL and others. Please read AUTHORS.txt}
- xywh {15 35 335 55} labeltype EMBOSSED_LABEL labelsize 15 align 208
- }
- Fl_Box {} {
- label {This is free software; you may redistribute it and/or modify it under the terms of the
- version 2 (or any later version) of the GNU General Public License as published by the Free Software Fundation.
- This program comes with
- ABSOLUTELY NO WARRANTY.
- See the version 2 (or any later version) of the
- GNU General Public License for details.}
- xywh {15 90 335 145} labelfont 1 labelsize 11 align 144
- }
- Fl_Button {} {
- label {Close this window}
- callback {aboutwindow->hide();}
- xywh {80 245 190 25} box THIN_UP_BOX labelsize 11
- }
- Fl_Box {} {
- label ZynAddSubFX
- xywh {15 5 335 30} labeltype EMBOSSED_LABEL labelfont 1 labelsize 20 align 16
- }
- }
- Fl_Window syseffsendwindow {
- label {System Effects Send}
- xywh {171 234 120 250} type Double hide resizable
- } {
- Fl_Scroll {} {open
- xywh {0 45 120 170} box FLAT_BOX resizable
- code0 {for (int neff1=0;neff1<NUM_SYS_EFX;neff1++) for (int neff2=neff1+1;neff2<NUM_SYS_EFX;neff2++)}
- code1 {{syseffsend[neff1][neff2]=new SysEffSend(o->x()+(neff2-1)*35,o->y()+15+neff1*50,30,30);syseffsend[neff1][neff2]->label("aaa");syseffsend[neff1][neff2]->init(master,neff1,neff2);};}
- } {}
- Fl_Button {} {
- label Close
- callback {syseffsendwindow->hide();}
- xywh {25 220 80 25} box THIN_UP_BOX
- }
- Fl_Box {} {
- label {Send system effect's output to other system effects}
- xywh {5 5 110 35} labelsize 10 align 192
- }
- }
- Fl_Window panelwindow {
- label {ZynAddSubFX Panel}
- xywh {89 59 630 635} type Double hide
- } {
- Fl_Scroll {} {
- xywh {0 5 570 310} type HORIZONTAL box THIN_UP_BOX
- } {
- Fl_Pack {} {
- xywh {5 10 560 285} type HORIZONTAL
- code0 {for (int i=0;i<NUM_MIDI_PARTS/2;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(master,i,bankui);}}
- } {}
- }
- Fl_Scroll {} {
- xywh {0 320 570 310} type HORIZONTAL box THIN_UP_BOX
- } {
- Fl_Pack {} {
- xywh {5 325 560 285} type HORIZONTAL
- code0 {for (int i=NUM_MIDI_PARTS/2;i<NUM_MIDI_PARTS;i++){panellistitem[i]=new Panellistitem(0,0,70,260,"");panellistitem[i]->init(master,i,bankui);}}
- } {}
- }
- Fl_Button {} {
- label Close
- callback {panelwindow->hide();
- updatepanel();}
- xywh {575 605 50 25} box THIN_UP_BOX labelsize 13
- }
- Fl_Button {} {
- label Refresh
- callback {updatepanel();}
- xywh {575 570 55 25} box THIN_UP_BOX labelsize 13
- }
- }
- Fl_Window simplemasterwindow {
- label ZynAddSubFX
- callback {\#ifndef PLUGINVERSION
- if (fl_choice("Exit and leave the unsaved data?","No","Yes",NULL))
- \#endif
- {
- config.save();
- *exitprogram=1;
- };
- } open
- xywh {283 262 600 335} type Double visible
- } {
- Fl_Menu_Bar simplemastermenu {
- xywh {0 0 690 25}
- } {
- Submenu {} {
- label {&File}
- xywh {10 10 100 20}
- } {
- MenuItem {} {
- label {&New (erase all)...}
- callback {do_new_master();}
- xywh {30 30 100 20}
- }
- MenuItem {} {
- label {&Open Parameters...}
- callback {do_load_master();}
- xywh {30 30 100 20}
- }
- MenuItem {} {
- label {&Save All Parameters...}
- callback {\#if USE_NSM
- if ( nsm && nsm->is_active() )
- {
- do_save_master( nsm->project_filename );
- }
- else
- \#endif
- {
- do_save_master();
- }}
- xywh {20 20 100 20} divider
- }
- MenuItem {} {
- label {&Settings...}
- callback {configui->show();}
- xywh {35 35 100 20} divider
- }
- MenuItem {} {
- label {&Copyright...}
- callback {aboutwindow->show();}
- xywh {25 25 100 20} divider
- }
- MenuItem {} {
- label {E&xit}
- callback {masterwindow->do_callback();}
- xywh {20 20 100 20}
- }
- }
- Submenu {} {
- label {&Instrument}
- xywh {20 20 100 20}
- } {
- MenuItem {} {
- label {&Open Instrument...}
- callback {const char *filename;
- filename=fl_file_chooser("Load:","({*.xiz})",NULL,0);
- if (filename==NULL) return;
-
-
- pthread_mutex_lock(&master->mutex);
- // int npart=(int)npartcounter->value()-1;
-
- //clear all instrument parameters, first
- master->part[npart]->defaultsinstrument();
-
- //load the instr. parameters
- int result=master->part[npart]->loadXMLinstrument(filename);
-
- pthread_mutex_unlock(&master->mutex);
- master->part[npart]->applyparameters();
-
- simplenpartcounter->do_callback();
-
- if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not an instrument file.");
- else if (result<0) fl_alert("Error: Could not load the file.");}
- xywh {40 40 100 20}
- }
- MenuItem {} {
- label {Show Instrument &Bank...}
- callback {bankui->show();}
- xywh {10 10 100 20} divider
- }
- }
- Submenu {} {
- label Misc
- xywh {0 0 100 20}
- } {
- MenuItem {} {
- label {Switch User Interface Mode}
- callback {if (fl_choice("Switch the User Interface to Advanced mode ?","No","Yes",NULL)){
- simplemasterwindow->hide();
- refresh_master_ui();
- masterwindow->show();
- config.cfg.UserInterfaceMode=1;
- };}
- xywh {0 0 100 20}
- }
- }
- }
- Fl_Group simplelistitemgroup {open
- private xywh {125 65 215 145} box UP_FRAME
- code0 {if (master->part[npart]->Penabled==0) o->deactivate();}
- } {
- Fl_Button partname {
- callback {if ((int)bankui->cbwig->value()!=(npart+1)){
- bankui->cbwig->value(npart+1);
- bankui->cbwig->do_callback();
- };
- bankui->show();}
- xywh {130 72 205 18} box THIN_DOWN_BOX down_box FLAT_BOX color 50 labelfont 1 labelsize 11 align 208
- }
- Fl_Slider partpanning {
- label Pan
- callback {master->part[npart]->setPpanning((int) o->value());}
- xywh {185 95 145 15} type {Horz Knob} box NO_BOX labelsize 11 maximum 127 step 1 value 64
- code0 {o->value(master->part[npart]->Ppanning);}
- }
- Fl_Choice partrcv {
- label {Midi Channel Receive}
- callback {virkeys->relaseallkeys(0);
- master->part[npart]->Prcvchn=(int) o->value();
- virkeys->midich=(int) o->value();} open
- tooltip {receive from Midi channel} xywh {140 157 65 18} down_box BORDER_BOX labelsize 10 align 130 textfont 1
- code0 {char nrstr[10]; for(int i=0;i<NUM_MIDI_CHANNELS;i++){sprintf(nrstr,"Ch%d",i+1);if (i!=9) o->add(nrstr); else o->add("Dr10");};}
- code1 {o->value(master->part[npart]->Prcvchn);}
- } {}
- Fl_Dial partvolume {
- callback {master->part[npart]->setPvolume((int) o->value());}
- xywh {135 95 45 40} labelsize 9 maximum 127 step 1
- code0 {o->value(master->part[npart]->Pvolume);}
- class WidgetPDial
- }
- Fl_Box {} {
- label Volume
- xywh {130 130 55 20} labelsize 10
- }
- Fl_Check_Button simplepartportamento {
- label Portamento
- callback {master->part[npart]->ctl.portamento.portamento=(int) o->value();}
- tooltip {Enable/Disable the portamento} xywh {193 127 79 23} down_box DOWN_BOX labelsize 9
- code0 {o->value(master->part[npart]->ctl.portamento.portamento);}
- }
- Fl_Counter simpleminkcounter {
- label {Min.key}
- callback {master->part[npart]->Pminkey=(int) o->value();
- if (master->part[npart]->Pminkey>master->part[npart]->Pmaxkey) o->textcolor(FL_RED);
- else o->textcolor(FL_BLACK);}
- tooltip {Minimum key (that the part receives NoteOn messages)} xywh {210 158 40 15} type Simple labelsize 10 minimum 0 maximum 127 step 1 textsize 10
- code0 {o->value(master->part[npart]->Pminkey);}
- }
- Fl_Counter simplemaxkcounter {
- label {Max.key}
- callback {master->part[npart]->Pmaxkey=(int) o->value();
-
- if (master->part[npart]->Pminkey>master->part[npart]->Pmaxkey) o->textcolor(FL_RED);
- else o->textcolor(FL_BLACK);}
- tooltip {Maximum key (that the part receives NoteOn messages)} xywh {255 158 40 15} type Simple labelsize 10 minimum 0 maximum 127 step 1 textsize 10
- code0 {o->value(master->part[npart]->Pmaxkey);}
- }
- Fl_Button {} {
- label m
- callback {if (master->part[npart]->lastnote>=0) simpleminkcounter->value(master->part[npart]->lastnote);
- simpleminkcounter->do_callback();
- simplemaxkcounter->do_callback();}
- tooltip {set the minimum key to the last pressed key} xywh {230 188 15 12} box THIN_UP_BOX labelsize 10
- }
- Fl_Button {} {
- label M
- callback {if (master->part[npart]->lastnote>=0) simplemaxkcounter->value(master->part[npart]->lastnote);
- simplemaxkcounter->do_callback();
- simpleminkcounter->do_callback();}
- tooltip {set the maximum key to the last pressed key} xywh {260 188 15 12} box THIN_UP_BOX labelsize 10
- }
- Fl_Button {} {
- label R
- callback {simpleminkcounter->value(0);
- simpleminkcounter->do_callback();
- simplemaxkcounter->value(127);
- simplemaxkcounter->do_callback();}
- tooltip {reset the minimum key to 0 and maximum key to 127} xywh {245 188 15 12} box THIN_UP_BOX labelfont 1 labelsize 10
- }
- Fl_Counter simplepartkeyshiftcounter {
- label KeyShift
- callback {master->part[npart]->Pkeyshift=(int) o->value()+64;}
- xywh {280 120 50 20} type Simple labelsize 11 minimum -64 maximum 64 step 1
- code0 {o->lstep(12);}
- code1 {o->value(master->part[npart]->Pkeyshift-64);}
- }
- Fl_Dial simplesyseffsend {
- callback {master->setPsysefxvol(npart,nsyseff,(int) o->value());}
- xywh {300 160 30 30} maximum 127 step 1
- class WidgetPDial
- }
- Fl_Box {} {
- label Effect
- xywh {295 190 40 15} labelsize 10
- }
- }
- Fl_Check_Button partenabled {
- label Enabled
- callback {pthread_mutex_lock(&master->mutex);
- master->partonoff(npart,(int) o->value());
- pthread_mutex_unlock(&master->mutex);
-
- if ((int) o->value()==0) simplelistitemgroup->deactivate();
- else {
- simplelistitemgroup->activate();
- if ((int)bankui->cbwig->value()!=(npart+1)){
- bankui->cbwig->value(npart+1);
- bankui->cbwig->do_callback();
- };
- };
-
- o->redraw();}
- private xywh {250 40 85 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 24
- code0 {//char tmp[10];snprintf(tmp,10,"%d",npart+1);o->copy_label(tmp);}
- code1 {o->value(master->part[npart]->Penabled);}
- }
- Fl_Box virkeys {
- label Keyboard
- xywh {5 215 590 80} box BORDER_BOX color 17
- code0 {o->init(master);}
- class VirKeys
- }
- Fl_Group {} {open
- xywh {340 30 255 185}
- } {
- Fl_Tabs {} {open
- xywh {345 35 245 175} box UP_FRAME align 18
- } {
- Fl_Group {} {
- label {System Effects} open
- xywh {345 55 245 155} box UP_FRAME labelfont 1 labelsize 12 align 18
- } {
- Fl_Counter simplesyseffnocounter {
- label {Sys.Effect No.}
- callback {nsyseff=(int) o->value()-1;
- simplesysefftype->value(master->sysefx[nsyseff]->geteffect());
- simplesyseffectui->refresh(master->sysefx[nsyseff]);
- simplerefresh();}
- xywh {350 75 80 20} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_SYS_EFX);}
- code1 {o->value(nsyseff+1);}
- }
- Fl_Choice simplesysefftype {
- label EffType
- callback {pthread_mutex_lock(&master->mutex);
- master->sysefx[nsyseff]->changeeffect((int) o->value());
- pthread_mutex_unlock(&master->mutex);
- simplesyseffectui->refresh(master->sysefx[nsyseff]);}
- xywh {515 80 70 15} down_box BORDER_BOX labelsize 10 align 5
- code0 {o->value(master->sysefx[nsyseff]->geteffect());}
- } {
- MenuItem {} {
- label {No Effect}
- xywh {20 20 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Reverb
- xywh {30 30 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Echo
- xywh {40 40 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Chorus
- xywh {50 50 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Phaser
- xywh {60 60 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label AlienWah
- xywh {70 70 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Distortion
- xywh {80 80 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label EQ
- xywh {90 90 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label DynFilter
- xywh {100 100 100 20} labelfont 1 labelsize 10
- }
- }
- Fl_Group simplesyseffectuigroup {open
- xywh {350 95 235 95} color 48
- } {
- Fl_Group simplesyseffectui {
- xywh {350 95 234 95}
- code0 {o->init(master->sysefx[nsyseff]);}
- class SimpleEffUI
- } {}
- }
- Fl_Button {} {
- label {Send to...}
- callback {syseffsendwindow->show();}
- xywh {435 75 75 20} box THIN_UP_BOX labelfont 1 labelsize 11
- }
- Fl_Button {} {
- label P
- callback {pthread_mutex_lock(&master->mutex);
- presetsui->paste(master->sysefx[nsyseff],simplesyseffectui);
- pthread_mutex_unlock(&master->mutex);}
- xywh {560 65 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- }
- Fl_Group {} {
- label {Insertion Effects}
- xywh {345 55 245 155} box UP_FRAME labelfont 1 labelsize 12 align 18 hide
- } {
- Fl_Counter simpleinseffnocounter {
- label {Ins.Effect No.}
- callback {ninseff=(int) o->value()-1;
- simpleinsefftype->value(master->insefx[ninseff]->geteffect());
- simpleinseffpart->value(master->Pinsparts[ninseff]+2);
- simpleinseffectui->refresh(master->insefx[ninseff]);
-
- if (master->Pinsparts[ninseff]!=-1) {
- simpleinsefftype->activate();
- simpleinseffectui->activate();
- simpleinseffectuigroup->activate();
- } else {
- simpleinsefftype->deactivate();
- simpleinseffectui->deactivate();
- simpleinseffectuigroup->deactivate();
- };}
- xywh {350 75 80 20} type Simple labelfont 1 labelsize 10 align 1 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_INS_EFX);}
- code1 {o->value(ninseff+1);}
- }
- Fl_Choice simpleinsefftype {
- label EffType
- callback {pthread_mutex_lock(&master->mutex);
- master->insefx[ninseff]->changeeffect((int) o->value());
- pthread_mutex_unlock(&master->mutex);
- simpleinseffectui->refresh(master->insefx[ninseff]);
- simpleinseffectui->show();}
- xywh {515 80 70 15} down_box BORDER_BOX labelsize 10 align 5
- code0 {o->value(master->insefx[ninseff]->geteffect());}
- code1 {if (master->Pinsparts[ninseff]== -1) o->deactivate();}
- } {
- MenuItem {} {
- label {No Effect}
- xywh {35 35 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Reverb
- xywh {45 45 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Echo
- xywh {55 55 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Chorus
- xywh {65 65 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Phaser
- xywh {70 70 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label AlienWah
- xywh {80 80 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label Distortion
- xywh {90 90 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label EQ
- xywh {100 100 100 20} labelfont 1 labelsize 10
- }
- MenuItem {} {
- label DynFilter
- xywh {110 110 100 20} labelfont 1 labelsize 10
- }
- }
- Fl_Group simpleinseffectuigroup {
- xywh {350 95 234 95} box FLAT_BOX color 48
- } {
- Fl_Group simpleinseffectui {
- xywh {350 95 234 95}
- code0 {o->init(master->insefx[ninseff]);}
- code1 {if (master->Pinsparts[ninseff]== -1) o->deactivate();}
- class SimpleEffUI
- } {}
- }
- Fl_Choice simpleinseffpart {
- label {Insert To.}
- callback {master->Pinsparts[ninseff]=(int) o->value()-2;
- if ((int) o->value()==1){
- simpleinseffectuigroup->deactivate();
- simpleinsefftype->deactivate();
- simpleinseffectui->deactivate();
- } else {
- simpleinseffectuigroup->activate();
- simpleinsefftype->activate();
- simpleinseffectui->activate();
- };
- master->insefx[ninseff]->cleanup();} open
- xywh {435 75 80 20} down_box BORDER_BOX labelfont 1 labelsize 10 align 5 textsize 10
- code0 {o->add("Master Out");o->add("Off");}
- code1 {char tmp[50]; for (int i=0;i<NUM_MIDI_PARTS;i++) {sprintf(tmp,"Part %2d",i+1);o->add(tmp);};}
- code3 {o->value(master->Pinsparts[ninseff]+2);}
- } {}
- Fl_Button {} {
- label P
- callback {pthread_mutex_lock(&master->mutex);
- presetsui->paste(master->insefx[ninseff],simpleinseffectui);
- pthread_mutex_unlock(&master->mutex);}
- xywh {560 65 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
- }
- }
- }
- }
- Fl_Group {} {open
- xywh {5 300 590 30} box ENGRAVED_FRAME
- } {
- Fl_Box {} {
- label {VU-Meter}
- xywh {5 300 590 30} box FLAT_BOX color 41 selection_color 75
- code0 {o->init(master,-1);}
- class VUMeter
- }
- }
- Fl_Dial simplemastervolumedial {
- label {Master Volume}
- callback {master->setPvolume((int) o->value());}
- tooltip {Master Volume} xywh {10 35 40 40} box ROUND_UP_BOX labelfont 1 labelsize 11 align 130 maximum 127 step 1
- code0 {o->value(master->Pvolume);}
- class WidgetPDial
- }
- Fl_Counter simplemasterkeyshiftcounter {
- label {Master KeyShift}
- callback {master->setPkeyshift((int) o->value()+64);}
- xywh {15 110 90 20} labelsize 11 minimum -64 maximum 64 step 1
- code0 {o->lstep(12);}
- code1 {o->value(master->Pkeyshift-64);}
- }
- Fl_Button {} {
- label {Stop ALL sounds!}
- callback {virkeyboard->relaseallkeys();
- pthread_mutex_lock(&master->mutex);
- master->shutup=1;
- pthread_mutex_unlock(&master->mutex);}
- xywh {5 149 115 31} color 90 labelfont 1 labelsize 10
- }
- Fl_Button {} {
- label Reset
- callback {simpleglobalfinedetuneslider->value(64.0);
- simpleglobalfinedetuneslider->do_callback();}
- tooltip {Master fine detune reset} xywh {70 30 50 17} box THIN_UP_BOX labelsize 11 align 128
- }
- Fl_Dial simpleglobalfinedetuneslider {
- label {Fine Detune}
- callback {master->microtonal.Pglobalfinedetune=(int) o->value();}
- tooltip {global fine detune} xywh {80 50 30 30} box ROUND_UP_BOX labelsize 11 align 130 maximum 127 step 1 value 64
- code0 {o->value(master->microtonal.Pglobalfinedetune);}
- class WidgetPDial
- }
- Fl_Counter simplenpartcounter {
- label Part
- callback {virkeys->relaseallkeys(0);
- npartcounter->value(o->value());
- npart=(int) o->value()-1;
-
- simplerefresh();
- virkeys->midich=master->part[npart]->Prcvchn;}
- tooltip {The part number} xywh {170 40 70 20} type Simple labelfont 1 align 4 minimum 0 maximum 127 step 1 value 1 textfont 1
- code0 {o->bounds(1,NUM_MIDI_PARTS);}
- }
- Fl_Counter {} {
- label {Keyb.Oct.}
- callback {virkeys->relaseallkeys(0);
- virkeys->midioct=(int) o->value();
- virkeys->take_focus();}
- tooltip {Midi Octave} xywh {5 190 55 20} type Simple labelsize 11 align 8 when 6 minimum 0 maximum 5 step 1 textfont 1 textsize 11
- code0 {o->value(virkeys->midioct);}
- }
- Fl_Button sm_indicator2 {
- label SM
- xywh {560 5 35 15} box ROUNDED_BOX down_box ROUNDED_BOX color 45 selection_color 93 labelfont 3 labelcolor 39 deactivate
- }
- }
- Fl_Window selectuiwindow {
- label {User Interface mode}
- callback {*exitprogram=1;}
- xywh {342 246 430 250} type Double hide non_modal
- } {
- Fl_Box {} {
- label {Welcome to ZynAddSubFX}
- xywh {5 5 425 40} labeltype SHADOW_LABEL labelfont 1 labelsize 26
- }
- Fl_Box {} {
- label {Please choose the interface mode:}
- xywh {10 50 265 25} labelfont 1 labelsize 13
- }
- Fl_Button {} {
- label Advanced
- callback {config.cfg.UserInterfaceMode=1;
- masterwindow->show();
- selectuiwindow->hide();}
- xywh {10 165 100 35} color 229 labelfont 1 labelsize 16
- }
- Fl_Box {} {
- label {.. if you have used ZynAddSubFX before, or you like to have full controll to all parameters.}
- xywh {110 165 310 35} labelfont 1 labelsize 11 align 144
- }
- Fl_Button {} {
- label Beginner
- callback {simplemasterwindow->show();
- selectuiwindow->hide();
- config.cfg.UserInterfaceMode=2;}
- xywh {10 80 100 65} color 238 labelfont 1 labelsize 16
- }
- Fl_Box {} {
- label {..if you are a beginner, you prefer using presets or you prefer to use simpler user interfaces. Most functionality of ZynAddSubFX will be hidden in this mode to make simple the learning/using it.}
- xywh {110 75 320 75} labelfont 1 labelsize 11 align 144
- }
- Fl_Box {} {
- label {You can switch the interface modes anytime you want.}
- xywh {30 215 360 25} box BORDER_BOX color 51 labelfont 1 labelsize 11 align 144
- }
- }
- }
- Function {updatesendwindow()} {} {
- code {for (int neff1=0;neff1<NUM_SYS_EFX;neff1++)
- for (int neff2=neff1+1;neff2<NUM_SYS_EFX;neff2++)
- syseffsend[neff1][neff2]->value(master->Psysefxsend[neff1][neff2]);} {}
- }
- Function {updatepanel()} {} {
- code {for (int npart=0;npart<NUM_MIDI_PARTS;npart++){
- panellistitem[npart]->refresh();
- };} {}
- }
- Function {setfilelabel(const char *filename)} {} {
- code {if (filename!=NULL) snprintf(&masterwindowlabel[0],100,"%s - ZynAddSubFX",fl_filename_name(filename));
- else snprintf(&masterwindowlabel[0],100,"%s","ZynAddSubFX");
- masterwindowlabel[99]='\\0';
- masterwindow->label(&masterwindowlabel[0]);
- simplemasterwindow->label(&masterwindowlabel[0]);} {}
- }
- Function {MasterUI(Master *master_,int *exitprogram_)} {} {
- code {master=master_;
- exitprogram=exitprogram_;
- ninseff=0;
- nsyseff=0;
- npart=0;
-
- for (int i=0;i<NUM_SYS_EFX;i++)
- for (int j=0;j<NUM_SYS_EFX;j++)
- syseffsend[i][j]=NULL;
-
- microtonalui=new MicrotonalUI(&master->microtonal);
- virkeyboard=new VirKeyboard(master);
- bankui=new BankUI(master,&npart);
- configui=new ConfigUI();
-
- make_window();
- presetsui=new PresetsUI();
- setfilelabel(NULL);
- swapefftype=0;
- simplerefresh();} {}
- }
- Function {~MasterUI()} {} {
- code {masterwindow->hide();
- delete masterwindow;
- simplemasterwindow->hide();
- delete simplemasterwindow;
- aboutwindow->hide();
- delete aboutwindow;
- syseffsendwindow->hide();
- delete syseffsendwindow;
-
- delete virkeyboard;
- delete microtonalui;
- delete bankui;
- delete configui;
-
- delete presetsui;
- delete panelwindow;
- delete selectuiwindow;} {}
- }
- Function {showUI()} {} {
- code {switch (config.cfg.UserInterfaceMode){
- case 0:selectuiwindow->show();
- break;
- case 1:masterwindow->show();
- break;
- case 2:simplemasterwindow->show();
- break;
- };} {}
- }
- Function {simplerefresh()} {} {
- code {partenabled->value(master->part[npart]->Penabled);
- if (master->part[npart]->Penabled!=0) simplelistitemgroup->activate();
- else simplelistitemgroup->deactivate();
-
- partvolume->value(master->part[npart]->Pvolume);
- partpanning->value(master->part[npart]->Ppanning);
- partrcv->value(master->part[npart]->Prcvchn);
-
- if (master->part[npart]->Pname[0]!=0) partname->label((char *)master->part[npart]->Pname);
- else partname->label("Click here to load a instrument");
-
- simplelistitemgroup->redraw();
- simplepartportamento->value(master->part[npart]->ctl.portamento.portamento);
- simpleminkcounter->value(master->part[npart]->Pminkey);
- simplemaxkcounter->value(master->part[npart]->Pmaxkey);
-
- simplepartkeyshiftcounter->value(master->part[npart]->Pkeyshift-64);
- simplesyseffsend->value(master->Psysefxvol[nsyseff][npart]);} {}
- }
- Function {do_new_master_unconditional()} {} {
- code {delete microtonalui;
-
- pthread_mutex_lock(&master->mutex);
- master->defaults();
- pthread_mutex_unlock(&master->mutex);
-
- npartcounter->value(1);
- refresh_master_ui();
- updatepanel();} {}
- }
- Function {do_new_master()} {} {
- code {if (fl_choice("Clear *ALL* the parameters ?","No","Yes",NULL)){
- do_new_master_unconditional();
- }} {}
- }
- Function {do_load_master_unconditional(const char *filename, const char *display_name)} {return_type int
- } {
- code {pthread_mutex_lock(&master->mutex);
- //clear all parameters
- master->defaults();
-
- //load the data
- int result=master->loadXML(filename);
-
- master->applyparameters(false);
- pthread_mutex_unlock(&master->mutex);
-
- npartcounter->value(1);
- refresh_master_ui();
- updatepanel();
-
- if (result>=0) setfilelabel(display_name);
-
- return result;} {}
- }
- Function {do_load_master(const char* file = NULL)} {} {
- code {const char *filename;
- if (file == NULL) {
- filename=fl_file_chooser("Open:","({*.xmz})",NULL,0);
- if (filename==NULL) return;
- }
- else {
- filename = file;
- }
-
- int result = do_load_master_unconditional( filename, filename );
-
- if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not a zynaddsubfx parameters file.");
- else if (result<0) fl_alert("Error: Could not load the file.");} {}
- }
- Function {do_save_master(const char* file = NULL)} {} {
- code {const char *filename;
- char *tmp;
- int result=0;
- if (file == NULL) {
- tmp=fl_file_chooser("Save:","({*.xmz})",NULL,0);
- if (tmp==NULL) return;
- tmp=fl_filename_setext(tmp,".xmz");
- filename=tmp;
- result=fileexists(tmp);
- if (result) {
- result=0;
- if (!fl_choice("The file exists. Overwrite it?","No","Yes",NULL)) return;
-
- }
- }
- else {
- filename = file;
- }
-
-
- pthread_mutex_lock(&master->mutex);
- result=master->saveXML(filename);
- pthread_mutex_unlock(&master->mutex);
-
- if (result<0) fl_alert("Error: Could not save the file.");
- else
- {
- \#if USE_NSM
- if ( nsm && nsm->is_active() )
- setfilelabel( nsm->display_name );
- else
- \#endif
- setfilelabel(filename);
- }
- updatepanel();} {}
- }
- Function {refresh_master_ui()} {} {
- code {ninseff=0;
- nsyseff=0;
- npart=0;
-
- //the Master UI
- npartcounter->do_callback();
- syseffnocounter->do_callback();
- inseffnocounter->do_callback();
- masterkeyshiftcounter->value(master->Pkeyshift-64);
- mastervolumedial->value(master->Pvolume);
- globalfinedetuneslider->value(master->microtonal.Pglobalfinedetune);
- microtonalui=new MicrotonalUI(&master->microtonal);
- nrpnbutton->value(master->ctl.NRPN.receive);
- updatesendwindow();
- updatepanel();
-
- //the simle MasterUI
- simplenpartcounter->value(1);
- simplesyseffnocounter->value(1);
- simpleinseffnocounter->value(1);
- simplenpartcounter->do_callback();
- simplesyseffnocounter->do_callback();
- simpleinseffnocounter->do_callback();
- simplemasterkeyshiftcounter->value(master->Pkeyshift-64);
- simplemastervolumedial->value(master->Pvolume);
- simpleglobalfinedetuneslider->value(master->microtonal.Pglobalfinedetune);
- virkeys->midich=master->part[npart]->Prcvchn;
-
- simplerefresh();
- bankui->hide();} {}
- }
- decl {Master *master;} {}
- decl {MicrotonalUI *microtonalui;} {}
- decl {BankUI *bankui;} {}
- decl {int ninseff,npart;} {}
- decl {int nsyseff;} {}
- decl {int *exitprogram;} {}
- decl {SysEffSend *syseffsend[NUM_SYS_EFX][NUM_SYS_EFX];} {}
- decl {VirKeyboard *virkeyboard;} {}
- decl {ConfigUI *configui;} {}
- decl {int swapefftype;} {}
- decl {char masterwindowlabel[100];} {}
- decl {Panellistitem *panellistitem[NUM_MIDI_PARTS];} {}
- decl {NioUI nioui;} {}
- }
|