summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_parser.c1
-rw-r--r--apps/gui/skin_engine/skin_tokens.c46
-rw-r--r--apps/gui/skin_engine/skin_tokens.h1
-rw-r--r--apps/root_menu.c9
-rw-r--r--apps/root_menu.h2
5 files changed, 58 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index dbbdc32730..016126bffb 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -354,6 +354,7 @@ static const struct wps_tag all_tags[] = {
parse_setting_and_lang },
{ WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout },
+ { WPS_TOKEN_CURRENT_SCREEN, "cs", WPS_REFRESH_DYNAMIC, NULL },
{ WPS_NO_TOKEN, "T", 0, parse_touchregion },
{ WPS_TOKEN_UNKNOWN, "", 0, NULL }
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 2df087bb70..ac37c6dd3e 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -56,6 +56,10 @@
#include "wps_internals.h"
#include "wps.h"
+#include "root_menu.h"
+#ifdef HAVE_RECORDING
+#include "recording.h"
+#endif
static char* get_codectype(const struct mp3entry* id3)
{
@@ -482,16 +486,20 @@ const char *get_token_value(struct gui_wps *gwps,
if (status_get_ffmode() == STATUS_FASTBACKWARD)
mode = 5;
}
+#ifdef HAVE_RECORDING
/* recording */
if (status == STATUS_RECORD)
mode = 6;
else if (status == STATUS_RECORD_PAUSE)
mode = 7;
+#endif
+#if CONFIG_TUNER
/* radio */
if (status == STATUS_RADIO)
mode = 8;
else if (status == STATUS_RADIO_PAUSE)
mode = 9;
+#endif
if (intval) {
*intval = mode;
@@ -823,6 +831,44 @@ const char *get_token_value(struct gui_wps *gwps,
cfg_to_string(token->value.i,buf,buf_size);
return buf;
}
+ case WPS_TOKEN_CURRENT_SCREEN:
+ {
+ int curr_screen = current_screen();
+
+#ifdef HAVE_RECORDING
+ /* override current_screen() for recording screen since it may
+ * be entered from the radio screen */
+ if (in_recording_screen())
+ curr_screen = GO_TO_RECSCREEN;
+#endif
+
+ switch (curr_screen)
+ {
+ case GO_TO_WPS:
+ curr_screen = 2;
+ break;
+#ifdef HAVE_RECORDING
+ case GO_TO_RECSCREEN:
+ curr_screen = 3;
+ break;
+#endif
+#if CONFIG_TUNER
+ case GO_TO_FM:
+ curr_screen = 4;
+ break;
+#endif
+ default: /* lists */
+ curr_screen = 1;
+ break;
+ }
+ if (intval)
+ {
+
+ *intval = curr_screen;
+ }
+ snprintf(buf, buf_size, "%d", curr_screen);
+ return buf;
+ }
default:
return NULL;
diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h
index 86425424d9..6d783551e6 100644
--- a/apps/gui/skin_engine/skin_tokens.h
+++ b/apps/gui/skin_engine/skin_tokens.h
@@ -192,6 +192,7 @@ enum wps_token_type {
/* Setting option */
WPS_TOKEN_SETTING,
+ WPS_TOKEN_CURRENT_SCREEN,
};
struct wps_token {
diff --git a/apps/root_menu.c b/apps/root_menu.c
index feff126e03..302e889b60 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -73,6 +73,9 @@ struct root_items {
static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume
or goto current track based on previous
screen */
+
+int next_screen = GO_TO_ROOT;
+
static char current_track_path[MAX_PATH];
static void rootmenu_track_changed_callback(void* param)
{
@@ -504,10 +507,14 @@ void previous_music_is_wps(void)
previous_music = GO_TO_WPS;
}
+int current_screen(void)
+{
+ return next_screen;
+}
+
void root_menu(void)
{
int previous_browser = GO_TO_FILEBROWSER;
- int next_screen = GO_TO_ROOT;
int selected = 0;
if (global_settings.start_in_screen == 0)
diff --git a/apps/root_menu.h b/apps/root_menu.h
index 2ab3aae9e7..584e048a53 100644
--- a/apps/root_menu.h
+++ b/apps/root_menu.h
@@ -58,4 +58,6 @@ extern const struct menu_item_ex root_menu_;
extern void previous_music_is_wps(void);
+extern int current_screen(void);
+
#endif /* __ROOT_MENU_H__ */