summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps.c4
-rw-r--r--apps/gui/gwps.h3
-rw-r--r--apps/root_menu.c13
3 files changed, 10 insertions, 10 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index dd8978c8bb..6c387ef62e 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -688,10 +688,6 @@ long gui_wps_show(void)
688 } 688 }
689 689
690 if (exit) { 690 if (exit) {
691 if (wps_state.id3)
692 strcpy(wps_state.current_track_path, wps_state.id3->path);
693 else
694 wps_state.current_track_path[0] = '\0';
695#ifdef HAVE_LCD_CHARCELLS 691#ifdef HAVE_LCD_CHARCELLS
696 status_set_record(false); 692 status_set_record(false);
697 status_set_audio(false); 693 status_set_audio(false);
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 4193cf8301..3836d9291b 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -469,9 +469,6 @@ struct wps_state
469 bool wps_time_countup; 469 bool wps_time_countup;
470 struct mp3entry* id3; 470 struct mp3entry* id3;
471 struct mp3entry* nid3; 471 struct mp3entry* nid3;
472 char current_track_path[MAX_PATH]; /* used by root_menu.c to browse to the
473 current track at the time the audio is
474 stopped (so *id3 is invalid) */
475}; 472};
476 473
477 474
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 {
75static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume 76static 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 */
79static char current_track_path[MAX_PATH];
80static 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}
78static int browser(void* param) 85static 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 {