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_mem_init(void);
74 void tree_gui_init(void);
75 void get_current_file(char* buffer
, int buffer_len
);
76 void set_dirfilter(int l_dirfilter
);
77 void set_current_file(char *path
);
78 int rockbox_browse(const char *root
, int dirfilter
);
79 bool create_playlist(void);
80 void resume_directory(const char *dir
);
81 char *getcwd(char *buf
, int size
);
82 void reload_directory(void);
83 bool check_rockboxdir(void);
84 struct tree_context
* tree_get_context(void);
85 void tree_flush(void);
86 void tree_restore(void);
88 bool bookmark_play(char* resume_file
, int index
, int offset
, int seed
,
91 extern struct gui_synclist tree_lists
;