diff options
Diffstat (limited to 'apps/recorder/peakmeter.c')
-rw-r--r-- | apps/recorder/peakmeter.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 9baa9fdb35..8fffc9500d 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -835,7 +835,8 @@ unsigned short peak_meter_scale_value(unsigned short val, int meterwidth){ | |||
835 | * width > 3 | 835 | * width > 3 |
836 | * @param int height - The height of the peak meter. height > 3 | 836 | * @param int height - The height of the peak meter. height > 3 |
837 | */ | 837 | */ |
838 | void peak_meter_draw(int x, int y, int width, int height) { | 838 | void peak_meter_draw(int x, int y, int width, int height) |
839 | { | ||
839 | int left = 0, right = 0; | 840 | int left = 0, right = 0; |
840 | static int last_left = 0, last_right = 0; | 841 | static int last_left = 0, last_right = 0; |
841 | int meterwidth = width - 3; | 842 | int meterwidth = width - 3; |
@@ -930,7 +931,9 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
930 | } | 931 | } |
931 | 932 | ||
932 | /* draw the peak meter */ | 933 | /* draw the peak meter */ |
933 | lcd_clearrect(x, y, width, height); | 934 | lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
935 | lcd_fillrect(x, y, width, height); | ||
936 | lcd_set_drawmode(DRMODE_SOLID); | ||
934 | 937 | ||
935 | /* draw left */ | 938 | /* draw left */ |
936 | lcd_fillrect (x, y, left, height / 2 - 2 ); | 939 | lcd_fillrect (x, y, left, height / 2 - 2 ); |
@@ -956,17 +959,20 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
956 | lcd_drawline(x + meterwidth, y, | 959 | lcd_drawline(x + meterwidth, y, |
957 | x + meterwidth, y + height - 2); | 960 | x + meterwidth, y + height - 2); |
958 | 961 | ||
962 | lcd_set_drawmode(DRMODE_COMPLEMENT); | ||
959 | /* draw dots for scale marks */ | 963 | /* draw dots for scale marks */ |
960 | for (i = 0; i < db_scale_count; i++) { | 964 | for (i = 0; i < db_scale_count; i++) { |
961 | /* The x-coordinates of interesting scale mark points | 965 | /* The x-coordinates of interesting scale mark points |
962 | have been calculated before */ | 966 | have been calculated before */ |
963 | lcd_invertpixel(db_scale_lcd_coord[i], y + height / 2 - 1); | 967 | lcd_drawpixel(db_scale_lcd_coord[i], y + height / 2 - 1); |
964 | } | 968 | } |
965 | 969 | ||
970 | |||
966 | #ifdef HAVE_RECORDING | 971 | #ifdef HAVE_RECORDING |
967 | if (trig_status != TRIG_OFF) { | 972 | if (trig_status != TRIG_OFF) { |
968 | int start_trigx, stop_trigx, ycenter; | 973 | int start_trigx, stop_trigx, ycenter; |
969 | 974 | ||
975 | lcd_set_drawmode(DRMODE_SOLID); | ||
970 | ycenter = y + height / 2; | 976 | ycenter = y + height / 2; |
971 | /* display threshold value */ | 977 | /* display threshold value */ |
972 | start_trigx = x+peak_meter_scale_value(trig_strt_threshold,meterwidth); | 978 | start_trigx = x+peak_meter_scale_value(trig_strt_threshold,meterwidth); |
@@ -983,7 +989,8 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
983 | #ifdef PM_DEBUG | 989 | #ifdef PM_DEBUG |
984 | /* display a bar to show how many calls to peak_meter_peek | 990 | /* display a bar to show how many calls to peak_meter_peek |
985 | have ocurred since the last display */ | 991 | have ocurred since the last display */ |
986 | lcd_invertrect(x, y, tmp, 3); | 992 | lcd_set_drawmode(DRMODE_COMPLEMENT); |
993 | lcd_fillrect(x, y, tmp, 3); | ||
987 | 994 | ||
988 | if (tmp < PEEKS_PER_DRAW_SIZE) { | 995 | if (tmp < PEEKS_PER_DRAW_SIZE) { |
989 | peeks_per_redraw[tmp]++; | 996 | peeks_per_redraw[tmp]++; |
@@ -996,12 +1003,14 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
996 | 1003 | ||
997 | /* display a bar to show how many ticks have passed since | 1004 | /* display a bar to show how many ticks have passed since |
998 | the last redraw */ | 1005 | the last redraw */ |
999 | lcd_invertrect(x, y + height / 2, current_tick - pm_tick, 2); | 1006 | lcd_fillrect(x, y + height / 2, current_tick - pm_tick, 2); |
1000 | pm_tick = current_tick; | 1007 | pm_tick = current_tick; |
1001 | #endif | 1008 | #endif |
1002 | 1009 | ||
1003 | last_left = left; | 1010 | last_left = left; |
1004 | last_right = right; | 1011 | last_right = right; |
1012 | |||
1013 | lcd_set_drawmode(DRMODE_SOLID); | ||
1005 | } | 1014 | } |
1006 | 1015 | ||
1007 | #ifdef HAVE_RECORDING | 1016 | #ifdef HAVE_RECORDING |