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.

Touchscreen: adjust calculation of bar touch position

Increased the precision of the bar from 100 steps to 1000 steps so
it is possible to make finer adjustments, and made it possible to
pick the maximum value in a bar rather than just the maximum - 1.

Change-Id: I2e694d3e86e4a151e014da1bd15ab3ade4c4b95e

+17 -8
+15 -6
apps/gui/skin_engine/skin_touchsupport.c
··· 109 109 { 110 110 struct progressbar *bar = 111 111 SKINOFFSETTOPTR(skin_buffer, r->bar); 112 - if(r->width > r->height) 113 - *edge_offset = vx*100/r->width; 114 - else /* vertical bars are bottom-up by default */ 115 - *edge_offset = 100 - vy*100/r->height; 112 + if(r->width > r->height) { 113 + if(r->width > 1) 114 + *edge_offset = vx*1000/(r->width - 1); 115 + else 116 + *edge_offset = 0; 117 + } else { 118 + /* vertical bars are bottom-up by default */ 119 + if(r->height > 1) 120 + *edge_offset = 1000 - vy*1000/(r->height - 1); 121 + else 122 + *edge_offset = 0; 123 + } 124 + 116 125 if (r->reverse_bar || (bar && bar->invert_fill_direction)) 117 - *edge_offset = 100 - *edge_offset; 126 + *edge_offset = 1000 - *edge_offset; 118 127 } 119 128 temp = r; 120 129 returncode = r->action; ··· 294 303 { 295 304 int val, count; 296 305 get_setting_info_for_bar(bar->setting_id, &count, &val); 297 - val = *edge_offset * count / 100; 306 + val = *edge_offset * count / 1000; 298 307 update_setting_value_from_touch(bar->setting_id, val); 299 308 } 300 309 }
+2 -2
apps/gui/wps.c
··· 182 182 return ACTION_WPS_HOTKEY; 183 183 #endif 184 184 case ACTION_TOUCH_SCROLLBAR: 185 - skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100; 185 + skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/1000; 186 186 audio_pre_ff_rewind(); 187 187 audio_ff_rewind(skin_get_global_state()->id3->elapsed); 188 188 return ACTION_TOUCHSCREEN; ··· 191 191 const int min_vol = sound_min(SOUND_VOLUME); 192 192 const int max_vol = sound_max(SOUND_VOLUME); 193 193 const int step_vol = sound_steps(SOUND_VOLUME); 194 - global_settings.volume = (offset * (max_vol - min_vol)) / 100; 194 + global_settings.volume = (offset * (max_vol - min_vol)) / 1000; 195 195 global_settings.volume += min_vol; 196 196 global_settings.volume -= (global_settings.volume % step_vol); 197 197 setvol();