summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/main.c2
-rw-r--r--apps/playlist.c22
-rw-r--r--apps/playlist.h1
3 files changed, 9 insertions, 16 deletions
diff --git a/apps/main.c b/apps/main.c
index e33e2bd5a5..af85db2243 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -48,6 +48,7 @@
48#include "font.h" 48#include "font.h"
49#include "language.h" 49#include "language.h"
50#include "wps-display.h" 50#include "wps-display.h"
51#include "playlist.h"
51 52
52char appsversion[]=APPSVERSION; 53char appsversion[]=APPSVERSION;
53 54
@@ -176,6 +177,7 @@ void init(void)
176 status_init(); 177 status_init();
177 usb_start_monitoring(); 178 usb_start_monitoring();
178 power_init(); 179 power_init();
180 playlist_init();
179} 181}
180 182
181int main(void) 183int main(void)
diff --git a/apps/playlist.c b/apps/playlist.c
index 48de9dd687..748c2ce528 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -38,22 +38,7 @@
38 38
39#include "lang.h" 39#include "lang.h"
40 40
41static struct playlist_info playlist={ 41static struct playlist_info playlist;
42 "", /* filename */
43 -1, /* fd */
44 0, /* dirlen */
45 {0}, /* indices[] */
46 0, /* index */
47 0, /* first_index */
48 0, /* seed */
49 0, /* amount */
50 false, /* in_ram */
51 {0}, /* queue_indices[] */
52 0, /* last_queue_index */
53 0, /* queue_index */
54 0, /* num_queued */
55 0 /* start_queue */
56};
57 42
58#define QUEUE_FILE ROCKBOX_DIR "/.queue_file" 43#define QUEUE_FILE ROCKBOX_DIR "/.queue_file"
59 44
@@ -65,6 +50,11 @@ static int playlist_end_pos = 0;
65 50
66static char now_playing[MAX_PATH+1]; 51static char now_playing[MAX_PATH+1];
67 52
53void playlist_init(void)
54{
55 playlist.fd = -1;
56}
57
68/* 58/*
69 * remove any files and indices associated with the playlist 59 * remove any files and indices associated with the playlist
70 */ 60 */
diff --git a/apps/playlist.h b/apps/playlist.h
index 9f70b469af..2ea4452cca 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -49,6 +49,7 @@ struct playlist_info
49extern struct playlist_info playlist; 49extern struct playlist_info playlist;
50extern bool playlist_shuffle; 50extern bool playlist_shuffle;
51 51
52void playlist_init(void);
52int play_list(char *dir, char *file, int start_index, 53int play_list(char *dir, char *file, int start_index,
53 bool shuffled_index, int start_offset, 54 bool shuffled_index, int start_offset,
54 int random_seed, int first_index, int queue_resume, 55 int random_seed, int first_index, int queue_resume,