diff options
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r-- | apps/root_menu.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index 07bd4939e0..5c4abf6522 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "config.h" | 25 | #include "config.h" |
26 | #include "appevents.h" | ||
26 | #include "menu.h" | 27 | #include "menu.h" |
27 | #include "root_menu.h" | 28 | #include "root_menu.h" |
28 | #include "lang.h" | 29 | #include "lang.h" |
@@ -75,6 +76,12 @@ struct root_items { | |||
75 | static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume | 76 | static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume |
76 | or goto current track based on previous | 77 | or goto current track based on previous |
77 | screen */ | 78 | screen */ |
79 | static char current_track_path[MAX_PATH]; | ||
80 | static void rootmenu_track_changed_callback(void* param) | ||
81 | { | ||
82 | struct mp3entry *id3 = (struct mp3entry *)param; | ||
83 | strncpy(current_track_path, id3->path, MAX_PATH); | ||
84 | } | ||
78 | static int browser(void* param) | 85 | static int browser(void* param) |
79 | { | 86 | { |
80 | int ret_val; | 87 | int ret_val; |
@@ -96,9 +103,9 @@ static int browser(void* param) | |||
96 | filter = global_settings.dirfilter; | 103 | filter = global_settings.dirfilter; |
97 | if (global_settings.browse_current && | 104 | if (global_settings.browse_current && |
98 | last_screen == GO_TO_WPS && | 105 | last_screen == GO_TO_WPS && |
99 | wps_state.current_track_path[0]) | 106 | current_track_path[0]) |
100 | { | 107 | { |
101 | strcpy(folder, wps_state.current_track_path); | 108 | strcpy(folder, current_track_path); |
102 | } | 109 | } |
103 | #ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering | 110 | #ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering |
104 | the browser from the menu when you were in the card | 111 | the browser from the menu when you were in the card |
@@ -506,7 +513,7 @@ void root_menu(void) | |||
506 | if (global_settings.start_in_screen == 0) | 513 | if (global_settings.start_in_screen == 0) |
507 | next_screen = (int)global_status.last_screen; | 514 | next_screen = (int)global_status.last_screen; |
508 | else next_screen = global_settings.start_in_screen - 2; | 515 | else next_screen = global_settings.start_in_screen - 2; |
509 | 516 | add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, rootmenu_track_changed_callback); | |
510 | #ifdef HAVE_RTC_ALARM | 517 | #ifdef HAVE_RTC_ALARM |
511 | if ( rtc_check_alarm_started(true) ) | 518 | if ( rtc_check_alarm_started(true) ) |
512 | { | 519 | { |