use the playback PLAYBACK_EVENT_TRACK_CHANGE instead of the WPS to keep track of the current track (for follow playlist)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19747 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6d871d53a3
commit
b84fe020a5
|
@ -688,10 +688,6 @@ long gui_wps_show(void)
|
|||
}
|
||||
|
||||
if (exit) {
|
||||
if (wps_state.id3)
|
||||
strcpy(wps_state.current_track_path, wps_state.id3->path);
|
||||
else
|
||||
wps_state.current_track_path[0] = '\0';
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
status_set_record(false);
|
||||
status_set_audio(false);
|
||||
|
|
|
@ -469,9 +469,6 @@ struct wps_state
|
|||
bool wps_time_countup;
|
||||
struct mp3entry* id3;
|
||||
struct mp3entry* nid3;
|
||||
char current_track_path[MAX_PATH]; /* used by root_menu.c to browse to the
|
||||
current track at the time the audio is
|
||||
stopped (so *id3 is invalid) */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include "config.h"
|
||||
#include "appevents.h"
|
||||
#include "menu.h"
|
||||
#include "root_menu.h"
|
||||
#include "lang.h"
|
||||
|
@ -75,6 +76,12 @@ struct root_items {
|
|||
static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume
|
||||
or goto current track based on previous
|
||||
screen */
|
||||
static char current_track_path[MAX_PATH];
|
||||
static void rootmenu_track_changed_callback(void* param)
|
||||
{
|
||||
struct mp3entry *id3 = (struct mp3entry *)param;
|
||||
strncpy(current_track_path, id3->path, MAX_PATH);
|
||||
}
|
||||
static int browser(void* param)
|
||||
{
|
||||
int ret_val;
|
||||
|
@ -96,9 +103,9 @@ static int browser(void* param)
|
|||
filter = global_settings.dirfilter;
|
||||
if (global_settings.browse_current &&
|
||||
last_screen == GO_TO_WPS &&
|
||||
wps_state.current_track_path[0])
|
||||
current_track_path[0])
|
||||
{
|
||||
strcpy(folder, wps_state.current_track_path);
|
||||
strcpy(folder, current_track_path);
|
||||
}
|
||||
#ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering
|
||||
the browser from the menu when you were in the card
|
||||
|
@ -506,7 +513,7 @@ void root_menu(void)
|
|||
if (global_settings.start_in_screen == 0)
|
||||
next_screen = (int)global_status.last_screen;
|
||||
else next_screen = global_settings.start_in_screen - 2;
|
||||
|
||||
add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, rootmenu_track_changed_callback);
|
||||
#ifdef HAVE_RTC_ALARM
|
||||
if ( rtc_check_alarm_started(true) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue