summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-03-22 09:31:45 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-03-22 09:31:45 +0000
commit98881fd8225b24cbcab69d18062e2b7918c5de51 (patch)
tree4047caf5e473ce9117aeb1e8c67ac5fcfd72e5f5
parentd3c796d20e4bd8e15f18a0dac2e9c4283df5740b (diff)
downloadrockbox-98881fd8225b24cbcab69d18062e2b7918c5de51.tar.gz
rockbox-98881fd8225b24cbcab69d18062e2b7918c5de51.zip
Add some playback controls to the SBS. 2 new touch regions wps_next/wps_prev needed to make it work. 'next' in the sbs changes list selection, 'wps_next' in sbs changes audio tracks. no difference in the wps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29631 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/skin_engine/skin_parser.c1
-rw-r--r--apps/gui/skin_engine/skin_touchsupport.c53
-rw-r--r--apps/gui/wps.c47
-rw-r--r--apps/gui/wps.h1
-rw-r--r--manual/appendix/wps_tags.tex6
5 files changed, 85 insertions, 23 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index c09bed6e4f..236c6feea1 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -965,6 +965,7 @@ static const struct touchaction touchactions[] = {
965 {"setting_set", ACTION_SETTINGS_SET}, 965 {"setting_set", ACTION_SETTINGS_SET},
966 966
967 /* WPS specific actions */ 967 /* WPS specific actions */
968 {"wps_prev", ACTION_WPS_SKIPPREV }, {"wps_next", ACTION_WPS_SKIPNEXT },
968 {"browse", ACTION_WPS_BROWSE }, 969 {"browse", ACTION_WPS_BROWSE },
969 {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, 970 {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP },
970 {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }, 971 {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE },
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c
index 110e97f997..c16d223af3 100644
--- a/apps/gui/skin_engine/skin_touchsupport.c
+++ b/apps/gui/skin_engine/skin_touchsupport.c
@@ -28,7 +28,10 @@
28#include "option_select.h" 28#include "option_select.h"
29#include "sound.h" 29#include "sound.h"
30#include "settings_list.h" 30#include "settings_list.h"
31 31#include "wps.h"
32#include "lang.h"
33#include "splash.h"
34#include "playlist.h"
32 35
33/** Disarms all touchregions. */ 36/** Disarms all touchregions. */
34void skin_disarm_touchregions(struct wps_data *data) 37void skin_disarm_touchregions(struct wps_data *data)
@@ -125,8 +128,56 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
125 128
126 if (returncode != ACTION_NONE) 129 if (returncode != ACTION_NONE)
127 { 130 {
131 if (global_settings.party_mode)
132 {
133 switch (returncode)
134 {
135 case ACTION_WPS_PLAY:
136 case ACTION_WPS_SKIPPREV:
137 case ACTION_WPS_SKIPNEXT:
138 case ACTION_WPS_STOP:
139 returncode = ACTION_NONE;
140 break;
141 default:
142 break;
143 }
144 }
128 switch (returncode) 145 switch (returncode)
129 { 146 {
147 case ACTION_WPS_PLAY:
148 if (!audio_status())
149 {
150 if ( global_status.resume_index != -1 )
151 {
152 if (playlist_resume() != -1)
153 {
154 playlist_start(global_status.resume_index,
155 global_status.resume_offset);
156 }
157 }
158 else
159 {
160 splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
161 }
162 }
163 else
164 {
165 wps_do_playpause(false);
166 }
167 returncode = ACTION_REDRAW;
168 break;
169 case ACTION_WPS_SKIPPREV:
170 audio_prev();
171 returncode = ACTION_REDRAW;
172 break;
173 case ACTION_WPS_SKIPNEXT:
174 audio_next();
175 returncode = ACTION_REDRAW;
176 break;
177 case ACTION_WPS_STOP:
178 audio_stop();
179 returncode = ACTION_REDRAW;
180 break;
130 case ACTION_SETTINGS_INC: 181 case ACTION_SETTINGS_INC:
131 case ACTION_SETTINGS_DEC: 182 case ACTION_SETTINGS_DEC:
132 { 183 {
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index a522a08101..473f0a4d75 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -657,6 +657,32 @@ static void gwps_enter_wps(void)
657 send_event(GUI_EVENT_ACTIONUPDATE, (void*)1); 657 send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
658} 658}
659 659
660void wps_do_playpause(bool updatewps)
661{
662 struct wps_state *state = skin_get_global_state();
663 if ( state->paused )
664 {
665 state->paused = false;
666 if ( global_settings.fade_on_stop )
667 fade(true, updatewps);
668 else
669 audio_resume();
670 }
671 else
672 {
673 state->paused = true;
674 if ( global_settings.fade_on_stop )
675 fade(false, updatewps);
676 else
677 audio_pause();
678 settings_save();
679#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
680 call_storage_idle_notifys(true); /* make sure resume info is saved */
681#endif
682 }
683}
684
685
660/* The WPS can be left in two ways: 686/* The WPS can be left in two ways:
661 * a) call a function, which draws over the wps. In this case, the wps 687 * a) call a function, which draws over the wps. In this case, the wps
662 * will be still active (i.e. the below function didn't return) 688 * will be still active (i.e. the below function didn't return)
@@ -783,26 +809,7 @@ long gui_wps_show(void)
783 case ACTION_WPS_PLAY: 809 case ACTION_WPS_PLAY:
784 if (global_settings.party_mode) 810 if (global_settings.party_mode)
785 break; 811 break;
786 if ( state->paused ) 812 wps_do_playpause(true);
787 {
788 state->paused = false;
789 if ( global_settings.fade_on_stop )
790 fade(true, true);
791 else
792 audio_resume();
793 }
794 else
795 {
796 state->paused = true;
797 if ( global_settings.fade_on_stop )
798 fade(false, true);
799 else
800 audio_pause();
801 settings_save();
802#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
803 call_storage_idle_notifys(true); /* make sure resume info is saved */
804#endif
805 }
806 break; 813 break;
807 814
808 case ACTION_WPS_VOLUP: 815 case ACTION_WPS_VOLUP:
diff --git a/apps/gui/wps.h b/apps/gui/wps.h
index 50fb891a14..7438f1ac7b 100644
--- a/apps/gui/wps.h
+++ b/apps/gui/wps.h
@@ -35,6 +35,7 @@ void fade(bool fade_in, bool updatewps);
35 35
36bool ffwd_rew(int button); 36bool ffwd_rew(int button);
37void display_keylock_text(bool locked); 37void display_keylock_text(bool locked);
38void wps_do_playpause(bool updatewps);
38 39
39#ifdef IPOD_ACCESSORY_PROTOCOL 40#ifdef IPOD_ACCESSORY_PROTOCOL
40/* whether the wps is fading the volume due to pausing/stopping */ 41/* whether the wps is fading the volume due to pausing/stopping */
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index c4e96a29e3..46bf4a3967 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -607,8 +607,10 @@ display cycling round the defined sublines. See
607 \begin{description} 607 \begin{description}
608 \item[play] -- Play/pause playback. 608 \item[play] -- Play/pause playback.
609 \item[stop] -- Stop playback and exit the WPS. 609 \item[stop] -- Stop playback and exit the WPS.
610 \item[prev] -- Previous track. 610 \item[prev] -- Previous track/item.
611 \item[next] -- Next track. 611 \item[next] -- Next track/item.
612 \item[wps_prev] -- Previous track.
613 \item[wps_next] -- Next track.
612 \item[ffwd] -- Seek forwards in the track. 614 \item[ffwd] -- Seek forwards in the track.
613 \item[rwd] -- Seek backwards in the track. 615 \item[rwd] -- Seek backwards in the track.
614 \item[menu] -- Go to the main menu. 616 \item[menu] -- Go to the main menu.