diff options
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 1 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 46 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.h | 1 | ||||
-rw-r--r-- | apps/root_menu.c | 9 | ||||
-rw-r--r-- | apps/root_menu.h | 2 |
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[] = { | |||
354 | parse_setting_and_lang }, | 354 | parse_setting_and_lang }, |
355 | 355 | ||
356 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, | 356 | { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, |
357 | { WPS_TOKEN_CURRENT_SCREEN, "cs", WPS_REFRESH_DYNAMIC, NULL }, | ||
357 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, | 358 | { WPS_NO_TOKEN, "T", 0, parse_touchregion }, |
358 | 359 | ||
359 | { WPS_TOKEN_UNKNOWN, "", 0, NULL } | 360 | { 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 @@ | |||
56 | 56 | ||
57 | #include "wps_internals.h" | 57 | #include "wps_internals.h" |
58 | #include "wps.h" | 58 | #include "wps.h" |
59 | #include "root_menu.h" | ||
60 | #ifdef HAVE_RECORDING | ||
61 | #include "recording.h" | ||
62 | #endif | ||
59 | 63 | ||
60 | static char* get_codectype(const struct mp3entry* id3) | 64 | static char* get_codectype(const struct mp3entry* id3) |
61 | { | 65 | { |
@@ -482,16 +486,20 @@ const char *get_token_value(struct gui_wps *gwps, | |||
482 | if (status_get_ffmode() == STATUS_FASTBACKWARD) | 486 | if (status_get_ffmode() == STATUS_FASTBACKWARD) |
483 | mode = 5; | 487 | mode = 5; |
484 | } | 488 | } |
489 | #ifdef HAVE_RECORDING | ||
485 | /* recording */ | 490 | /* recording */ |
486 | if (status == STATUS_RECORD) | 491 | if (status == STATUS_RECORD) |
487 | mode = 6; | 492 | mode = 6; |
488 | else if (status == STATUS_RECORD_PAUSE) | 493 | else if (status == STATUS_RECORD_PAUSE) |
489 | mode = 7; | 494 | mode = 7; |
495 | #endif | ||
496 | #if CONFIG_TUNER | ||
490 | /* radio */ | 497 | /* radio */ |
491 | if (status == STATUS_RADIO) | 498 | if (status == STATUS_RADIO) |
492 | mode = 8; | 499 | mode = 8; |
493 | else if (status == STATUS_RADIO_PAUSE) | 500 | else if (status == STATUS_RADIO_PAUSE) |
494 | mode = 9; | 501 | mode = 9; |
502 | #endif | ||
495 | 503 | ||
496 | if (intval) { | 504 | if (intval) { |
497 | *intval = mode; | 505 | *intval = mode; |
@@ -823,6 +831,44 @@ const char *get_token_value(struct gui_wps *gwps, | |||
823 | cfg_to_string(token->value.i,buf,buf_size); | 831 | cfg_to_string(token->value.i,buf,buf_size); |
824 | return buf; | 832 | return buf; |
825 | } | 833 | } |
834 | case WPS_TOKEN_CURRENT_SCREEN: | ||
835 | { | ||
836 | int curr_screen = current_screen(); | ||
837 | |||
838 | #ifdef HAVE_RECORDING | ||
839 | /* override current_screen() for recording screen since it may | ||
840 | * be entered from the radio screen */ | ||
841 | if (in_recording_screen()) | ||
842 | curr_screen = GO_TO_RECSCREEN; | ||
843 | #endif | ||
844 | |||
845 | switch (curr_screen) | ||
846 | { | ||
847 | case GO_TO_WPS: | ||
848 | curr_screen = 2; | ||
849 | break; | ||
850 | #ifdef HAVE_RECORDING | ||
851 | case GO_TO_RECSCREEN: | ||
852 | curr_screen = 3; | ||
853 | break; | ||
854 | #endif | ||
855 | #if CONFIG_TUNER | ||
856 | case GO_TO_FM: | ||
857 | curr_screen = 4; | ||
858 | break; | ||
859 | #endif | ||
860 | default: /* lists */ | ||
861 | curr_screen = 1; | ||
862 | break; | ||
863 | } | ||
864 | if (intval) | ||
865 | { | ||
866 | |||
867 | *intval = curr_screen; | ||
868 | } | ||
869 | snprintf(buf, buf_size, "%d", curr_screen); | ||
870 | return buf; | ||
871 | } | ||
826 | 872 | ||
827 | default: | 873 | default: |
828 | return NULL; | 874 | 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 { | |||
192 | 192 | ||
193 | /* Setting option */ | 193 | /* Setting option */ |
194 | WPS_TOKEN_SETTING, | 194 | WPS_TOKEN_SETTING, |
195 | WPS_TOKEN_CURRENT_SCREEN, | ||
195 | }; | 196 | }; |
196 | 197 | ||
197 | struct wps_token { | 198 | 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 { | |||
73 | static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume | 73 | static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume |
74 | or goto current track based on previous | 74 | or goto current track based on previous |
75 | screen */ | 75 | screen */ |
76 | |||
77 | int next_screen = GO_TO_ROOT; | ||
78 | |||
76 | static char current_track_path[MAX_PATH]; | 79 | static char current_track_path[MAX_PATH]; |
77 | static void rootmenu_track_changed_callback(void* param) | 80 | static void rootmenu_track_changed_callback(void* param) |
78 | { | 81 | { |
@@ -504,10 +507,14 @@ void previous_music_is_wps(void) | |||
504 | previous_music = GO_TO_WPS; | 507 | previous_music = GO_TO_WPS; |
505 | } | 508 | } |
506 | 509 | ||
510 | int current_screen(void) | ||
511 | { | ||
512 | return next_screen; | ||
513 | } | ||
514 | |||
507 | void root_menu(void) | 515 | void root_menu(void) |
508 | { | 516 | { |
509 | int previous_browser = GO_TO_FILEBROWSER; | 517 | int previous_browser = GO_TO_FILEBROWSER; |
510 | int next_screen = GO_TO_ROOT; | ||
511 | int selected = 0; | 518 | int selected = 0; |
512 | 519 | ||
513 | if (global_settings.start_in_screen == 0) | 520 | 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_; | |||
58 | 58 | ||
59 | extern void previous_music_is_wps(void); | 59 | extern void previous_music_is_wps(void); |
60 | 60 | ||
61 | extern int current_screen(void); | ||
62 | |||
61 | #endif /* __ROOT_MENU_H__ */ | 63 | #endif /* __ROOT_MENU_H__ */ |