A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Resistor plugin: crop the smallest bitmap so it's usable for any small screen and nut just the c200 make the layout a bit more flexible


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

+17 -44
+3 -3
apps/plugins/bitmaps/native/SOURCES
··· 897 897 resistor.176x220x16.bmp 898 898 #elif (LCD_WIDTH >= 160) 899 899 resistor.160x128x16.bmp 900 - #elif (LCD_WIDTH >= 132) 901 - resistor.132x80x16.bmp 902 - #elif (LCD_WIDTH >= 128) 900 + #elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 96) 903 901 resistor.128x128x16.bmp 902 + #else 903 + resistor.68x20x16.bmp 904 904 #endif 905 905 906 906 #endif /* HAVE_LCD_BITMAP */
apps/plugins/bitmaps/native/resistor.132x80x16.bmp

This is a binary file and will not be displayed.

apps/plugins/bitmaps/native/resistor.68x20x16.bmp

This is a binary file and will not be displayed.

+14 -41
apps/plugins/resistor.c
··· 13 13 /* Defining player-specific constants */ 14 14 15 15 #if defined(HAVE_LCD_COLOR) 16 - #define RESISTOR_BMP_X 0 17 - /* The BMPs are now the exact width of the screen */ 16 + #define RESISTOR_BMP_X ((LCD_WIDTH - BMPWIDTH_resistor) / 2) 18 17 19 18 #if LCD_WIDTH >= 320 && LCD_HEIGHT >= 240 /* iPod video or larger */ 20 19 #define RESISTOR_BMP_Y 3 ··· 37 36 #elif LCD_WIDTH >= 128 && LCD_HEIGHT >= 128 /* GoGear */ 38 37 #define RESISTOR_BMP_Y 3 39 38 40 - #elif LCD_WIDTH >= 132 && LCD_HEIGHT >= 80 /* c200 */ 39 + #else /* Small screens */ 41 40 #define RESISTOR_BMP_Y 0 42 41 /* And along with the tiny screen comes a whole bunch of exceptions */ 43 42 ··· 74 73 75 74 #include "pluginbitmaps/resistor.h" 76 75 77 - #if LCD_WIDTH == 132 && LCD_HEIGHT == 80 78 - /* Proboably not the best solution */ 79 - /* Special for the c200 */ 80 - #define band_width 5 81 - #define band_height 16 82 - 83 - #define first_band_x 50 84 - #define second_band_x 60 85 - #define third_band_x 70 86 - #define fourth_band_x 80 87 - #define universal_y 2 88 - 89 - #else /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */ 90 - /* Everything else */ 91 - 92 76 #define band_width (BMPWIDTH_resistor/15) 93 77 #define band_height (BMPHEIGHT_resistor*9/10) 94 78 ··· 98 82 #define fourth_band_x (3*BMPWIDTH_resistor/4 + RESISTOR_BMP_X - band_width/2) 99 83 #define universal_y (RESISTOR_BMP_Y+(BMPHEIGHT_resistor)/2 - band_height/2) 100 84 101 - #endif /* LCD_WIDTH == 132 && LCD_HEIGHT == 80 */ 85 + #if LCD_WIDTHT <= 128 86 + #define total_resistance_str_x 1 87 + #define tolerance_str_x 1 88 + #define resistance_val_x 1 89 + #define r_to_c_out_str_x 1 90 + #else /* LCD_WIDTHT <= 128 */ 91 + #define total_resistance_str_x (LCD_WIDTH/14) 92 + #define tolerance_str_x (LCD_WIDTH/14) 93 + #define resistance_val_x (LCD_WIDTH/14) 94 + #define r_to_c_out_str_x (LCD_WIDTH/14) 95 + #endif 96 + 102 97 103 98 #if LCD_HEIGHT <= 128 104 - #define total_resistance_str_x 1 105 99 #define total_resistance_str_y (BMPHEIGHT_resistor + RESISTOR_BMP_Y + 3) 106 - 107 - #define tolerance_str_x 1 108 100 #define tolerance_str_y total_resistance_str_y + 20 109 - #define resistance_val_x 1 110 101 #define resistance_val_y total_resistance_str_y + 20 111 - #define r_to_c_out_str_x 1 112 102 #define r_to_c_out_str_y total_resistance_str_y + 30 113 - 114 - #elif LCD_WIDTH == 132 && LCD_HEIGHT == 80 /* Special for the c200 */ 115 - #define total_resistance_str_x 0 116 - #define total_resistance_str_y BMPHEIGHT_resistor + 1 117 - 118 - #define tolerance_str_x 0 119 - #define tolerance_str_y total_resistance_str_y + 8 120 - #define resistance_val_x 0 121 - #define resistance_val_y tolerance_resistance_str_y + 8 122 - #define r_to_c_out_str_x 0 123 - #define r_to_c_out_str_y tolerance_resistance_str_y + 16 124 - 125 103 #else /* LCD_HEIGHT <= 128 */ 126 - #define total_resistance_str_x (LCD_WIDTH/14) 127 104 #define total_resistance_str_y (2*RESISTOR_BMP_Y + BMPHEIGHT_resistor) 128 - 129 - #define tolerance_str_x (LCD_WIDTH/14) 130 105 #define tolerance_str_y (total_resistance_str_y + 15) 131 - #define resistance_val_x (LCD_WIDTH/14) 132 106 #define resistance_val_y (total_resistance_str_y + 15) 133 - #define r_to_c_out_str_x (LCD_WIDTH/14) 134 107 #define r_to_c_out_str_y (total_resistance_str_y + 25) 135 108 /* tolerance_str and resistance_val will never be shown at the same time */ 136 109