summaryrefslogtreecommitdiff
path: root/apps/root_menu.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-01-11 04:03:17 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-01-11 04:03:17 +0000
commitb84fe020a5bc497cee9b88eb782c2d4a9b7be711 (patch)
treea8cf8514d1b5cb641fa5aa32e7a689bce003a917 /apps/root_menu.c
parent6d871d53a3f089071e4cfdc91a98e05615aa608a (diff)
downloadrockbox-b84fe020a5bc497cee9b88eb782c2d4a9b7be711.tar.gz
rockbox-b84fe020a5bc497cee9b88eb782c2d4a9b7be711.zip
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
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r--apps/root_menu.c13
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 {
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 {