14#include <FL/fl_draw.H>
15#include <FL/Fl_Value_Output.H>
51 case 0:fl_line_style(FL_SOLID);
break;
52 case 1:fl_line_style(FL_DOT);
break;
53 case 2:fl_line_style(FL_DASH);
break;
57 if ((freqx>0.0)&&(freqx<1.0))
58 fl_line(
x()+(
int) (freqx*
w()),
y(),
59 x()+(
int) (freqx*
w()),
y()+
h());
64 const int ox=
x(),oy=
y(),
lx=
w(),ly=
h();
67 fl_rectf(ox,oy,
lx,ly);
73 fl_line_style(FL_SOLID);
74 fl_line(ox+2,oy+ly/2,ox+
lx-2,oy+ly/2);
79 if ((freqx>0.0)&&(freqx<1.0))
80 fl_line(ox+(
int) (freqx*
lx),oy,
81 ox+(
int) (freqx*
lx),oy+ly);
84 for (
int i=1;
i<10; ++
i){
102 fl_line_style(FL_DOT);
103 int GY=10;
if (ly<GY*3) GY=-1;
104 for (
int i=1;
i<GY; ++
i){
105 int tmp=(
int)(ly/(
float)GY*
i);
106 fl_line(ox+2,oy+tmp,ox+
lx-2,oy+tmp);
113 fl_line_style(FL_SOLID,2);
119 fl_vertex(ox+ix,oy+ly-oiy);
123 fl_line_style(FL_SOLID,0);
128 int x_=Fl::event_x()-
x();
129 int y_=Fl::event_y()-
y();
130 if((x_>=0)&&(x_<
w()) && (y_>=0)&&(y_<
h())){
135 if((event==FL_PUSH)||(event==FL_DRAG)){
136 const bool leftbutton = Fl::event_button() == FL_LEFT_MOUSE;
138 if (x_<0) x_=0;
if (y_<0) y_=0;
139 if (x_>=
w()) x_=
w();
if (y_>=
h()-1) y_=
h()-1;
143 int sp=127-(
int)(y_*1.0/
h()*127);
159 for (
int i=0;
i<x2-x1;
i++){
161 float yy=(y2-y1)*1.0/(x2-x1)*
i;
162 int sp=127-(
int)((y1+yy)/
h()*127);
176 if(event==FL_RELEASE) {
207 if(strstr(
msg,
"Prespoints")) {
211 }
else if(strstr(
msg,
"Pcenterfreq"))
213 else if(strstr(
msg,
"Poctavesfreq"))
215 else if(strstr(
msg,
"PmaxdB"))
218 puts(
"I got an unknown message...");
242 return 10000.0f * powf(10, -(1.0f -
Pcenterfreq / 127.0f) * 2.0f);
#define N_RES_POINTS
Definition Resonance.h:22
uint8_t sp
Definition Spc_Cpu.h:145
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
Fl_Value_Output * khzvalue
Definition Fl_Resonance_Graph.H:45
int handle(int event)
Definition Fl_Resonance_Graph.cpp:126
void draw_freq_line(float freq, int type)
Definition Fl_Resonance_Graph.cpp:47
void setcbwidget(Fl_Widget *cbwidget, Fl_Widget *applybutton)
Definition Fl_Resonance_Graph.cpp:190
Fl_Resonance_Graph(int x, int y, int w, int h, const char *label=0)
Definition Fl_Resonance_Graph.cpp:19
char PmaxdB
Definition Fl_Resonance_Graph.H:54
void update(void)
Definition Fl_Resonance_Graph.cpp:196
Fl_Value_Output * dbvalue
Definition Fl_Resonance_Graph.H:46
void init(Fl_Value_Output *khzvalue_, Fl_Value_Output *dbvalue_)
Definition Fl_Resonance_Graph.cpp:39
int oldx
Definition Fl_Resonance_Graph.H:47
float getcenterfreq() const
Definition Fl_Resonance_Graph.cpp:240
char Pcenterfreq
Definition Fl_Resonance_Graph.H:52
void OSC_raw(const char *msg)
Definition Fl_Resonance_Graph.cpp:204
void setPoint(int idx, int val)
Definition Fl_Resonance_Graph.cpp:253
void draw()
Definition Fl_Resonance_Graph.cpp:62
float khzval
Definition Fl_Resonance_Graph.H:33
float getfreqx(float x) const
Definition Fl_Resonance_Graph.cpp:223
unsigned char Prespoints[N_RES_POINTS]
Definition Fl_Resonance_Graph.H:51
int oldy
Definition Fl_Resonance_Graph.H:47
Fl_Widget * cbwidget
Definition Fl_Resonance_Graph.H:48
Fl_Widget * applybutton
Definition Fl_Resonance_Graph.H:48
float getfreqpos(float freq) const
Definition Fl_Resonance_Graph.cpp:232
float getoctavesfreq() const
Definition Fl_Resonance_Graph.cpp:248
virtual ~Fl_Resonance_Graph(void)
Definition Fl_Resonance_Graph.cpp:35
char Poctavesfreq
Definition Fl_Resonance_Graph.H:53
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
int lx[BMAX+1]
Definition inflate.c:1578
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
JHUFF_TBL long freq[]
Definition jchuff.h:50
int val
Definition jpeglib.h:956
const char * msg
Definition missing_descriptor.c:20
Definition zynaddsubfx-src.cpp:569
T limit(T val, T min, T max)
Definition Util.h:85
std::string to_s(T x)
Definition Util.h:67
float arg(const fft_t *freqs, off_t x)
Definition OscilGen.cpp:286
rtosc_arg_t rtosc_argument(const char *msg, unsigned idx)
Definition rtosc.c:732
int32_t i
Definition rtosc.h:47
rtosc_blob_t b
Definition rtosc.h:55
memcpy(hh, h, RAND_HEAD_LEN)
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
typedef int(UZ_EXP MsgFn)()