1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Daniel Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
25 #include <applimits.h>
29 short attr
; /* FAT attributes + file type flags */
30 unsigned long time_write
; /* Last write time */
35 /* browser context for file or db */
37 /* The directory we are browsing */
38 char currdir
[MAX_PATH
];
39 /* the number of directories we have crossed from / */
41 /* The currently selected file/id3dbitem index (old dircursor+dirfile) */
43 /* The selected item in each directory crossed
44 * (used when we want to return back to a previouws directory)*/
45 int selected_item_history
[MAX_DIR_LEVELS
];
47 int firstpos
; /* which dir entry is on first
48 position in dir buffer */
49 int pos_history
[MAX_DIR_LEVELS
];
51 int *dirfilter
; /* file use */
52 int filesindir
; /* The number of files in the dircache */
53 int dirsindir
; /* file use */
54 int dirlength
; /* total number of entries in dir, incl. those not loaded */
56 int table_history
[MAX_DIR_LEVELS
]; /* db use */
57 int extra_history
[MAX_DIR_LEVELS
]; /* db use */
58 int currtable
; /* db use */
59 int currextra
; /* db use */
61 /* A big buffer with plenty of entry structs,
62 * contains all files and dirs in the current
63 * dir (with filters applied) */
70 int sort_dir
; /* directory sort order */
73 void tree_drawlists(void);
74 void tree_mem_init(void) INIT_ATTR
;
75 void tree_gui_init(void) INIT_ATTR
;
76 void get_current_file(char* buffer
, int buffer_len
);
77 void set_dirfilter(int l_dirfilter
);
78 void set_current_file(char *path
);
79 int rockbox_browse(const char *root
, int dirfilter
);
80 bool create_playlist(void);
81 void resume_directory(const char *dir
);
82 char *getcwd(char *buf
, int size
);
83 void reload_directory(void);
84 bool check_rockboxdir(void);
85 struct tree_context
* tree_get_context(void);
86 void tree_flush(void);
87 void tree_restore(void);
89 bool bookmark_play(char* resume_file
, int index
, int offset
, int seed
,
92 extern struct gui_synclist tree_lists
;