summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-01-07 10:57:51 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-01-07 10:57:51 +0000
commita68e5d835f7ea64ff4eb073ee8b38d2d41038693 (patch)
tree7fa625cdc73a0bb78eb0c54bceb670938facbe49
parenta36cdf5b37994a301d4fdeab123ee1569a34cf46 (diff)
remove some useless/unused stuff from gwps.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19705 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c7
-rw-r--r--apps/gui/gwps.c82
-rw-r--r--apps/gui/gwps.h3
-rw-r--r--apps/root_menu.c4
-rw-r--r--apps/tree.c2
5 files changed, 8 insertions, 90 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index e218c123f3..d50069eac1 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -451,13 +451,6 @@ bool update(struct gui_wps *gwps)
else{
gui_wps_refresh(gwps, 0, WPS_REFRESH_ALL);
}
-
- if (gwps->state->id3)
- {
- strncpy(gwps->state->current_track_path, gwps->state->id3->path,
- sizeof(gwps->state->current_track_path));
- gwps->state->current_track_path[sizeof(gwps->state->current_track_path)-1] = '\0';
- }
}
if (gwps->state->id3)
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index c1e7606634..d586a9a9e2 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -64,23 +64,13 @@
#include "appevents.h"
#include "viewport.h"
-/* currently only on wps_state is needed */
+/* currently only one wps_state is needed */
struct wps_state wps_state;
struct gui_wps gui_wps[NB_SCREENS];
static struct wps_data wps_datas[NB_SCREENS];
-/* change the path to the current played track */
-static void wps_state_update_ctp(const char *path);
/* initial setup of wps_data */
static void wps_state_init(void);
-/* initial setup of a wps */
-static void gui_wps_init(struct gui_wps *gui_wps);
-/* connects a wps with a format-description of the displayed content */
-static void gui_wps_set_data(struct gui_wps *gui_wps, struct wps_data *data);
-/* connects a wps with a screen */
-static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display);
-/* connects a wps with a statusbar*/
-static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar);
static void prev_track(unsigned skip_thresh)
{
@@ -167,7 +157,6 @@ long gui_wps_show(void)
return 0;
FOR_NB_SCREENS(i)
gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL);
- wps_state_update_ctp(wps_state.id3->path);
}
restore = true;
@@ -738,71 +727,10 @@ static void wps_state_init(void)
wps_state.paused = false;
wps_state.id3 = NULL;
wps_state.nid3 = NULL;
- wps_state.current_track_path[0] = '\0';
}
-#if 0
-/* these are obviously not used? */
-
-void wps_state_update_ff_rew(bool ff_rew)
-{
- wps_state.ff_rewind = ff_rew;
-}
-
-void wps_state_update_paused(bool paused)
-{
- wps_state.paused = paused;
-}
-void wps_state_update_id3_nid3(struct mp3entry *id3, struct mp3entry *nid3)
-{
- wps_state.id3 = id3;
- wps_state.nid3 = nid3;
-}
-#endif
-
-static void wps_state_update_ctp(const char *path)
-{
- strncpy(wps_state.current_track_path, path,
- sizeof(wps_state.current_track_path));
- wps_state.current_track_path[sizeof(wps_state.current_track_path)-1] = '\0';
-}
/* wps_state end*/
-/* initial setup of a wps */
-static void gui_wps_init(struct gui_wps *gui_wps)
-{
- gui_wps->data = NULL;
- gui_wps->display = NULL;
- gui_wps->statusbar = NULL;
- /* Currently no seperate wps_state needed/possible
- so use the only aviable ( "global" ) one */
- gui_wps->state = &wps_state;
-}
-
-/* connects a wps with a format-description of the displayed content */
-static void gui_wps_set_data(struct gui_wps *gui_wps, struct wps_data *data)
-{
- gui_wps->data = data;
-}
-
-/* connects a wps with a screen */
-static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display)
-{
- gui_wps->display = display;
-}
-
-static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar)
-{
- gui_wps->statusbar = statusbar;
-}
-/* gui_wps end */
-
-void gui_sync_wps_screen_init(void)
-{
- int i;
- FOR_NB_SCREENS(i)
- gui_wps_set_disp(&gui_wps[i], &screens[i]);
-}
#ifdef HAVE_LCD_BITMAP
static void statusbar_toggle_handler(void *data)
{
@@ -841,9 +769,11 @@ void gui_sync_wps_init(void)
#ifdef HAVE_REMOTE_LCD
wps_datas[i].remote_wps = (i != 0);
#endif
- gui_wps_init(&gui_wps[i]);
- gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
- gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
+ gui_wps[i].data = &wps_datas[i];
+ gui_wps[i].display = &screens[i];
+ /* Currently no seperate wps_state needed/possible
+ so use the only aviable ( "global" ) one */
+ gui_wps[i].state = &wps_state;
}
#ifdef HAVE_LCD_BITMAP
add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 6311bc058b..3836d9291b 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -469,7 +469,6 @@ struct wps_state
bool wps_time_countup;
struct mp3entry* id3;
struct mp3entry* nid3;
- char current_track_path[MAX_PATH];
};
@@ -491,7 +490,6 @@ struct gui_wps
struct screen *display;
struct wps_data *data;
struct wps_state *state;
- struct gui_statusbar *statusbar;
};
/* gui_wps end */
@@ -503,7 +501,6 @@ extern struct wps_state wps_state;
extern struct gui_wps gui_wps[NB_SCREENS];
void gui_sync_wps_init(void);
-void gui_sync_wps_screen_init(void);
#ifdef HAVE_ALBUMART
/* gives back if WPS contains an albumart tag */
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 3b0907f00a..418ea01cff 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -96,9 +96,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] != '\0')
+ wps_state.id3)
{
- strcpy(folder, wps_state.current_track_path);
+ strcpy(folder, wps_state.id3->path);
}
#ifdef HAVE_HOTSWAP /* quick hack to stop crashing if you try entering
the browser from the menu when you were in the card
diff --git a/apps/tree.c b/apps/tree.c
index 3c3189f85a..37078d4ebd 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -285,8 +285,6 @@ bool check_rockboxdir(void)
/* do this really late in the init sequence */
void tree_gui_init(void)
{
- gui_sync_wps_screen_init();
-
check_rockboxdir();
strcpy(tc.currdir, "/");