1 /*
2
3 This widget provides peak display_specs
4
5 (c) Fraser Stuart 2009
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 */
22
23 #include "stdlib.h"
24 #include "string.h"
25 #include "math.h"
26 #include "widgets.h"
27 #include "display-Spectrograph.h"
28
29
30 static void inv_display_spec_class_init(InvDisplaySpecClass *klass);
31 static void inv_display_spec_init(InvDisplaySpec *display_spec);
32 static void inv_display_spec_size_request(GtkWidget *widget, GtkRequisition *requisition);
33 static void inv_display_spec_size_allocate(GtkWidget *widget, GtkAllocation *allocation);
34 static void inv_display_spec_realize(GtkWidget *widget);
35 static gboolean inv_display_spec_expose(GtkWidget *widget,GdkEventExpose *event);
36 static void inv_display_spec_paint(GtkWidget *widget, gint drawmode, gint pos);
37 static void inv_display_spec_destroy(GtkObject *object);
38
39 static void inv_display_spec_draw_bar(GtkWidget *widget, cairo_t *cr, gint x, gint y, gint pos, gint lastpos, gint drawmode, gint bypass);
40 static void inv_display_spec_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led);
41
42
43 GtkType
inv_display_spec_get_type(void)44 inv_display_spec_get_type(void)
45 {
46 static GType inv_display_spec_type = 0;
47 char *name;
48 int i;
49
50
51 if (!inv_display_spec_type)
52 {
53 static const GTypeInfo type_info = {
54 sizeof(InvDisplaySpecClass),
55 NULL, /* base_init */
56 NULL, /* base_finalize */
57 (GClassInitFunc)inv_display_spec_class_init,
58 NULL, /* class_finalize */
59 NULL, /* class_data */
60 sizeof(InvDisplaySpec),
61 0, /* n_preallocs */
62 (GInstanceInitFunc)inv_display_spec_init
63 };
64 for (i = 0; ; i++) {
65 name = g_strdup_printf("InvDisplaySpec-%p-%d",inv_display_spec_class_init, i);
66 if (g_type_from_name(name)) {
67 free(name);
68 continue;
69 }
70 inv_display_spec_type = g_type_register_static(GTK_TYPE_WIDGET,name,&type_info,(GTypeFlags)0);
71 free(name);
72 break;
73 }
74 }
75 return inv_display_spec_type;
76 }
77
78 void
inv_display_spec_set_bypass(InvDisplaySpec * display_spec,gint num)79 inv_display_spec_set_bypass(InvDisplaySpec *display_spec, gint num)
80 {
81 gint i;
82 if(display_spec->bypass != num) {
83 display_spec->bypass = num;
84 for(i=0;i<31;i++) {
85 display_spec->value[i]=-90;
86 }
87 }
88 }
89
90
91 void
inv_display_spec_set_value(InvDisplaySpec * display_spec,gint pos,float num)92 inv_display_spec_set_value(InvDisplaySpec *display_spec, gint pos, float num)
93 {
94 if(pos >=0 && pos <= 30) {
95 display_spec->value[pos]=num;
96 if(GTK_WIDGET_REALIZED(display_spec)) {
97 inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_ONE,pos);
98
99 }
100 }
101 }
102
103
inv_display_spec_draw_now(InvDisplaySpec * display_spec,gint mode)104 void inv_display_spec_draw_now(InvDisplaySpec *display_spec, gint mode) {
105 if(GTK_WIDGET_REALIZED(display_spec)) {
106 switch(mode) {
107 case INV_DISPLAY_SPEC_DRAW_ALL:
108 inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_ALL,0);
109 break;
110 case INV_DISPLAY_SPEC_DRAW_DATA:
111 inv_display_spec_paint(GTK_WIDGET(display_spec),INV_DISPLAY_SPEC_DRAW_DATA,0);
112 break;
113 }
114 }
115 }
116
117
inv_display_spec_new()118 GtkWidget * inv_display_spec_new()
119 {
120 return GTK_WIDGET(gtk_type_new(inv_display_spec_get_type()));
121 }
122
123
124 static void
inv_display_spec_class_init(InvDisplaySpecClass * klass)125 inv_display_spec_class_init(InvDisplaySpecClass *klass)
126 {
127 GtkWidgetClass *widget_class;
128 GtkObjectClass *object_class;
129
130
131 widget_class = (GtkWidgetClass *) klass;
132 object_class = (GtkObjectClass *) klass;
133
134 widget_class->realize = inv_display_spec_realize;
135 widget_class->size_request = inv_display_spec_size_request;
136 widget_class->size_allocate = inv_display_spec_size_allocate;
137 widget_class->expose_event = inv_display_spec_expose;
138
139 object_class->destroy = inv_display_spec_destroy;
140 }
141
142
143 static void
inv_display_spec_init(InvDisplaySpec * display_spec)144 inv_display_spec_init(InvDisplaySpec *display_spec)
145 {
146 gint i;
147
148 display_spec->bypass = INV_PLUGIN_ACTIVE;
149
150 for(i=0;i<31;i++) {
151 display_spec->value[i] = -90.0;
152 display_spec->lastvalue[i] = 0;
153 }
154
155 strcpy(display_spec->label[0],"20");
156 strcpy(display_spec->label[1],"25");
157 strcpy(display_spec->label[2],"31");
158 strcpy(display_spec->label[3],"40");
159 strcpy(display_spec->label[4],"50");
160 strcpy(display_spec->label[5],"63");
161 strcpy(display_spec->label[6],"80");
162 strcpy(display_spec->label[7],"100");
163 strcpy(display_spec->label[8],"125");
164 strcpy(display_spec->label[9],"160");
165 strcpy(display_spec->label[10],"200");
166 strcpy(display_spec->label[11],"250");
167 strcpy(display_spec->label[12],"315");
168 strcpy(display_spec->label[13],"400");
169 strcpy(display_spec->label[14],"500");
170 strcpy(display_spec->label[15],"630");
171 strcpy(display_spec->label[16],"800");
172 strcpy(display_spec->label[17],"1k");
173 strcpy(display_spec->label[18],"1.2k");
174 strcpy(display_spec->label[19],"1.6k");
175 strcpy(display_spec->label[20],"2k");
176 strcpy(display_spec->label[21],"2.5k");
177 strcpy(display_spec->label[22],"3.1k");
178 strcpy(display_spec->label[23],"4k");
179 strcpy(display_spec->label[24],"5k");
180 strcpy(display_spec->label[25],"6.3k");
181 strcpy(display_spec->label[26],"8k");
182 strcpy(display_spec->label[27],"10k");
183 strcpy(display_spec->label[28],"12k");
184 strcpy(display_spec->label[29],"16k");
185 strcpy(display_spec->label[30],"20k");
186
187 display_spec->mOff60.R =0.1; display_spec->mOff60.G =0.1; display_spec->mOff60.B =0.4;
188 display_spec->mOn60.R =-0.1; display_spec->mOn60.G =-0.1; display_spec->mOn60.B =0.6;
189
190 display_spec->mOff12.R =0.2; display_spec->mOff12.G =0.3; display_spec->mOff12.B =0.4;
191 display_spec->mOn12.R =-0.1; display_spec->mOn12.G =0.3; display_spec->mOn12.B =0.6;
192
193 display_spec->mOff6.R =0.2; display_spec->mOff6.G =0.4; display_spec->mOff6.B =0.2;
194 display_spec->mOn6.R =0.1; display_spec->mOn6.G =0.6; display_spec->mOn6.B =-0.1;
195
196 display_spec->mOff0.R =0.5; display_spec->mOff0.G =0.5; display_spec->mOff0.B =0.0;
197 display_spec->mOn0.R =0.5; display_spec->mOn0.G =0.5; display_spec->mOn0.B =0.0;
198
199 display_spec->overOff.R=0.4; display_spec->overOff.G=0.2; display_spec->overOff.B=0.0;
200 display_spec->overOn.R =0.6; display_spec->overOn.G =0.0; display_spec->overOn.B =0.0;
201
202 display_spec->font_size=0;
203
204 gtk_widget_set_tooltip_markup(GTK_WIDGET(display_spec),"<span size=\"8000\">Spectrograph</span>");
205 }
206
207
208 static void
inv_display_spec_size_request(GtkWidget * widget,GtkRequisition * requisition)209 inv_display_spec_size_request(GtkWidget *widget,
210 GtkRequisition *requisition)
211 {
212 g_return_if_fail(widget != NULL);
213 g_return_if_fail(INV_IS_DISPLAY_SPEC(widget));
214 g_return_if_fail(requisition != NULL);
215
216 requisition->width = 377;
217 requisition->height = 160;
218 }
219
220
221 static void
inv_display_spec_size_allocate(GtkWidget * widget,GtkAllocation * allocation)222 inv_display_spec_size_allocate(GtkWidget *widget,
223 GtkAllocation *allocation)
224 {
225 g_return_if_fail(widget != NULL);
226 g_return_if_fail(INV_IS_DISPLAY_SPEC(widget));
227 g_return_if_fail(allocation != NULL);
228
229 widget->allocation = *allocation;
230
231 if (GTK_WIDGET_REALIZED(widget)) {
232 gdk_window_move_resize(
233 widget->window,
234 allocation->x, allocation->y,
235 allocation->width, allocation->height
236 );
237 }
238 }
239
240
241 static void
inv_display_spec_realize(GtkWidget * widget)242 inv_display_spec_realize(GtkWidget *widget)
243 {
244 GdkWindowAttr attributes;
245 guint attributes_mask;
246
247 g_return_if_fail(widget != NULL);
248 g_return_if_fail(INV_IS_DISPLAY_SPEC(widget));
249
250 GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
251
252 attributes.window_type = GDK_WINDOW_CHILD;
253 attributes.x = widget->allocation.x;
254 attributes.y = widget->allocation.y;
255
256 attributes.width = 377;
257 attributes.height = 160;
258
259 attributes.wclass = GDK_INPUT_OUTPUT;
260 attributes.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK;
261
262 attributes_mask = GDK_WA_X | GDK_WA_Y;
263
264 widget->window = gdk_window_new(
265 gtk_widget_get_parent_window (widget),
266 & attributes, attributes_mask
267 );
268
269 gdk_window_set_user_data(widget->window, widget);
270
271 widget->style = gtk_style_attach(widget->style, widget->window);
272 gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
273 }
274
275
276 static gboolean
inv_display_spec_expose(GtkWidget * widget,GdkEventExpose * event)277 inv_display_spec_expose(GtkWidget *widget, GdkEventExpose *event)
278 {
279 g_return_val_if_fail(widget != NULL, FALSE);
280 g_return_val_if_fail(INV_IS_DISPLAY_SPEC(widget), FALSE);
281 g_return_val_if_fail(event != NULL, FALSE);
282
283 inv_display_spec_paint(widget,INV_DISPLAY_SPEC_DRAW_ALL,0);
284
285 return FALSE;
286 }
287
288
289 static void
inv_display_spec_paint(GtkWidget * widget,gint drawmode,gint pos)290 inv_display_spec_paint(GtkWidget *widget, gint drawmode, gint pos)
291 {
292 gint bypass;
293
294 gint ledpos,i,fh;
295 cairo_t *cr;
296 GtkStyle *style;
297 char label[10];
298 cairo_text_extents_t extents;
299
300 style = gtk_widget_get_style(widget);
301 bypass = INV_DISPLAY_SPEC(widget)->bypass;
302
303
304 cr = gdk_cairo_create(widget->window);
305
306
307 if(INV_DISPLAY_SPEC(widget)->font_size==0) {
308 INV_DISPLAY_SPEC(widget)->font_size=inv_choose_font_size(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL,99.0,6.1,"0");
309 }
310
311 switch(drawmode) {
312 case INV_DISPLAY_SPEC_DRAW_ALL:
313
314 gdk_cairo_set_source_color(cr,&style->bg[GTK_STATE_NORMAL]);
315 cairo_paint(cr);
316
317 cairo_set_source_rgb(cr, 0, 0, 0);
318 cairo_rectangle(cr, 0, 0, 376, 139);
319 cairo_fill(cr);
320
321 cairo_new_path(cr);
322
323 cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
324 cairo_set_antialias (cr,CAIRO_ANTIALIAS_NONE);
325 cairo_set_line_width(cr,1);
326
327 gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]);
328 cairo_move_to(cr, 0, 138);
329 cairo_line_to(cr, 0, 0);
330 cairo_line_to(cr, 375, 0);
331 cairo_stroke(cr);
332
333 gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]);
334 cairo_move_to(cr, 0, 138);
335 cairo_line_to(cr, 375, 138);
336 cairo_line_to(cr, 375, 0);
337 cairo_stroke(cr);
338
339
340 cairo_set_antialias (cr,CAIRO_ANTIALIAS_DEFAULT);
341 cairo_new_path(cr);
342
343 if(bypass==INV_PLUGIN_BYPASS) {
344 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]);
345 } else {
346 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]);
347 }
348
349
350 cairo_select_font_face(cr,"sans-serif",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL);
351 cairo_set_font_size(cr,INV_DISPLAY_SPEC(widget)->font_size);
352 strcpy(label,"0");
353 cairo_text_extents (cr,label,&extents);
354 fh=extents.height;
355 for(i=0;i<31;i++) {
356 cairo_text_extents (cr,INV_DISPLAY_SPEC(widget)->label[i],&extents);
357 switch (i) {
358 case 0:
359 case 2:
360 case 4:
361 case 6:
362 case 8:
363 case 10:
364 case 12:
365 case 14:
366 case 16:
367 case 18:
368 case 20:
369 case 22:
370 case 24:
371 case 26:
372 case 28:
373 case 30:
374 if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) {
375 gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]);
376 } else {
377 gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]);
378 }
379 cairo_rectangle(cr, (i*12)+7,140, 1, 2);
380 cairo_fill(cr);
381
382 if(bypass==INV_PLUGIN_BYPASS) {
383 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]);
384 } else {
385 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]);
386 }
387 cairo_move_to(cr,(i*12)+7-(extents.width/2),144+fh);
388 cairo_show_text(cr,INV_DISPLAY_SPEC(widget)->label[i]);
389 break;
390 case 1:
391 case 3:
392 case 5:
393 case 7:
394 case 9:
395 case 11:
396 case 13:
397 case 15:
398 case 17:
399 case 19:
400 case 21:
401 case 23:
402 case 25:
403 case 27:
404 case 29:
405 if(inv_choose_light_dark(&style->bg[GTK_STATE_NORMAL],&style->light[GTK_STATE_NORMAL],&style->dark[GTK_STATE_NORMAL])==1) {
406 gdk_cairo_set_source_color(cr,&style->light[GTK_STATE_NORMAL]);
407 } else {
408 gdk_cairo_set_source_color(cr,&style->dark[GTK_STATE_NORMAL]);
409 }
410 cairo_rectangle(cr, (i*12)+7,140, 1, 11);
411 cairo_fill(cr);
412
413 if(bypass==INV_PLUGIN_BYPASS) {
414 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_INSENSITIVE]);
415 } else {
416 gdk_cairo_set_source_color(cr,&style->fg[GTK_STATE_NORMAL]);
417 }
418 cairo_move_to(cr,(i*12)+7-(extents.width/2),153+fh);
419 cairo_show_text(cr,INV_DISPLAY_SPEC(widget)->label[i]);
420 break;
421 }
422 }
423
424 for(i=0;i<31;i++) {
425 ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[i]+60.51) : 0 ;
426 inv_display_spec_draw_bar(widget, cr, (i*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[i], drawmode,bypass);
427 INV_DISPLAY_SPEC(widget)->lastvalue[i]=ledpos;
428 }
429 break;
430 case INV_DISPLAY_SPEC_DRAW_DATA:
431 for(i=0;i<31;i++) {
432 ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[i]+60.51) : 0 ;
433 inv_display_spec_draw_bar(widget, cr, (i*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[i], drawmode,bypass);
434 INV_DISPLAY_SPEC(widget)->lastvalue[i]=ledpos;
435 }
436 break;
437
438 case INV_DISPLAY_SPEC_DRAW_ONE:
439 ledpos = bypass==INV_PLUGIN_ACTIVE ? (gint)(INV_DISPLAY_SPEC(widget)->value[pos]+60.51) : 0 ;
440 inv_display_spec_draw_bar(widget, cr, (pos*12)+3,137,ledpos,INV_DISPLAY_SPEC(widget)->lastvalue[pos], drawmode,bypass);
441 INV_DISPLAY_SPEC(widget)->lastvalue[pos]=ledpos;
442 break;
443
444 }
445 cairo_destroy(cr);
446 }
447
448
449 static void
inv_display_spec_destroy(GtkObject * object)450 inv_display_spec_destroy(GtkObject *object)
451 {
452 InvDisplaySpec *display_spec;
453 InvDisplaySpecClass *klass;
454
455 g_return_if_fail(object != NULL);
456 g_return_if_fail(INV_IS_DISPLAY_SPEC(object));
457
458 display_spec = INV_DISPLAY_SPEC(object);
459
460 klass = gtk_type_class(gtk_widget_get_type());
461
462 if (GTK_OBJECT_CLASS(klass)->destroy) {
463 (* GTK_OBJECT_CLASS(klass)->destroy) (object);
464 }
465 }
466
467 static void
inv_display_spec_draw_bar(GtkWidget * widget,cairo_t * cr,gint x,gint y,gint pos,gint lastpos,gint drawmode,gint bypass)468 inv_display_spec_draw_bar(GtkWidget *widget, cairo_t *cr, gint x, gint y, gint pos, gint lastpos, gint drawmode, gint bypass) {
469
470 gint i,Lon,min,max;
471 struct colour led;
472
473 switch(drawmode) {
474 case INV_DISPLAY_SPEC_DRAW_ALL:
475 for ( i = 1; i <= 67; i++)
476 {
477 Lon = i <= pos ? 1 : 0;
478
479 inv_display_spec_colour_tozero(widget, bypass, i, Lon, &led);
480 cairo_set_source_rgb(cr, led.R, led.G, led.B);
481 cairo_rectangle(cr, x, y-(i*2), 10, 1);
482 cairo_fill(cr);
483
484 }
485 break;
486 case INV_DISPLAY_SPEC_DRAW_DATA:
487 case INV_DISPLAY_SPEC_DRAW_ONE:
488 min = lastpos < pos ? lastpos : pos;
489 max = lastpos > pos ? lastpos : pos;
490 if(min<1) min=1;
491 if(max<1) max=1;
492 if(min>67) min=67;
493 if(max>67) max=67;
494 if(min != max || max == 1 ) {
495 for ( i = min ; i <= max; i++)
496 {
497 Lon = i <= pos ? 1 : 0;
498
499 inv_display_spec_colour_tozero(widget, bypass, i, Lon, &led);
500 cairo_set_source_rgb(cr, led.R, led.G, led.B);
501 cairo_rectangle(cr, x, y-(i*2), 10, 1);
502 cairo_fill(cr);
503 }
504 }
505 break;
506 }
507 }
508
509
510 static void
inv_display_spec_colour_tozero(GtkWidget * widget,gint bypass,gint pos,gint on,struct colour * led)511 inv_display_spec_colour_tozero(GtkWidget *widget, gint bypass, gint pos, gint on, struct colour *led)
512 {
513 float r1,r2;
514 struct colour mOff60 = INV_DISPLAY_SPEC(widget)->mOff60;
515 struct colour mOn60 = INV_DISPLAY_SPEC(widget)->mOn60;
516 struct colour mOff12 = INV_DISPLAY_SPEC(widget)->mOff12;
517 struct colour mOn12 = INV_DISPLAY_SPEC(widget)->mOn12;
518 struct colour mOff6 = INV_DISPLAY_SPEC(widget)->mOff6;
519 struct colour mOn6 = INV_DISPLAY_SPEC(widget)->mOn6;
520 struct colour mOff0 = INV_DISPLAY_SPEC(widget)->mOff0;
521 struct colour mOn0 = INV_DISPLAY_SPEC(widget)->mOn0;
522 struct colour overOff = INV_DISPLAY_SPEC(widget)->overOff;
523 struct colour overOn = INV_DISPLAY_SPEC(widget)->overOn;
524 /*
525 66 = +6dB
526 60 = 0dB
527 48 = -12dB
528 36 = -24dB
529 */
530 if(pos < 36)
531 {
532 r1=(36.0-(float)pos)/36.0;
533 r2=(float)pos/36.0;
534 led->R=(r1 * mOff60.R + (r2 * mOff12.R)) + (on * ((r1 * mOn60.R) + (r2 * mOn12.R))) ;
535 led->G=(r1 * mOff60.G + (r2 * mOff12.G)) + (on * ((r1 * mOn60.G) + (r2 * mOn12.G))) ;
536 led->B=(r1 * mOff60.B + (r2 * mOff12.B)) + (on * ((r1 * mOn60.B) + (r2 * mOn12.B))) ;
537 }
538
539 else if (pos < 48)
540 {
541 r1=(48.0-(float)pos)/12.0;
542 r2=((float)pos-36.0)/12.0;
543 led->R=(r1 * mOff12.R + (r2 * mOff6.R)) + (on * ((r1 * mOn12.R) + (r2 * mOn6.R))) ;
544 led->G=(r1 * mOff12.G + (r2 * mOff6.G)) + (on * ((r1 * mOn12.G) + (r2 * mOn6.G))) ;
545 led->B=(r1 * mOff12.B + (r2 * mOff6.B)) + (on * ((r1 * mOn12.B) + (r2 * mOn6.B))) ;
546 }
547
548 else if (pos < 60)
549 {
550 r1=(60.0-(float)pos)/12.0;
551 r2=((float)pos-48.0)/12.0;
552 led->R=(r1 * mOff6.R + (r2 * mOff0.R)) + (on * ((r1 * mOn6.R) + (r2 * mOn0.R))) ;
553 led->G=(r1 * mOff6.G + (r2 * mOff0.G)) + (on * ((r1 * mOn6.G) + (r2 * mOn0.G))) ;
554 led->B=(r1 * mOff6.B + (r2 * mOff0.B)) + (on * ((r1 * mOn6.B) + (r2 * mOn0.B))) ;
555 }
556 else
557 {
558 led->R=overOff.R + (on * overOn.R) ;
559 led->G=overOff.G + (on * overOn.G) ;
560 led->B=overOff.B + (on * overOn.B) ;
561 }
562
563 if(bypass==INV_PLUGIN_BYPASS) {
564 led->R=(led->R+led->G+led->B)/3;
565 led->G=led->R;
566 led->B=led->R;
567 }
568 }
569
570
571