summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-06-16 13:55:35 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-06-22 21:37:02 +0100
commit02860d67c3c2807e3c9fd7d272ce9cc098c052ae (patch)
tree381e1c33279cc09215f585fdad0ac32748f7aca8 /apps/gui/wps.c
parent8a6b2f3abc4ec3d6417cb3dc3a6040c977a6036a (diff)
downloadrockbox-02860d67c3c2807e3c9fd7d272ce9cc098c052ae.tar.gz
rockbox-02860d67c3c2807e3c9fd7d272ce9cc098c052ae.zip
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
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 2c668998f0..35716087c2 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -182,7 +182,7 @@ static int skintouch_to_wps(struct wps_data *data)
182 return ACTION_WPS_HOTKEY; 182 return ACTION_WPS_HOTKEY;
183#endif 183#endif
184 case ACTION_TOUCH_SCROLLBAR: 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 audio_pre_ff_rewind(); 186 audio_pre_ff_rewind();
187 audio_ff_rewind(skin_get_global_state()->id3->elapsed); 187 audio_ff_rewind(skin_get_global_state()->id3->elapsed);
188 return ACTION_TOUCHSCREEN; 188 return ACTION_TOUCHSCREEN;
@@ -191,7 +191,7 @@ static int skintouch_to_wps(struct wps_data *data)
191 const int min_vol = sound_min(SOUND_VOLUME); 191 const int min_vol = sound_min(SOUND_VOLUME);
192 const int max_vol = sound_max(SOUND_VOLUME); 192 const int max_vol = sound_max(SOUND_VOLUME);
193 const int step_vol = sound_steps(SOUND_VOLUME); 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 global_settings.volume += min_vol; 195 global_settings.volume += min_vol;
196 global_settings.volume -= (global_settings.volume % step_vol); 196 global_settings.volume -= (global_settings.volume % step_vol);
197 setvol(); 197 setvol();