Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Peakmeters: use screens[].getwidth() and not screens[].width as the latter one returns the LCD width (which really shouldn't be there) - the former returns the width of the viewport. Do some code police as well.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17841 a1c6a512-1295-4272-9138-f99709370657

+12 -9
+12 -9
apps/recorder/peakmeter.c
··· 916 916 { 917 917 peak_meter_draw(display, &scales[display->screen_type], x, y, 918 918 display->getwidth() - x, height); 919 - } 919 + } 920 920 /** 921 921 * Draws a peak meter in the specified size at the specified position. 922 922 * @param int x - The x coordinate. ··· 952 952 953 953 954 954 if (level_check){ 955 - /* only read the volume info from MAS if peek since last read*/ 955 + /* only read the volume info from MAS if peek since last read*/ 956 956 left_level = peak_meter_read_l(); 957 957 right_level = peak_meter_read_r(); 958 958 level_check = false; ··· 960 960 961 961 /* scale the samples dBfs */ 962 962 left = peak_meter_scale_value(left_level, meterwidth); 963 - right = peak_meter_scale_value(right_level, meterwidth); 963 + right = peak_meter_scale_value(right_level, meterwidth); 964 964 965 965 /*if the scale has changed -> recalculate the scale 966 966 (The scale becomes invalid when the range changed.) */ ··· 972 972 /* find the real x-coords for predefined interesting 973 973 dBfs values. These only are recalculated when the 974 974 scaling of the meter changed. */ 975 - scales->db_scale_lcd_coord[i] = 975 + scales->db_scale_lcd_coord[i] = 976 976 peak_meter_scale_value( 977 - db_scale_src_values[i], 977 + db_scale_src_values[i], 978 978 meterwidth - 1); 979 979 } 980 980 } ··· 983 983 else { 984 984 db_scale_count = 10; 985 985 for (i = 0; i < db_scale_count; i++) { 986 - scales->db_scale_lcd_coord[i] = 986 + scales->db_scale_lcd_coord[i] = 987 987 (i * (MAX_PEAK / 10) - peak_meter_range_min) * 988 988 meterwidth / pm_range; 989 989 } ··· 1111 1111 start_trigx = x+peak_meter_scale_value(trig_strt_threshold,meterwidth); 1112 1112 display->vline(start_trigx, ycenter - 2, ycenter); 1113 1113 start_trigx ++; 1114 - if (start_trigx < display->getwidth() ) display->drawpixel(start_trigx, ycenter - 1); 1114 + if (start_trigx < display->getwidth() ) display->drawpixel(start_trigx, 1115 + ycenter - 1); 1115 1116 1116 1117 stop_trigx = x + peak_meter_scale_value(trig_stp_threshold,meterwidth); 1117 1118 display->vline(stop_trigx, ycenter - 2, ycenter); ··· 1238 1239 return trig_status; /* & TRIG_PIT_MASK;*/ 1239 1240 } 1240 1241 1241 - void peak_meter_draw_trig(int xpos[], int ypos[], int trig_width[], int nb_screens) 1242 + void peak_meter_draw_trig(int xpos[], int ypos[], 1243 + int trig_width[], int nb_screens) 1242 1244 { 1243 1245 int barstart[NB_SCREENS]; 1244 1246 int barend[NB_SCREENS]; ··· 1354 1356 { 1355 1357 peak_meter_screen(&screens[i], x, y[i], height); 1356 1358 screens[i].update_viewport_rect(x, y[i], 1357 - screens[i].width - x, height); 1359 + screens[i].getwidth() - x, 1360 + height); 1358 1361 } 1359 1362 next_refresh += HZ / PEAK_METER_FPS; 1360 1363 dopeek = true;