summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-08-10 03:48:27 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-08-10 03:48:27 +0000
commit1c0aeb18ca264e1f64e31f219189afab442676eb (patch)
treed426174b2e10a6665fe1f4fcb1d546b2c297a597 /apps
parente1a83b9e99b19da665a3e93b279f02f52c0f8b98 (diff)
downloadrockbox-1c0aeb18ca264e1f64e31f219189afab442676eb.tar.gz
rockbox-1c0aeb18ca264e1f64e31f219189afab442676eb.zip
r22135 overwrote mcuelenaere's changes in r22068 to add slider-type regions for the touchscreen... so bring them back (spotted by kkurbjun)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22234 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/wps.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 29c9403235..30c4aa85bb 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -599,15 +599,53 @@ int wps_get_touchaction(struct wps_data *data)
599 if (vx >= r->x && vx < r->x+r->width && 599 if (vx >= r->x && vx < r->x+r->width &&
600 vy >= r->y && vy < r->y+r->height) 600 vy >= r->y && vy < r->y+r->height)
601 { 601 {
602 if ((repeated && r->repeat) || 602 /* reposition the touch within the area */
603 (released && !r->repeat)) 603 vx -= r->x;
604 vy -= r->y;
605
606 switch(r->type)
604 { 607 {
605 last_action = r->action; 608 case WPS_TOUCHREGION_ACTION:
606 return r->action; 609 if ((repeated && r->repeat) || (released && !r->repeat))
607 } 610 {
611 last_action = r->action;
612 return r->action;
613 }
614 break;
615 case WPS_TOUCHREGION_SCROLLBAR:
616 if(r->width > r->height)
617 /* landscape */
618 wps_state.id3->elapsed = (vx *
619 wps_state.id3->length) / r->width;
620 else
621 /* portrait */
622 wps_state.id3->elapsed = (vy *
623 wps_state.id3->length) / r->height;
624
625 audio_ff_rewind(wps_state.id3->elapsed);
626 break;
627 case WPS_TOUCHREGION_VOLUME:
628 {
629 const int min_vol = sound_min(SOUND_VOLUME);
630 const int max_vol = sound_max(SOUND_VOLUME);
631 if(r->width > r->height)
632 /* landscape */
633 global_settings.volume = (vx *
634 (max_vol - min_vol)) / r->width;
635 else
636 /* portrait */
637 global_settings.volume = (vy *
638 (max_vol-min_vol)) / r->height;
639
640 global_settings.volume += min_vol;
641 setvol();
642 break;
643 }
644 }
608 } 645 }
609 } 646 }
610 } 647 }
648
611 if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD)) 649 if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD))
612 return ACTION_WPS_STOPSEEK; 650 return ACTION_WPS_STOPSEEK;
613 last_action = ACTION_TOUCHSCREEN; 651 last_action = ACTION_TOUCHSCREEN;