commit a5da527fd57e4d73a11a8863e1a998ccad495517
parent 5bbb07a8fadc6808353927a19dd6965f437c33de
Author: paulnasca <paulnasca>
Date: Sat, 14 Aug 2004 21:33:24 +0000
*** empty log message ***
Diffstat:
10 files changed, 168 insertions(+), 51 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -684,4 +684,5 @@
14 Aug 2004 - Terminat modul continous la PADnote
- Corectata o mica eroare la OscilGen care facea daca adaptive harmonics e activ si phase randomness>0 sa rezulte si aleatorism in amplitudinile armonicelor
- Inceput sa scriu Presets/Clipboard
-
+ - Merge partial partea de Copy in clipboard
+
+\ No newline at end of file
diff --git a/src/Params/ADnoteParameters.h b/src/Params/ADnoteParameters.h
@@ -252,7 +252,7 @@
EnvelopeParams *FMAmpEnvelope;
};
-class ADnoteParameters{
+class ADnoteParameters/*:public Presets*/{
public:
ADnoteParameters(FFTwrapper *fft_);
~ADnoteParameters();
diff --git a/src/Params/Presets.C b/src/Params/Presets.C
@@ -19,3 +19,34 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+#include "Presets.h"
+#include <string.h>
+
+
+Presets::Presets(){
+ type[0]=0;;
+};
+
+Presets::~Presets(){
+};
+
+void Presets::setpresettype(char *type){
+ strcpy(this->type,type);
+};
+
+void Presets::copyclipboard(){
+ XMLwrapper *xml=new XMLwrapper();
+
+ xml->beginbranch(type);
+ add2XML(xml);
+ xml->endbranch();
+
+ xml->saveXMLfile("clipboard");
+
+ delete(xml);
+};
+void Presets::pasteclipboard(){
+};
+
+
diff --git a/src/Params/Presets.h b/src/Params/Presets.h
@@ -19,3 +19,28 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+#ifndef PRESETS_H
+#define PRESETS_H
+
+#include "../Misc/XMLwrapper.h"
+#define MAX_PRESETTYPE_SIZE 20
+
+class Presets{
+ public:
+ Presets();
+ virtual ~Presets();
+ void copyclipboard();
+ void pasteclipboard();
+
+ char type[MAX_PRESETTYPE_SIZE];
+ protected:
+ void setpresettype(char *type);
+ private:
+ virtual void add2XML(XMLwrapper *xml)=0;
+ virtual void getfromXML(XMLwrapper *xml)=0;
+
+};
+
+#endif
+
diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C
@@ -27,7 +27,8 @@
#include "OscilGen.h"
#include "../Effects/Distorsion.h"
-OscilGen::OscilGen(FFTwrapper *fft_,Resonance *res_){
+OscilGen::OscilGen(FFTwrapper *fft_,Resonance *res_):Presets(){
+ setpresettype("Poscilgen");
fft=fft_;
res=res_;
oscilFFTfreqs=new REALTYPE[OSCIL_SIZE];
diff --git a/src/Synth/OscilGen.h b/src/Synth/OscilGen.h
@@ -28,8 +28,9 @@
#include "../Misc/XMLwrapper.h"
#include "Resonance.h"
#include "../DSP/FFTwrapper.h"
+#include "../Params/Presets.h"
-class OscilGen{
+class OscilGen:public Presets{
public:
OscilGen(FFTwrapper *fft_,Resonance *res_);
~OscilGen();
diff --git a/src/UI/Makefile b/src/UI/Makefile
@@ -3,7 +3,7 @@ include ../Makefile.inc
%.cc : %.fl
fluid -c $<
-objects=WidgetPDial.o EnvelopeUI.o LFOUI.o FilterUI.o VirKeyboard.o ConfigUI.o\
+objects=WidgetPDial.o PresetsUI.o EnvelopeUI.o LFOUI.o FilterUI.o VirKeyboard.o ConfigUI.o\
SUBnoteUI.o ResonanceUI.o OscilGenUI.o ADnoteUI.o PADnoteUI.o EffUI.o BankUI.o \
PartUI.o MicrotonalUI.o SeqUI.o MasterUI.o
@@ -11,6 +11,7 @@ objects=WidgetPDial.o EnvelopeUI.o LFOUI.o FilterUI.o VirKeyboard.o ConfigUI.o\
all: $(objects)
WidgetPDial.o: WidgetPDial.fl WidgetPDial.cc WidgetPDial.h
+PresetsUI.o: PresetsUI.fl PresetsUI.cc PresetsUI.h
EnvelopeUI.o: EnvelopeUI.fl EnvelopeUI.cc EnvelopeUI.h
LFOUI.o: LFOUI.fl LFOUI.cc LFOUI.h
FilterUI.o: FilterUI.fl FilterUI.cc FilterUI.h
diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl
@@ -45,6 +45,9 @@ decl {\#include "MicrotonalUI.h"} {public
decl {\#include "SeqUI.h"} {public
}
+decl {\#include "PresetsUI.h"} {public
+}
+
decl {\#include "../Misc/Master.h"} {public
}
@@ -1226,6 +1229,7 @@ configui=new ConfigUI();
sequi=new SeqUI(master);
make_window();
+presetsui=new PresetsUI();
swapefftype=0;} {}
}
@@ -1241,7 +1245,9 @@ delete (virkeyboard);
delete (microtonalui);
delete (bankui);
delete (configui);
-delete (sequi);} {selected
+delete (sequi);
+
+delete(presetsui);} {selected
}
}
decl {Master *master;} {}
diff --git a/src/UI/OscilGenUI.fl b/src/UI/OscilGenUI.fl
@@ -47,6 +47,9 @@ decl {\#include "LFOUI.h"} {public
decl {\#include "FilterUI.h"} {public
}
+decl {\#include "PresetsUI.h"} {public
+}
+
class OscilSpectrum {: {public Fl_Box}
} {
Function {OscilSpectrum(int x,int y, int w, int h, const char *label=0):Fl_Box(x,y,w,h,label)} {} {
@@ -334,12 +337,13 @@ if (oscil->Phmag[n]==64) mag->selection_color(0);
decl {Master *master;} {}
}
-class OscilEditor {selected
+class OscilEditor {open
} {
- Function {make_window()} {} {
+ Function {make_window()} {open
+ } {
Fl_Window osceditUI {
label {ADsynth Oscillator Editor}
- xywh {4 91 745 590} type Double hide
+ xywh {4 91 745 600} type Double hide
code0 {if (oscil->ADvsPAD) o->label("PADsynth Harmonic Content Editor");}
} {
Fl_Group oscildisplaygroup {
@@ -612,12 +616,12 @@ pthread_mutex_unlock(&master->mutex);
basefuncdisplaygroup->redraw();
redrawoscil();}
- tooltip {Use this Oscillator as base function} xywh {15 310 85 20} box THIN_UP_BOX labelfont 1 labelsize 12
+ tooltip {Use this Oscillator as base function} xywh {15 313 85 20} box THIN_UP_BOX labelfont 1 labelsize 12
}
Fl_Button {} {
label Close
callback {osceditUI->hide();}
- xywh {678 557 62 28} box THIN_UP_BOX
+ xywh {678 565 62 25} box THIN_UP_BOX
}
Fl_Button {} {
label Clear
@@ -647,14 +651,14 @@ redrawoscil();}
xywh {680 500 55 20} box THIN_UP_BOX labelfont 1 labelsize 12
}
Fl_Group {} {
- xywh {145 305 150 30} box ENGRAVED_BOX
+ xywh {145 308 150 30} box ENGRAVED_BOX
} {
Fl_Choice wshbutton {
label {Wsh.}
callback {oscil->Pwaveshapingfunction=(int) o->value();
basefuncdisplaygroup->redraw();
redrawoscil();} open
- tooltip {Waveshaping function} xywh {175 310 55 20} down_box BORDER_BOX labelsize 10 textsize 10
+ tooltip {Waveshaping function} xywh {175 313 55 20} down_box BORDER_BOX labelsize 10 textsize 10
} {
menuitem {} {
label None
@@ -721,26 +725,26 @@ redrawoscil();} open
callback {oscil->Pwaveshaping=(int)o->value()+64;
wsparval->value(oscil->Pwaveshaping-64);
redrawoscil();}
- tooltip {Waveshaping Parameter} xywh {270 310 20 20} minimum -64 maximum 63 step 1
+ tooltip {Waveshaping Parameter} xywh {270 313 20 20} minimum -64 maximum 63 step 1
class WidgetPDial
}
Fl_Value_Output wsparval {
- xywh {238 313 25 15} labelsize 13 minimum -63 maximum 63 step 1
+ xywh {238 316 25 15} labelsize 13 minimum -63 maximum 63 step 1
}
}
Fl_Light_Button autoclearbutton {
label {Clr.}
- tooltip {Auto clear when using the oscillator as base function} xywh {105 310 35 20} box THIN_UP_BOX value 1 labelfont 1 labelsize 10
+ tooltip {Auto clear when using the oscillator as base function} xywh {105 313 35 20} box THIN_UP_BOX value 1 labelfont 1 labelsize 10
}
Fl_Group {} {
- xywh {295 305 155 30} box ENGRAVED_BOX
+ xywh {295 308 155 30} box ENGRAVED_BOX
} {
Fl_Choice fltbutton {
label Filter
callback {oscil->Pfiltertype=(int) o->value();
redrawoscil();}
- tooltip {Oscillator's filter type} xywh {325 310 50 20} down_box BORDER_BOX labelsize 10 textsize 10
+ tooltip {Oscillator's filter type} xywh {325 313 50 20} down_box BORDER_BOX labelsize 10 textsize 10
} {
menuitem {} {
label None
@@ -803,7 +807,7 @@ redrawoscil();}
callback {oscil->Pfilterpar1=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's filter parameter1} xywh {377 310 20 20} maximum 127 step 1
+ tooltip {Oscillator's filter parameter1} xywh {377 313 20 20} maximum 127 step 1
class WidgetPDial
}
Fl_Check_Button filterpref {
@@ -811,32 +815,32 @@ redrawoscil();}
callback {oscil->Pfilterbeforews=(int)o->value();
redrawoscil();}
- tooltip {Apply the filter before the waveshaping} xywh {425 310 20 20} down_box DOWN_BOX labelsize 10 align 24
+ tooltip {Apply the filter before the waveshaping} xywh {425 313 20 20} down_box DOWN_BOX labelsize 10 align 24
}
Fl_Dial filtervalue2 {
callback {oscil->Pfilterpar2=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's filter parameter2} xywh {402 310 20 20} maximum 127 step 1
+ tooltip {Oscillator's filter parameter2} xywh {402 313 20 20} maximum 127 step 1
class WidgetPDial
}
}
Fl_Scroll _this_has_to_be_the_last {
- xywh {15 335 660 250} type HORIZONTAL box ENGRAVED_BOX
+ xywh {15 340 660 250} type HORIZONTAL box ENGRAVED_BOX
} {
Fl_Pack harmonics {open
- xywh {20 340 650 225} type HORIZONTAL
+ xywh {20 345 650 225} type HORIZONTAL
code0 {for (int i=0;i<MAX_AD_HARMONICS;i++){h[i]=new Oscilharmonic(0,0,20,o->h(),"");h[i]->init(oscil,i,oscildisplaygroup,oldosc,cbwidget,master);}}
} {}
}
Fl_Group {} {
- xywh {600 305 135 30} box ENGRAVED_BOX
+ xywh {600 308 135 30} box ENGRAVED_BOX
} {
Fl_Choice sabutton {
label {Sp.adj.}
callback {oscil->Psatype=(int) o->value();
redrawoscil();}
- tooltip {Oscillator's spectrum adjust} xywh {640 310 60 20} down_box BORDER_BOX labelsize 10 textsize 10
+ tooltip {Oscillator's spectrum adjust} xywh {640 313 60 20} down_box BORDER_BOX labelsize 10 textsize 10
} {
menuitem {} {
label None
@@ -858,44 +862,44 @@ redrawoscil();}
Fl_Dial sadjpar {
callback {oscil->Psapar=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's spectrum adjust parameter} xywh {705 310 20 20} maximum 127 step 1
+ tooltip {Oscillator's spectrum adjust parameter} xywh {705 313 20 20} maximum 127 step 1
class WidgetPDial
}
}
Fl_Group {} {
- xywh {675 335 65 65} box ENGRAVED_BOX
+ xywh {675 340 65 65} box ENGRAVED_BOX
} {
Fl_Counter harmonicshiftcounter {
label {Harmonic Shift}
callback {oscil->Pharmonicshift=(int)o->value();
redrawoscil();}
- xywh {680 360 55 15} type Simple labelsize 10 align 129 minimum -64 maximum 64 step 1 textfont 1 textsize 10
+ xywh {680 365 55 15} type Simple labelsize 10 align 129 minimum -64 maximum 64 step 1 textfont 1 textsize 10
}
Fl_Check_Button harmonicshiftpre {
label preH
callback {oscil->Pharmonicshiftfirst=(int)o->value();
redrawoscil();}
- tooltip {Apply the harmonic shift before the waveshaping and filtering} xywh {700 380 34 15} down_box DOWN_BOX labelsize 10 align 24
+ tooltip {Apply the harmonic shift before the waveshaping and filtering} xywh {700 385 34 15} down_box DOWN_BOX labelsize 10 align 24
}
Fl_Button {} {
label R
callback {oscil->Pharmonicshift=0;
harmonicshiftcounter->value(0);
redrawoscil();}
- xywh {680 380 20 15} box THIN_UP_BOX labelfont 1 labelsize 10
+ xywh {680 385 20 15} box THIN_UP_BOX labelfont 1 labelsize 10
}
}
Fl_Group {} {
- xywh {675 400 65 90} box ENGRAVED_FRAME
+ xywh {675 405 65 90} box ENGRAVED_FRAME
} {
Fl_Box {} {
label {Adaptive Harmonics}
- xywh {678 405 60 25} labelsize 10 align 144
+ xywh {678 410 60 25} labelsize 10 align 144
}
Fl_Choice adhrtype {
callback {oscil->Padaptiveharmonics=(int) o->value();
redrawoscil();} open
- tooltip {The type of the addaptive harmonics} xywh {680 430 55 15} down_box BORDER_BOX labelsize 10 when 6 textsize 10
+ tooltip {The type of the addaptive harmonics} xywh {680 435 55 15} down_box BORDER_BOX labelsize 10 when 6 textsize 10
} {
menuitem {} {
label OFF
@@ -910,26 +914,26 @@ redrawoscil();} open
label pow
callback {oscil->Padaptiveharmonicspower=(int)o->value();
redrawoscil();}
- tooltip {Adaptive harmonics power} xywh {710 450 25 25} labelsize 10 maximum 100 step 1
+ tooltip {Adaptive harmonics power} xywh {710 455 25 25} labelsize 10 maximum 100 step 1
class WidgetPDial
}
Fl_Dial adhrbf {
label baseF
callback {oscil->Padaptiveharmonicsbasefreq=(int)o->value();
redrawoscil();}
- tooltip {Adaptive harmonics base frequency} xywh {680 450 25 25} labelsize 10 maximum 255 step 1
+ tooltip {Adaptive harmonics base frequency} xywh {680 455 25 25} labelsize 10 maximum 255 step 1
class WidgetPDial
}
}
Fl_Group {} {
- xywh {450 305 150 30} box ENGRAVED_BOX
+ xywh {450 308 150 30} box ENGRAVED_BOX
} {
Fl_Choice modtype {
label {Mod.}
callback {oscil->Pmodulation=(int) o->value();
redrawoscil();}
- tooltip modulation xywh {480 312 50 15} down_box BORDER_BOX labelsize 10 textsize 10
+ tooltip modulation xywh {480 315 50 15} down_box BORDER_BOX labelsize 10 textsize 10
} {
menuitem {} {
label None
@@ -952,20 +956,20 @@ redrawoscil();}
callback {oscil->Pmodulationpar1=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's modulation parameter 1} xywh {540 312 15 15} maximum 127 step 1
+ tooltip {Oscillator's modulation parameter 1} xywh {540 315 15 15} maximum 127 step 1
class WidgetPDial
}
Fl_Dial modpar2 {
callback {oscil->Pmodulationpar2=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's modulation parameter 2} xywh {560 312 15 15} maximum 127 step 1
+ tooltip {Oscillator's modulation parameter 2} xywh {560 315 15 15} maximum 127 step 1
class WidgetPDial
}
Fl_Dial modpar3 {
callback {oscil->Pmodulationpar3=(int)o->value();
redrawoscil();}
- tooltip {Oscillator's modulation parameter 3} xywh {580 312 15 15} maximum 127 step 1
+ tooltip {Oscillator's modulation parameter 3} xywh {580 315 15 15} maximum 127 step 1
class WidgetPDial
}
}
@@ -979,7 +983,16 @@ pthread_mutex_unlock(&master->mutex);
redrawoscil();
refresh();}
- xywh {680 530 55 20} box THIN_UP_BOX labelfont 1 labelsize 12
+ xywh {680 520 55 20} box THIN_UP_BOX labelfont 1 labelsize 12
+ }
+ Fl_Button {} {
+ label C
+ callback {presetsui->copy(oscil);} selected
+ xywh {680 545 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 12 labelcolor 7
+ }
+ Fl_Button {} {
+ label P
+ xywh {710 545 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 12 labelcolor 7
}
}
}
diff --git a/src/UI/PresetsUI.fl b/src/UI/PresetsUI.fl
@@ -1,41 +1,60 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0105
header_name {.h}
-code_name {.cxx}
+code_name {.cc}
+decl {\#include <stdlib.h>} {public
+}
+
+decl {\#include "../Params/Presets.h"} {public
+}
+
class PresetsUI {open
} {
+ Function {PresetsUI()} {} {
+ code {p=NULL;
+make_window();} {}
+ }
+ Function {~PresetsUI()} {open
+ } {
+ code {copywin->hide();delete(copywin);
+pastewin->hide();delete(pastewin);} {}
+ }
Function {make_window()} {open
} {
- Fl_Window {} {
- label {Copy to Clipboard/Preset} open
- xywh {511 241 265 315} type Double hide modal
+ Fl_Window copywin {
+ label {Copy to Clipboard/Preset}
+ xywh {95 240 265 315} type Double box PLASTIC_THIN_UP_BOX color 238 hide non_modal
} {
Fl_Browser {} {
xywh {10 30 245 200}
}
Fl_Button {} {
label {Copy to Preset}
+ callback {copywin->hide();}
xywh {75 240 120 20} box THIN_UP_BOX
}
Fl_Button {} {
label {Copy to Clipboard}
+ callback {p->copyclipboard();
+copywin->hide();}
xywh {25 270 90 40} box THIN_UP_BOX align 192
}
Fl_Button {} {
label Cancel
+ callback {copywin->hide();}
xywh {160 270 80 40} box THIN_UP_BOX align 192
}
Fl_Box {} {
label {Type:}
xywh {10 5 45 20} align 20
}
- Fl_Box copytypetext {selected
- xywh {50 5 200 20} box FLAT_BOX color 50 labelfont 1 align 20
+ Fl_Box copytypetext {
+ xywh {50 5 200 20} box FLAT_BOX color 239 labelfont 1 align 20
}
}
- Fl_Window {} {
- label {Paste from Clipboard/Preset} open
- xywh {238 242 265 315} type Double hide modal
+ Fl_Window pastewin {
+ label {Paste from Clipboard/Preset}
+ xywh {516 204 265 315} type Double box PLASTIC_THIN_UP_BOX color 238 hide modal
} {
Fl_Browser {} {
xywh {10 30 245 205} type Hold
@@ -50,6 +69,7 @@ class PresetsUI {open
}
Fl_Button {} {
label Cancel
+ callback {pastewin->hide();}
xywh {160 270 80 40} box THIN_UP_BOX align 192
}
Fl_Box {} {
@@ -57,8 +77,25 @@ class PresetsUI {open
xywh {10 5 45 20} align 20
}
Fl_Box pastetypetext {
- xywh {50 5 200 20} box FLAT_BOX color 50 labelfont 1 align 20
+ xywh {50 5 200 20} box FLAT_BOX color 239 labelfont 1 align 20
}
}
}
+ Function {copy(Presets *p)} {open
+ } {
+ code {this->p=p;
+bool but=(Fl::event_button()!=FL_LEFT_MOUSE);
+
+if (but) p->copyclipboard();
+ else {
+ copytypetext->label(&p->type[1]);
+ copywin->show();
+ };} {selected
+ }
+ }
+ decl {Presets *p;} {public
+ }
+}
+
+decl {PresetsUI *presetsui;} {public
}