summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/clock.c192
-rw-r--r--apps/plugins/vu_meter.c62
2 files changed, 129 insertions, 125 deletions
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c
index 73b21fcddd..71415c03d4 100644
--- a/apps/plugins/clock.c
+++ b/apps/plugins/clock.c
@@ -300,30 +300,30 @@ struct saved_settings
300 int fullscreen[2]; 300 int fullscreen[2];
301 int binary[1]; 301 int binary[1];
302 int plain[4]; 302 int plain[4];
303} settings; 303} clock_settings;
304 304
305/************************ 305/************************
306 * Setting default values 306 * Setting default values
307 ***********************/ 307 ***********************/
308void reset_settings(void) 308void reset_settings(void)
309{ 309{
310 settings.clock = 1; 310 clock_settings.clock = 1;
311 settings.general[general_counter] = 1; 311 clock_settings.general[general_counter] = 1;
312 settings.general[general_savesetting] = 1; 312 clock_settings.general[general_savesetting] = 1;
313 settings.general[general_backlight] = 2; 313 clock_settings.general[general_backlight] = 2;
314 settings.analog[analog_date] = 0; 314 clock_settings.analog[analog_date] = 0;
315 settings.analog[analog_secondhand] = true; 315 clock_settings.analog[analog_secondhand] = true;
316 settings.analog[analog_time] = false; 316 clock_settings.analog[analog_time] = false;
317 settings.digital[digital_seconds] = 1; 317 clock_settings.digital[digital_seconds] = 1;
318 settings.digital[digital_date] = 1; 318 clock_settings.digital[digital_date] = 1;
319 settings.digital[digital_blinkcolon] = false; 319 clock_settings.digital[digital_blinkcolon] = false;
320 settings.digital[digital_format] = true; 320 clock_settings.digital[digital_format] = true;
321 settings.fullscreen[fullscreen_border] = true; 321 clock_settings.fullscreen[fullscreen_border] = true;
322 settings.fullscreen[fullscreen_secondhand] = true; 322 clock_settings.fullscreen[fullscreen_secondhand] = true;
323 settings.plain[plain_format] = true; 323 clock_settings.plain[plain_format] = true;
324 settings.plain[plain_seconds] = true; 324 clock_settings.plain[plain_seconds] = true;
325 settings.plain[plain_date] = 1; 325 clock_settings.plain[plain_date] = 1;
326 settings.plain[plain_blinkcolon] = false; 326 clock_settings.plain[plain_blinkcolon] = false;
327} 327}
328 328
329/************************************************************** 329/**************************************************************
@@ -333,7 +333,7 @@ void reset_settings(void)
333void set_digital_colors(void) 333void set_digital_colors(void)
334{ 334{
335#ifdef HAVE_LCD_COLOR /* color LCDs.. */ 335#ifdef HAVE_LCD_COLOR /* color LCDs.. */
336 if(settings.clock == DIGITAL) 336 if(clock_settings.clock == DIGITAL)
337 { 337 {
338 rb->lcd_set_foreground(LCD_WHITE); 338 rb->lcd_set_foreground(LCD_WHITE);
339 rb->lcd_set_background(LCD_BLACK); 339 rb->lcd_set_background(LCD_BLACK);
@@ -344,7 +344,7 @@ void set_digital_colors(void)
344 rb->lcd_set_background(LCD_RGBPACK(180,200,230)); 344 rb->lcd_set_background(LCD_RGBPACK(180,200,230));
345 } 345 }
346#elif LCD_DEPTH >= 2 346#elif LCD_DEPTH >= 2
347 if(settings.clock == DIGITAL) 347 if(clock_settings.clock == DIGITAL)
348 { 348 {
349 rb->lcd_set_foreground(LCD_WHITE); 349 rb->lcd_set_foreground(LCD_WHITE);
350 rb->lcd_set_background(LCD_BLACK); 350 rb->lcd_set_background(LCD_BLACK);
@@ -378,7 +378,7 @@ void cleanup(void *parameter)
378{ 378{
379 (void)parameter; 379 (void)parameter;
380 380
381 if(settings.general[general_savesetting] == 1) 381 if(clock_settings.general[general_savesetting] == 1)
382 save_settings(true); 382 save_settings(true);
383 383
384 /* restore set backlight timeout */ 384 /* restore set backlight timeout */
@@ -423,7 +423,7 @@ void save_settings(bool interface)
423 423
424 if(fd >= 0) /* file exists, save successful */ 424 if(fd >= 0) /* file exists, save successful */
425 { 425 {
426 rb->write (fd, &settings, sizeof(struct saved_settings)); 426 rb->write (fd, &clock_settings, sizeof(struct saved_settings));
427 rb->close(fd); 427 rb->close(fd);
428 428
429 if(interface) 429 if(interface)
@@ -472,7 +472,7 @@ void load_settings(void)
472 { 472 {
473 if(rb->filesize(fd) == sizeof(struct saved_settings)) /* if so, is it the right size? */ 473 if(rb->filesize(fd) == sizeof(struct saved_settings)) /* if so, is it the right size? */
474 { 474 {
475 rb->read(fd, &settings, sizeof(struct saved_settings)); 475 rb->read(fd, &clock_settings, sizeof(struct saved_settings));
476 rb->close(fd); 476 rb->close(fd);
477 477
478 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 478 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@@ -572,11 +572,11 @@ void init_clock(void)
572 load_settings(); 572 load_settings();
573 573
574 /* set backlight timeout */ 574 /* set backlight timeout */
575 if(settings.general[general_backlight] == 0) 575 if(clock_settings.general[general_backlight] == 0)
576 rb->backlight_set_timeout(0); 576 rb->backlight_set_timeout(0);
577 else if(settings.general[general_backlight] == 1) 577 else if(clock_settings.general[general_backlight] == 1)
578 rb->backlight_set_timeout(rb->global_settings->backlight_timeout); 578 rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
579 else if(settings.general[general_backlight] == 2) 579 else if(clock_settings.general[general_backlight] == 2)
580 rb->backlight_set_timeout(1); 580 rb->backlight_set_timeout(1);
581 581
582 for(i=0; i<ANALOG_VALUES; i++) 582 for(i=0; i<ANALOG_VALUES; i++)
@@ -616,7 +616,7 @@ void analog_clock(int hour, int minute, int second)
616 rb->lcd_set_foreground(LCD_RGBPACK(100,110,125)); 616 rb->lcd_set_foreground(LCD_RGBPACK(100,110,125));
617 617
618 /* second hand */ 618 /* second hand */
619 if(settings.analog[analog_secondhand]) 619 if(clock_settings.analog[analog_secondhand])
620 { 620 {
621 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-2, LCD_WIDTH/2, LCD_HEIGHT/2+2, 621 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-2, LCD_WIDTH/2, LCD_HEIGHT/2+2,
622 xminute[second], yminute[second]); 622 xminute[second], yminute[second]);
@@ -640,7 +640,7 @@ void analog_clock(int hour, int minute, int second)
640#endif 640#endif
641 641
642 /* second hand, if needed */ 642 /* second hand, if needed */
643 if(settings.analog[analog_secondhand]) 643 if(clock_settings.analog[analog_secondhand])
644 { 644 {
645 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-1, LCD_WIDTH/2, LCD_HEIGHT/2+1, 645 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-1, LCD_WIDTH/2, LCD_HEIGHT/2+1,
646 xminute[second], yminute[second]); 646 xminute[second], yminute[second]);
@@ -690,14 +690,14 @@ void digital_clock(int hour, int minute, int second, bool colon)
690 690
691 /* this basically detects if we draw an AM or PM bitmap. 691 /* this basically detects if we draw an AM or PM bitmap.
692 * if we don't, we center the hh:mm display. */ 692 * if we don't, we center the hh:mm display. */
693 if(!settings.digital[digital_format]) 693 if(!clock_settings.digital[digital_format])
694 x_ofs=DIGIT_WIDTH/2; 694 x_ofs=DIGIT_WIDTH/2;
695 695
696#if LCD_DEPTH == 1 696#if LCD_DEPTH == 1
697 rb->lcd_fillrect(0,0,112,64); 697 rb->lcd_fillrect(0,0,112,64);
698#endif 698#endif
699 699
700 if(settings.digital[digital_format]) 700 if(clock_settings.digital[digital_format])
701 { 701 {
702 /* draw the AM or PM bitmap */ 702 /* draw the AM or PM bitmap */
703 if(hour<12) 703 if(hour<12)
@@ -723,7 +723,7 @@ void digital_clock(int hour, int minute, int second, bool colon)
723 draw_segment(minute/10, DIGIT_XOFS(6)+3*DIGIT_WIDTH+x_ofs, 0); 723 draw_segment(minute/10, DIGIT_XOFS(6)+3*DIGIT_WIDTH+x_ofs, 0);
724 draw_segment(minute%10, DIGIT_XOFS(6)+4*DIGIT_WIDTH+x_ofs, 0); 724 draw_segment(minute%10, DIGIT_XOFS(6)+4*DIGIT_WIDTH+x_ofs, 0);
725 725
726 if(settings.digital[digital_seconds]) 726 if(clock_settings.digital[digital_seconds])
727 { 727 {
728 draw_segment(second/10, DIGIT_XOFS(2), DIGIT_HEIGHT); 728 draw_segment(second/10, DIGIT_XOFS(2), DIGIT_HEIGHT);
729 draw_segment(second%10, DIGIT_XOFS(2)+DIGIT_WIDTH, DIGIT_HEIGHT); 729 draw_segment(second%10, DIGIT_XOFS(2)+DIGIT_WIDTH, DIGIT_HEIGHT);
@@ -749,7 +749,7 @@ void fullscreen_clock(int hour, int minute, int second)
749 rb->lcd_set_foreground(LCD_RGBPACK(100,110,125)); 749 rb->lcd_set_foreground(LCD_RGBPACK(100,110,125));
750 750
751 /* second hand */ 751 /* second hand */
752 if(settings.analog[analog_secondhand]) 752 if(clock_settings.analog[analog_secondhand])
753 { 753 {
754 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-2, LCD_WIDTH/2, LCD_HEIGHT/2+2, 754 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-2, LCD_WIDTH/2, LCD_HEIGHT/2+2,
755 xminute_full[second], yminute_full[second]); 755 xminute_full[second], yminute_full[second]);
@@ -773,7 +773,7 @@ void fullscreen_clock(int hour, int minute, int second)
773#endif 773#endif
774 774
775 /* second hand, if needed */ 775 /* second hand, if needed */
776 if(settings.analog[analog_secondhand]) 776 if(clock_settings.analog[analog_secondhand])
777 { 777 {
778 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-1, LCD_WIDTH/2, LCD_HEIGHT/2+1, 778 xlcd_filltriangle(LCD_WIDTH/2, LCD_HEIGHT/2-1, LCD_WIDTH/2, LCD_HEIGHT/2+1,
779 xminute_full[second], yminute_full[second]); 779 xminute_full[second], yminute_full[second]);
@@ -833,7 +833,7 @@ void binary_clock(int hour, int minute, int second)
833 { 833 {
834 if(mode_var[mode] >= i) 834 if(mode_var[mode] >= i)
835 { 835 {
836 if(settings.binary[binary_mode]) 836 if(clock_settings.binary[binary_mode])
837 draw_digit(DOT_FILLED, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3)); 837 draw_digit(DOT_FILLED, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3));
838 else 838 else
839 draw_digit(1, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3)); 839 draw_digit(1, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3));
@@ -841,7 +841,7 @@ void binary_clock(int hour, int minute, int second)
841 } 841 }
842 else 842 else
843 { 843 {
844 if(settings.binary[binary_mode]) 844 if(clock_settings.binary[binary_mode])
845 draw_digit(DOT_EMPTY, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3)); 845 draw_digit(DOT_EMPTY, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3));
846 else 846 else
847 draw_digit(0, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3)); 847 draw_digit(0, xpos*DIGIT_WIDTH+DIGIT_XOFS(6), DIGIT_HEIGHT*mode+DIGIT_YOFS(3));
@@ -864,10 +864,10 @@ void plain_clock(int hour, int minute, int second, bool colon)
864 864
865 /* this basically detects if we draw an AM or PM bitmap. 865 /* this basically detects if we draw an AM or PM bitmap.
866 * if we don't, we center the hh:mm display. */ 866 * if we don't, we center the hh:mm display. */
867 if(!settings.plain[plain_format]) 867 if(!clock_settings.plain[plain_format])
868 x_ofs=DIGIT_WIDTH/2; 868 x_ofs=DIGIT_WIDTH/2;
869 869
870 if(settings.plain[plain_format]) 870 if(clock_settings.plain[plain_format])
871 { 871 {
872 /* draw the AM or PM bitmap */ 872 /* draw the AM or PM bitmap */
873 if(hour<12) 873 if(hour<12)
@@ -891,7 +891,7 @@ void plain_clock(int hour, int minute, int second, bool colon)
891 draw_digit(minute/10, DIGIT_XOFS(6)+(DIGIT_WIDTH*3)+x_ofs, 0); 891 draw_digit(minute/10, DIGIT_XOFS(6)+(DIGIT_WIDTH*3)+x_ofs, 0);
892 draw_digit(minute%10, DIGIT_XOFS(6)+(DIGIT_WIDTH*4)+x_ofs, 0); 892 draw_digit(minute%10, DIGIT_XOFS(6)+(DIGIT_WIDTH*4)+x_ofs, 0);
893 893
894 if(settings.plain[plain_seconds]) 894 if(clock_settings.plain[plain_seconds])
895 { 895 {
896 draw_digit(second/10, DIGIT_XOFS(2), DIGIT_HEIGHT); 896 draw_digit(second/10, DIGIT_XOFS(2), DIGIT_HEIGHT);
897 draw_digit(second%10, DIGIT_XOFS(2)+(DIGIT_WIDTH), DIGIT_HEIGHT); 897 draw_digit(second%10, DIGIT_XOFS(2)+(DIGIT_WIDTH), DIGIT_HEIGHT);
@@ -915,7 +915,7 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
915 char tmsec[3]; 915 char tmsec[3];
916 916
917 /* american date readout */ 917 /* american date readout */
918 if(settings.analog[analog_date] == 1) 918 if(clock_settings.analog[analog_date] == 1)
919 rb->snprintf(moday, sizeof(moday), "%02d/%02d", month, day); 919 rb->snprintf(moday, sizeof(moday), "%02d/%02d", month, day);
920 else 920 else
921 rb->snprintf(moday, sizeof(moday), "%02d.%02d", day, month); 921 rb->snprintf(moday, sizeof(moday), "%02d.%02d", day, month);
@@ -924,9 +924,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
924 rb->snprintf(tmsec, sizeof(tmsec), "%02d", second); 924 rb->snprintf(tmsec, sizeof(tmsec), "%02d", second);
925 925
926 /* Analog Extras */ 926 /* Analog Extras */
927 if(settings.clock == ANALOG) 927 if(clock_settings.clock == ANALOG)
928 { 928 {
929 if(settings.analog[analog_time] != 0) /* Digital readout */ 929 if(clock_settings.analog[analog_time] != 0) /* Digital readout */
930 { 930 {
931 draw_smalldigit(hour/10, SMALLDIGIT_WIDTH*0, 0); 931 draw_smalldigit(hour/10, SMALLDIGIT_WIDTH*0, 0);
932 draw_smalldigit(hour%10, SMALLDIGIT_WIDTH*1, 0); 932 draw_smalldigit(hour%10, SMALLDIGIT_WIDTH*1, 0);
@@ -938,7 +938,7 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
938 draw_smalldigit(second%10, SMALLDIGIT_WIDTH*2.5, SMALLDIGIT_HEIGHT); 938 draw_smalldigit(second%10, SMALLDIGIT_WIDTH*2.5, SMALLDIGIT_HEIGHT);
939 939
940 /* AM/PM indicator */ 940 /* AM/PM indicator */
941 if(settings.analog[analog_time] == 2) 941 if(clock_settings.analog[analog_time] == 2)
942 { 942 {
943 if(current_time->tm_hour > 12) /* PM */ 943 if(current_time->tm_hour > 12) /* PM */
944 draw_digit(ICON_PM, LCD_WIDTH-DIGIT_WIDTH, DIGIT_HEIGHT/2-DIGIT_HEIGHT); 944 draw_digit(ICON_PM, LCD_WIDTH-DIGIT_WIDTH, DIGIT_HEIGHT/2-DIGIT_HEIGHT);
@@ -946,9 +946,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
946 draw_digit(ICON_AM, LCD_WIDTH-DIGIT_WIDTH, DIGIT_HEIGHT/2-DIGIT_HEIGHT); 946 draw_digit(ICON_AM, LCD_WIDTH-DIGIT_WIDTH, DIGIT_HEIGHT/2-DIGIT_HEIGHT);
947 } 947 }
948 } 948 }
949 if(settings.analog[analog_date] != 0) /* Date readout */ 949 if(clock_settings.analog[analog_date] != 0) /* Date readout */
950 { 950 {
951 if(settings.analog[analog_date] == 1) 951 if(clock_settings.analog[analog_date] == 1)
952 { 952 {
953 draw_smalldigit(month/10, SMALLDIGIT_WIDTH*0, 953 draw_smalldigit(month/10, SMALLDIGIT_WIDTH*0,
954 LCD_HEIGHT-SMALLDIGIT_HEIGHT*2); 954 LCD_HEIGHT-SMALLDIGIT_HEIGHT*2);
@@ -969,7 +969,7 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
969 draw_smalldigit(year%10, SMALLDIGIT_WIDTH*3.5, 969 draw_smalldigit(year%10, SMALLDIGIT_WIDTH*3.5,
970 LCD_HEIGHT-SMALLDIGIT_HEIGHT); 970 LCD_HEIGHT-SMALLDIGIT_HEIGHT);
971 } 971 }
972 else if(settings.analog[analog_date] == 2) 972 else if(clock_settings.analog[analog_date] == 2)
973 { 973 {
974 974
975 draw_smalldigit(day/10, SMALLDIGIT_WIDTH*0, 975 draw_smalldigit(day/10, SMALLDIGIT_WIDTH*0,
@@ -993,10 +993,10 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
993 } 993 }
994 } 994 }
995 } 995 }
996 else if(settings.clock == DIGITAL) 996 else if(clock_settings.clock == DIGITAL)
997 { 997 {
998 /* Date readout */ 998 /* Date readout */
999 if(settings.digital[digital_date] == 1) /* american mode */ 999 if(clock_settings.digital[digital_date] == 1) /* american mode */
1000 { 1000 {
1001 draw_smallsegment(month/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(10), 1001 draw_smallsegment(month/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(10),
1002 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2); 1002 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2);
@@ -1019,7 +1019,7 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
1019 draw_smallsegment(year%10, SMALLSEG_WIDTH*9+SMALLSEG_XOFS(10), 1019 draw_smallsegment(year%10, SMALLSEG_WIDTH*9+SMALLSEG_XOFS(10),
1020 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2); 1020 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2);
1021 } 1021 }
1022 else if(settings.digital[digital_date] == 2) /* european mode */ 1022 else if(clock_settings.digital[digital_date] == 2) /* european mode */
1023 { 1023 {
1024 draw_smallsegment(day/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(10), 1024 draw_smallsegment(day/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(10),
1025 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2); 1025 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2);
@@ -1043,18 +1043,18 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
1043 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2); 1043 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET*2);
1044 } 1044 }
1045 } 1045 }
1046 else if(settings.clock == FULLSCREEN) /* Fullscreen mode */ 1046 else if(clock_settings.clock == FULLSCREEN) /* Fullscreen mode */
1047 { 1047 {
1048 if(settings.fullscreen[fullscreen_border]) 1048 if(clock_settings.fullscreen[fullscreen_border])
1049 { 1049 {
1050 for(i=0; i < 60; i+=5) /* Draw the circle */ 1050 for(i=0; i < 60; i+=5) /* Draw the circle */
1051 rb->lcd_fillrect(xminute_full[i]-1, yminute_full[i]-1, 3, 3); 1051 rb->lcd_fillrect(xminute_full[i]-1, yminute_full[i]-1, 3, 3);
1052 } 1052 }
1053 } 1053 }
1054 else if(settings.clock == PLAIN) /* Plain mode */ 1054 else if(clock_settings.clock == PLAIN) /* Plain mode */
1055 { 1055 {
1056 /* Date readout */ 1056 /* Date readout */
1057 if(settings.plain[plain_date] == 1) /* american mode */ 1057 if(clock_settings.plain[plain_date] == 1) /* american mode */
1058 { 1058 {
1059 draw_smalldigit(month/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(10), 1059 draw_smalldigit(month/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(10),
1060 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2); 1060 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2);
@@ -1077,7 +1077,7 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
1077 draw_smalldigit(year%10, SMALLDIGIT_WIDTH*9+SMALLDIGIT_XOFS(10), 1077 draw_smalldigit(year%10, SMALLDIGIT_WIDTH*9+SMALLDIGIT_XOFS(10),
1078 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2); 1078 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2);
1079 } 1079 }
1080 else if(settings.plain[plain_date] == 2) /* european mode */ 1080 else if(clock_settings.plain[plain_date] == 2) /* european mode */
1081 { 1081 {
1082 draw_smalldigit(day/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(10), 1082 draw_smalldigit(day/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(10),
1083 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2); 1083 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET*2);
@@ -1123,9 +1123,9 @@ void show_counter(void)
1123 count_m = displayed_value % 3600 / 60; 1123 count_m = displayed_value % 3600 / 60;
1124 count_h = displayed_value / 3600; 1124 count_h = displayed_value / 3600;
1125 1125
1126 if(settings.general[general_counter]) 1126 if(clock_settings.general[general_counter])
1127 { 1127 {
1128 if(settings.clock == ANALOG) 1128 if(clock_settings.clock == ANALOG)
1129 { 1129 {
1130 draw_smalldigit(count_h/10, LCD_WIDTH-SMALLDIGIT_WIDTH*5, 1130 draw_smalldigit(count_h/10, LCD_WIDTH-SMALLDIGIT_WIDTH*5,
1131 LCD_HEIGHT-SMALLDIGIT_HEIGHT*2); 1131 LCD_HEIGHT-SMALLDIGIT_HEIGHT*2);
@@ -1142,7 +1142,7 @@ void show_counter(void)
1142 draw_smalldigit(count_s%10, LCD_WIDTH-SMALLDIGIT_WIDTH*2.5, 1142 draw_smalldigit(count_s%10, LCD_WIDTH-SMALLDIGIT_WIDTH*2.5,
1143 LCD_HEIGHT-SMALLDIGIT_HEIGHT); 1143 LCD_HEIGHT-SMALLDIGIT_HEIGHT);
1144 } 1144 }
1145 else if(settings.clock == DIGITAL) 1145 else if(clock_settings.clock == DIGITAL)
1146 { 1146 {
1147 draw_smallsegment(count_h/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(8), 1147 draw_smallsegment(count_h/10, SMALLSEG_WIDTH*0+SMALLSEG_XOFS(8),
1148 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET); 1148 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET);
@@ -1161,7 +1161,7 @@ void show_counter(void)
1161 draw_smallsegment(count_s%10, SMALLSEG_WIDTH*7+SMALLSEG_XOFS(8), 1161 draw_smallsegment(count_s%10, SMALLSEG_WIDTH*7+SMALLSEG_XOFS(8),
1162 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET); 1162 LCD_HEIGHT-SMALLSEG_HEIGHT*LCD_OFFSET);
1163 } 1163 }
1164 else if(settings.clock == FULLSCREEN) 1164 else if(clock_settings.clock == FULLSCREEN)
1165 { 1165 {
1166 1166
1167 draw_smalldigit(count_h/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(8), 1167 draw_smalldigit(count_h/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(8),
@@ -1181,7 +1181,7 @@ void show_counter(void)
1181 draw_smalldigit(count_s%10, SMALLDIGIT_WIDTH*7+SMALLDIGIT_XOFS(8), 1181 draw_smalldigit(count_s%10, SMALLDIGIT_WIDTH*7+SMALLDIGIT_XOFS(8),
1182 LCD_HEIGHT-SMALLDIGIT_HEIGHT*1.5); 1182 LCD_HEIGHT-SMALLDIGIT_HEIGHT*1.5);
1183 } 1183 }
1184 else if(settings.clock == PLAIN) 1184 else if(clock_settings.clock == PLAIN)
1185 { 1185 {
1186 draw_smalldigit(count_h/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(8), 1186 draw_smalldigit(count_h/10, SMALLDIGIT_WIDTH*0+SMALLDIGIT_XOFS(8),
1187 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET); 1187 LCD_HEIGHT-SMALLDIGIT_HEIGHT*LCD_OFFSET);
@@ -1210,7 +1210,7 @@ void show_counter(void)
1210 **************/ 1210 **************/
1211bool menu_mode_selector(void) 1211bool menu_mode_selector(void)
1212{ 1212{
1213 int selection=settings.clock-1; 1213 int selection=clock_settings.clock-1;
1214 1214
1215 set_standard_colors(); 1215 set_standard_colors();
1216 1216
@@ -1220,7 +1220,7 @@ bool menu_mode_selector(void)
1220 /* check for this, so if the user exits the menu without 1220 /* check for this, so if the user exits the menu without
1221 * making a selection, it won't change to some weird value. */ 1221 * making a selection, it won't change to some weird value. */
1222 if(rb->do_menu(&menu, &selection) >=0){ 1222 if(rb->do_menu(&menu, &selection) >=0){
1223 settings.clock = selection+1; 1223 clock_settings.clock = selection+1;
1224 return(true); 1224 return(true);
1225 } 1225 }
1226 return(false); 1226 return(false);
@@ -1242,15 +1242,15 @@ void menu_analog_settings(void)
1242 switch(result) 1242 switch(result)
1243 { 1243 {
1244 case 0: 1244 case 0:
1245 rb->set_option("Show Date", &settings.analog[analog_date], 1245 rb->set_option("Show Date", &clock_settings.analog[analog_date],
1246 INT, date_format_text, 3, NULL); 1246 INT, date_format_text, 3, NULL);
1247 break; 1247 break;
1248 case 1: 1248 case 1:
1249 rb->set_option("Show Second Hand", &settings.analog[analog_secondhand], 1249 rb->set_option("Show Second Hand", &clock_settings.analog[analog_secondhand],
1250 INT, noyes_text, 2, NULL); 1250 INT, noyes_text, 2, NULL);
1251 break; 1251 break;
1252 case 2: 1252 case 2:
1253 rb->set_option("Show Time", &settings.analog[analog_time], 1253 rb->set_option("Show Time", &clock_settings.analog[analog_time],
1254 INT, analog_time_text, 3, NULL); 1254 INT, analog_time_text, 3, NULL);
1255 break; 1255 break;
1256 } 1256 }
@@ -1273,19 +1273,19 @@ void menu_digital_settings(void)
1273 switch(result) 1273 switch(result)
1274 { 1274 {
1275 case 0: 1275 case 0:
1276 rb->set_option("Show Date", &settings.digital[digital_date], 1276 rb->set_option("Show Date", &clock_settings.digital[digital_date],
1277 INT, date_format_text, 3, NULL); 1277 INT, date_format_text, 3, NULL);
1278 break; 1278 break;
1279 case 1: 1279 case 1:
1280 rb->set_option("Show Seconds", &settings.digital[digital_seconds], 1280 rb->set_option("Show Seconds", &clock_settings.digital[digital_seconds],
1281 INT, noyes_text, 2, NULL); 1281 INT, noyes_text, 2, NULL);
1282 break; 1282 break;
1283 case 2: 1283 case 2:
1284 rb->set_option("Blinking Colon", &settings.digital[digital_blinkcolon], 1284 rb->set_option("Blinking Colon", &clock_settings.digital[digital_blinkcolon],
1285 INT, noyes_text, 2, NULL); 1285 INT, noyes_text, 2, NULL);
1286 break; 1286 break;
1287 case 3: 1287 case 3:
1288 rb->set_option("Time Format", &settings.digital[digital_format], 1288 rb->set_option("Time Format", &clock_settings.digital[digital_format],
1289 INT, time_format_text, 2, NULL); 1289 INT, time_format_text, 2, NULL);
1290 break; 1290 break;
1291 } 1291 }
@@ -1308,11 +1308,11 @@ void menu_fullscreen_settings(void)
1308 switch(result) 1308 switch(result)
1309 { 1309 {
1310 case 0: 1310 case 0:
1311 rb->set_option("Show Border", &settings.fullscreen[fullscreen_border], 1311 rb->set_option("Show Border", &clock_settings.fullscreen[fullscreen_border],
1312 INT, noyes_text, 2, NULL); 1312 INT, noyes_text, 2, NULL);
1313 break; 1313 break;
1314 case 1: 1314 case 1:
1315 rb->set_option("Show Second Hand", &settings.fullscreen[fullscreen_secondhand], 1315 rb->set_option("Show Second Hand", &clock_settings.fullscreen[fullscreen_secondhand],
1316 INT, noyes_text, 2, NULL); 1316 INT, noyes_text, 2, NULL);
1317 break; 1317 break;
1318 } 1318 }
@@ -1334,7 +1334,7 @@ void menu_binary_settings(void)
1334 switch(result) 1334 switch(result)
1335 { 1335 {
1336 case 0: 1336 case 0:
1337 rb->set_option("Display Mode", &settings.binary[binary_mode], 1337 rb->set_option("Display Mode", &clock_settings.binary[binary_mode],
1338 INT, binary_mode_text, 2, NULL); 1338 INT, binary_mode_text, 2, NULL);
1339 } 1339 }
1340 1340
@@ -1357,19 +1357,19 @@ void menu_plain_settings(void)
1357 switch(result) 1357 switch(result)
1358 { 1358 {
1359 case 0: 1359 case 0:
1360 rb->set_option("Show Date", &settings.plain[plain_date], 1360 rb->set_option("Show Date", &clock_settings.plain[plain_date],
1361 INT, date_format_text, 3, NULL); 1361 INT, date_format_text, 3, NULL);
1362 break; 1362 break;
1363 case 1: 1363 case 1:
1364 rb->set_option("Show Seconds", &settings.plain[plain_seconds], 1364 rb->set_option("Show Seconds", &clock_settings.plain[plain_seconds],
1365 INT, noyes_text, 2, NULL); 1365 INT, noyes_text, 2, NULL);
1366 break; 1366 break;
1367 case 2: 1367 case 2:
1368 rb->set_option("Blinking Colon", &settings.plain[plain_blinkcolon], 1368 rb->set_option("Blinking Colon", &clock_settings.plain[plain_blinkcolon],
1369 INT, noyes_text, 2, NULL); 1369 INT, noyes_text, 2, NULL);
1370 break; 1370 break;
1371 case 3: 1371 case 3:
1372 rb->set_option("Time Format", &settings.plain[plain_format], 1372 rb->set_option("Time Format", &clock_settings.plain[plain_format],
1373 INT, time_format_text, 2, NULL); 1373 INT, time_format_text, 2, NULL);
1374 break; 1374 break;
1375 } 1375 }
@@ -1420,21 +1420,21 @@ void menu_general_settings(void)
1420 break; 1420 break;
1421 1421
1422 case 2: 1422 case 2:
1423 rb->set_option("Save On Exit", &settings.general[general_savesetting], 1423 rb->set_option("Save On Exit", &clock_settings.general[general_savesetting],
1424 INT, noyes_text, 2, NULL); 1424 INT, noyes_text, 2, NULL);
1425 1425
1426 /* if we no longer save on exit, we better save now to remember that */ 1426 /* if we no longer save on exit, we better save now to remember that */
1427 if(settings.general[general_savesetting] == 0) 1427 if(clock_settings.general[general_savesetting] == 0)
1428 save_settings(false); 1428 save_settings(false);
1429 break; 1429 break;
1430 1430
1431 case 3: 1431 case 3:
1432 rb->set_option("Show Counter", &settings.general[general_counter], 1432 rb->set_option("Show Counter", &clock_settings.general[general_counter],
1433 INT, noyes_text, 2, NULL); 1433 INT, noyes_text, 2, NULL);
1434 break; 1434 break;
1435 1435
1436 case 4: 1436 case 4:
1437 rb->set_option("Backlight Settings", &settings.general[general_backlight], 1437 rb->set_option("Backlight Settings", &clock_settings.general[general_backlight],
1438 INT, backlight_settings_text, 3, NULL); 1438 INT, backlight_settings_text, 3, NULL);
1439 break; 1439 break;
1440 1440
@@ -1474,7 +1474,7 @@ void main_menu(void)
1474 break; 1474 break;
1475 1475
1476 case 2: 1476 case 2:
1477 switch(settings.clock) 1477 switch(clock_settings.clock)
1478 { 1478 {
1479 case ANALOG: menu_analog_settings();break; 1479 case ANALOG: menu_analog_settings();break;
1480 case DIGITAL: menu_digital_settings();break; 1480 case DIGITAL: menu_digital_settings();break;
@@ -1557,26 +1557,26 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1557 rb->lcd_clear_display(); 1557 rb->lcd_clear_display();
1558 1558
1559 /* Analog mode */ 1559 /* Analog mode */
1560 if(settings.clock == ANALOG) 1560 if(clock_settings.clock == ANALOG)
1561 analog_clock(hour, minute, second); 1561 analog_clock(hour, minute, second);
1562 /* Digital mode */ 1562 /* Digital mode */
1563 else if(settings.clock == DIGITAL) 1563 else if(clock_settings.clock == DIGITAL)
1564 { 1564 {
1565 if(settings.digital[digital_blinkcolon]) 1565 if(clock_settings.digital[digital_blinkcolon])
1566 digital_clock(hour, minute, second, second & 1); 1566 digital_clock(hour, minute, second, second & 1);
1567 else 1567 else
1568 digital_clock(hour, minute, second, true); 1568 digital_clock(hour, minute, second, true);
1569 } 1569 }
1570 /* Fullscreen mode */ 1570 /* Fullscreen mode */
1571 else if(settings.clock == FULLSCREEN) 1571 else if(clock_settings.clock == FULLSCREEN)
1572 fullscreen_clock(hour, minute, second); 1572 fullscreen_clock(hour, minute, second);
1573 /* Binary mode */ 1573 /* Binary mode */
1574 else if(settings.clock == BINARY) 1574 else if(clock_settings.clock == BINARY)
1575 binary_clock(hour, minute, second); 1575 binary_clock(hour, minute, second);
1576 /* Plain mode */ 1576 /* Plain mode */
1577 else if(settings.clock == PLAIN) 1577 else if(clock_settings.clock == PLAIN)
1578 { 1578 {
1579 if(settings.plain[plain_blinkcolon]) 1579 if(clock_settings.plain[plain_blinkcolon])
1580 plain_clock(hour, minute, second, second & 1); 1580 plain_clock(hour, minute, second, second & 1);
1581 else 1581 else
1582 plain_clock(hour, minute, second, true); 1582 plain_clock(hour, minute, second, true);
@@ -1586,9 +1586,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1586 show_counter(); 1586 show_counter();
1587 } 1587 }
1588 1588
1589 if(settings.analog[analog_time] == 2 && temphour == 0) 1589 if(clock_settings.analog[analog_time] == 2 && temphour == 0)
1590 temphour = 12; 1590 temphour = 12;
1591 if(settings.analog[analog_time] == 2 && temphour > 12) 1591 if(clock_settings.analog[analog_time] == 2 && temphour > 12)
1592 temphour -= 12; 1592 temphour -= 12;
1593 1593
1594 /* all the "extras" - readouts/displays */ 1594 /* all the "extras" - readouts/displays */
@@ -1606,7 +1606,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1606 switch (button) 1606 switch (button)
1607 { 1607 {
1608 case ACTION_COUNTER_TOGGLE: /* start/stop counter */ 1608 case ACTION_COUNTER_TOGGLE: /* start/stop counter */
1609 if(settings.general[general_counter]) 1609 if(clock_settings.general[general_counter])
1610 { 1610 {
1611 if(!counter_btn_held) /* Ignore if the counter was reset */ 1611 if(!counter_btn_held) /* Ignore if the counter was reset */
1612 { 1612 {
@@ -1626,7 +1626,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1626 break; 1626 break;
1627 1627
1628 case ACTION_COUNTER_RESET: /* reset counter */ 1628 case ACTION_COUNTER_RESET: /* reset counter */
1629 if(settings.general[general_counter]) 1629 if(clock_settings.general[general_counter])
1630 { 1630 {
1631 counter_btn_held = true; /* Ignore the release event */ 1631 counter_btn_held = true; /* Ignore the release event */
1632 counter = 0; 1632 counter = 0;
@@ -1635,19 +1635,19 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1635 break; 1635 break;
1636 1636
1637 case ACTION_MODE_NEXT: 1637 case ACTION_MODE_NEXT:
1638 if(settings.clock < CLOCK_MODES) 1638 if(clock_settings.clock < CLOCK_MODES)
1639 settings.clock++; 1639 clock_settings.clock++;
1640 else 1640 else
1641 settings.clock = 1; 1641 clock_settings.clock = 1;
1642 1642
1643 set_digital_colors(); 1643 set_digital_colors();
1644 break; 1644 break;
1645 1645
1646 case ACTION_MODE_PREV: 1646 case ACTION_MODE_PREV:
1647 if(settings.clock > 1) 1647 if(clock_settings.clock > 1)
1648 settings.clock--; 1648 clock_settings.clock--;
1649 else 1649 else
1650 settings.clock = CLOCK_MODES; 1650 clock_settings.clock = CLOCK_MODES;
1651 1651
1652 set_digital_colors(); 1652 set_digital_colors();
1653 break; 1653 break;
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 308ff74d83..ba64932d84 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -188,16 +188,16 @@ struct saved_settings {
188 bool digital_minimeters; 188 bool digital_minimeters;
189 int analog_decay; 189 int analog_decay;
190 int digital_decay; 190 int digital_decay;
191} settings; 191} vumeter_settings;
192 192
193void reset_settings(void) { 193void reset_settings(void) {
194 settings.meter_type=ANALOG; 194 vumeter_settings.meter_type=ANALOG;
195 settings.analog_use_db_scale=true; 195 vumeter_settings.analog_use_db_scale=true;
196 settings.digital_use_db_scale=true; 196 vumeter_settings.digital_use_db_scale=true;
197 settings.analog_minimeters=true; 197 vumeter_settings.analog_minimeters=true;
198 settings.digital_minimeters=false; 198 vumeter_settings.digital_minimeters=false;
199 settings.analog_decay=3; 199 vumeter_settings.analog_decay=3;
200 settings.digital_decay=0; 200 vumeter_settings.digital_decay=0;
201} 201}
202 202
203/* taken from http://www.quinapalus.com/efunc.html */ 203/* taken from http://www.quinapalus.com/efunc.html */
@@ -305,7 +305,7 @@ void calc_scales(void)
305void load_settings(void) { 305void load_settings(void) {
306 int fp = rb->open("/.rockbox/rocks/.vu_meter", O_RDONLY); 306 int fp = rb->open("/.rockbox/rocks/.vu_meter", O_RDONLY);
307 if(fp>=0) { 307 if(fp>=0) {
308 rb->read(fp, &settings, sizeof(struct saved_settings)); 308 rb->read(fp, &vumeter_settings, sizeof(struct saved_settings));
309 rb->close(fp); 309 rb->close(fp);
310 } 310 }
311 else { 311 else {
@@ -321,7 +321,7 @@ void load_settings(void) {
321void save_settings(void) { 321void save_settings(void) {
322 int fp = rb->creat("/.rockbox/rocks/.vu_meter"); 322 int fp = rb->creat("/.rockbox/rocks/.vu_meter");
323 if(fp >= 0) { 323 if(fp >= 0) {
324 rb->write (fp, &settings, sizeof(struct saved_settings)); 324 rb->write (fp, &vumeter_settings, sizeof(struct saved_settings));
325 rb->close(fp); 325 rb->close(fp);
326 } 326 }
327} 327}
@@ -372,45 +372,45 @@ static bool vu_meter_menu(void)
372 switch(rb->do_menu(&menu, &selection)) 372 switch(rb->do_menu(&menu, &selection))
373 { 373 {
374 case 0: 374 case 0:
375 rb->set_option("Meter Type", &settings.meter_type, INT, 375 rb->set_option("Meter Type", &vumeter_settings.meter_type, INT,
376 meter_type_option, 2, NULL); 376 meter_type_option, 2, NULL);
377 break; 377 break;
378 378
379 case 1: 379 case 1:
380 if(settings.meter_type==ANALOG) 380 if(vumeter_settings.meter_type==ANALOG)
381 { 381 {
382 rb->set_bool_options("Scale", &settings.analog_use_db_scale, 382 rb->set_bool_options("Scale", &vumeter_settings.analog_use_db_scale,
383 "dBfs", -1, "Linear", -1, NULL); 383 "dBfs", -1, "Linear", -1, NULL);
384 } 384 }
385 else 385 else
386 { 386 {
387 rb->set_bool_options("Scale", &settings.digital_use_db_scale, 387 rb->set_bool_options("Scale", &vumeter_settings.digital_use_db_scale,
388 "dBfs", -1, "Linear", -1, NULL); 388 "dBfs", -1, "Linear", -1, NULL);
389 } 389 }
390 break; 390 break;
391 391
392 case 2: 392 case 2:
393 if(settings.meter_type==ANALOG) 393 if(vumeter_settings.meter_type==ANALOG)
394 { 394 {
395 rb->set_bool("Enable Minimeters", 395 rb->set_bool("Enable Minimeters",
396 &settings.analog_minimeters); 396 &vumeter_settings.analog_minimeters);
397 } 397 }
398 else 398 else
399 { 399 {
400 rb->set_bool("Enable Minimeters", 400 rb->set_bool("Enable Minimeters",
401 &settings.digital_minimeters); 401 &vumeter_settings.digital_minimeters);
402 } 402 }
403 break; 403 break;
404 404
405 case 3: 405 case 3:
406 if(settings.meter_type==ANALOG) 406 if(vumeter_settings.meter_type==ANALOG)
407 { 407 {
408 rb->set_option("Decay Speed", &settings.analog_decay, INT, 408 rb->set_option("Decay Speed", &vumeter_settings.analog_decay, INT,
409 decay_speed_option, 7, NULL); 409 decay_speed_option, 7, NULL);
410 } 410 }
411 else 411 else
412 { 412 {
413 rb->set_option("Decay Speed", &settings.digital_decay, INT, 413 rb->set_option("Decay Speed", &vumeter_settings.digital_decay, INT,
414 decay_speed_option, 7, NULL); 414 decay_speed_option, 7, NULL);
415 } 415 }
416 break; 416 break;
@@ -490,7 +490,7 @@ void analog_meter(void) {
490 rb->pcm_calculate_peaks(&left_peak, &right_peak); 490 rb->pcm_calculate_peaks(&left_peak, &right_peak);
491#endif 491#endif
492 492
493 if(settings.analog_use_db_scale) { 493 if(vumeter_settings.analog_use_db_scale) {
494 left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK]; 494 left_needle_top_x = analog_db_scale[left_peak * half_width / MAX_PEAK];
495 right_needle_top_x = analog_db_scale[right_peak * half_width / MAX_PEAK] + half_width; 495 right_needle_top_x = analog_db_scale[right_peak * half_width / MAX_PEAK] + half_width;
496 } 496 }
@@ -500,8 +500,10 @@ void analog_meter(void) {
500 } 500 }
501 501
502 /* Makes a decay on the needle */ 502 /* Makes a decay on the needle */
503 left_needle_top_x = (left_needle_top_x+last_left_needle_top_x*settings.analog_decay)/(settings.analog_decay+1); 503 left_needle_top_x = (left_needle_top_x+last_left_needle_top_x*vumeter_settings.analog_decay)
504 right_needle_top_x = (right_needle_top_x+last_right_needle_top_x*settings.analog_decay)/(settings.analog_decay+1); 504 /(vumeter_settings.analog_decay+1);
505 right_needle_top_x = (right_needle_top_x+last_right_needle_top_x*vumeter_settings.analog_decay)
506 /(vumeter_settings.analog_decay+1);
505 507
506 last_left_needle_top_x = left_needle_top_x; 508 last_left_needle_top_x = left_needle_top_x;
507 last_right_needle_top_x = right_needle_top_x; 509 last_right_needle_top_x = right_needle_top_x;
@@ -513,7 +515,7 @@ void analog_meter(void) {
513 rb->lcd_drawline(quarter_width, LCD_HEIGHT-1, left_needle_top_x, left_needle_top_y); 515 rb->lcd_drawline(quarter_width, LCD_HEIGHT-1, left_needle_top_x, left_needle_top_y);
514 rb->lcd_drawline((quarter_width+half_width), LCD_HEIGHT-1, right_needle_top_x, right_needle_top_y); 516 rb->lcd_drawline((quarter_width+half_width), LCD_HEIGHT-1, right_needle_top_x, right_needle_top_y);
515 517
516 if(settings.analog_minimeters) 518 if(vumeter_settings.analog_minimeters)
517 draw_analog_minimeters(); 519 draw_analog_minimeters();
518 520
519 /* Needle covers */ 521 /* Needle covers */
@@ -545,7 +547,7 @@ void digital_meter(void) {
545 rb->pcm_calculate_peaks(&left_peak, &right_peak); 547 rb->pcm_calculate_peaks(&left_peak, &right_peak);
546#endif 548#endif
547 549
548 if(settings.digital_use_db_scale) { 550 if(vumeter_settings.digital_use_db_scale) {
549 num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK]; 551 num_left_leds = digital_db_scale[left_peak * 44 / MAX_PEAK];
550 num_right_leds = digital_db_scale[right_peak * 44 / MAX_PEAK]; 552 num_right_leds = digital_db_scale[right_peak * 44 / MAX_PEAK];
551 } 553 }
@@ -554,8 +556,10 @@ void digital_meter(void) {
554 num_right_leds = right_peak * 11 / MAX_PEAK; 556 num_right_leds = right_peak * 11 / MAX_PEAK;
555 } 557 }
556 558
557 num_left_leds = (num_left_leds+last_num_left_leds*settings.digital_decay)/(settings.digital_decay+1); 559 num_left_leds = (num_left_leds+last_num_left_leds*vumeter_settings.digital_decay)
558 num_right_leds = (num_right_leds+last_num_right_leds*settings.digital_decay)/(settings.digital_decay+1); 560 /(vumeter_settings.digital_decay+1);
561 num_right_leds = (num_right_leds+last_num_right_leds*vumeter_settings.digital_decay)
562 /(vumeter_settings.digital_decay+1);
559 563
560 last_num_left_leds = num_left_leds; 564 last_num_left_leds = num_left_leds;
561 last_num_right_leds = num_right_leds; 565 last_num_right_leds = num_right_leds;
@@ -573,7 +577,7 @@ void digital_meter(void) {
573 577
574 rb->lcd_set_drawmode(DRMODE_SOLID); 578 rb->lcd_set_drawmode(DRMODE_SOLID);
575 579
576 if(settings.digital_minimeters) 580 if(vumeter_settings.digital_minimeters)
577 draw_digital_minimeters(); 581 draw_digital_minimeters();
578 582
579 /* Lines above/below where the LEDS are */ 583 /* Lines above/below where the LEDS are */
@@ -609,7 +613,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
609 613
610 rb->lcd_putsxy(half_width-23, 0, "VU Meter"); 614 rb->lcd_putsxy(half_width-23, 0, "VU Meter");
611 615
612 if(settings.meter_type==ANALOG) 616 if(vumeter_settings.meter_type==ANALOG)
613 analog_meter(); 617 analog_meter();
614 else 618 else
615 digital_meter(); 619 digital_meter();