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.zip
rockbox-98881fd8225b24cbcab69d18062e2b7918c5de51.tar.gz
rockbox-98881fd8225b24cbcab69d18062e2b7918c5de51.tar.bz2
rockbox-98881fd8225b24cbcab69d18062e2b7918c5de51.tar.xz
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 c09bed6..236c6fe 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[] = {
{"setting_set", ACTION_SETTINGS_SET},
/* WPS specific actions */
+ {"wps_prev", ACTION_WPS_SKIPPREV }, {"wps_next", ACTION_WPS_SKIPNEXT },
{"browse", ACTION_WPS_BROWSE },
{"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP },
{"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 110e97f..c16d223 100644
--- a/apps/gui/skin_engine/skin_touchsupport.c
+++ b/apps/gui/skin_engine/skin_touchsupport.c
@@ -28,7 +28,10 @@
#include "option_select.h"
#include "sound.h"
#include "settings_list.h"
-
+#include "wps.h"
+#include "lang.h"
+#include "splash.h"
+#include "playlist.h"
/** Disarms all touchregions. */
void skin_disarm_touchregions(struct wps_data *data)
@@ -125,8 +128,56 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
if (returncode != ACTION_NONE)
{
+ if (global_settings.party_mode)
+ {
+ switch (returncode)
+ {
+ case ACTION_WPS_PLAY:
+ case ACTION_WPS_SKIPPREV:
+ case ACTION_WPS_SKIPNEXT:
+ case ACTION_WPS_STOP:
+ returncode = ACTION_NONE;
+ break;
+ default:
+ break;
+ }
+ }
switch (returncode)
{
+ case ACTION_WPS_PLAY:
+ if (!audio_status())
+ {
+ if ( global_status.resume_index != -1 )
+ {
+ if (playlist_resume() != -1)
+ {
+ playlist_start(global_status.resume_index,
+ global_status.resume_offset);
+ }
+ }
+ else
+ {
+ splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
+ }
+ }
+ else
+ {
+ wps_do_playpause(false);
+ }
+ returncode = ACTION_REDRAW;
+ break;
+ case ACTION_WPS_SKIPPREV:
+ audio_prev();
+ returncode = ACTION_REDRAW;
+ break;
+ case ACTION_WPS_SKIPNEXT:
+ audio_next();
+ returncode = ACTION_REDRAW;
+ break;
+ case ACTION_WPS_STOP:
+ audio_stop();
+ returncode = ACTION_REDRAW;
+ break;
case ACTION_SETTINGS_INC:
case ACTION_SETTINGS_DEC:
{
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index a522a08..473f0a4 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -657,6 +657,32 @@ static void gwps_enter_wps(void)
send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
}
+void wps_do_playpause(bool updatewps)
+{
+ struct wps_state *state = skin_get_global_state();
+ if ( state->paused )
+ {
+ state->paused = false;
+ if ( global_settings.fade_on_stop )
+ fade(true, updatewps);
+ else
+ audio_resume();
+ }
+ else
+ {
+ state->paused = true;
+ if ( global_settings.fade_on_stop )
+ fade(false, updatewps);
+ else
+ audio_pause();
+ settings_save();
+#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
+ call_storage_idle_notifys(true); /* make sure resume info is saved */
+#endif
+ }
+}
+
+
/* The WPS can be left in two ways:
* a) call a function, which draws over the wps. In this case, the wps
* will be still active (i.e. the below function didn't return)
@@ -783,26 +809,7 @@ long gui_wps_show(void)
case ACTION_WPS_PLAY:
if (global_settings.party_mode)
break;
- if ( state->paused )
- {
- state->paused = false;
- if ( global_settings.fade_on_stop )
- fade(true, true);
- else
- audio_resume();
- }
- else
- {
- state->paused = true;
- if ( global_settings.fade_on_stop )
- fade(false, true);
- else
- audio_pause();
- settings_save();
-#if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
- call_storage_idle_notifys(true); /* make sure resume info is saved */
-#endif
- }
+ wps_do_playpause(true);
break;
case ACTION_WPS_VOLUP:
diff --git a/apps/gui/wps.h b/apps/gui/wps.h
index 50fb891..7438f1a 100644
--- a/apps/gui/wps.h
+++ b/apps/gui/wps.h
@@ -35,6 +35,7 @@ void fade(bool fade_in, bool updatewps);
bool ffwd_rew(int button);
void display_keylock_text(bool locked);
+void wps_do_playpause(bool updatewps);
#ifdef IPOD_ACCESSORY_PROTOCOL
/* 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 c4e96a2..46bf4a3 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -607,8 +607,10 @@ display cycling round the defined sublines. See
\begin{description}
\item[play] -- Play/pause playback.
\item[stop] -- Stop playback and exit the WPS.
- \item[prev] -- Previous track.
- \item[next] -- Next track.
+ \item[prev] -- Previous track/item.
+ \item[next] -- Next track/item.
+ \item[wps_prev] -- Previous track.
+ \item[wps_next] -- Next track.
\item[ffwd] -- Seek forwards in the track.
\item[rwd] -- Seek backwards in the track.
\item[menu] -- Go to the main menu.