1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Daniel Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 #include <applimits.h>
27 short attr
; /* FAT attributes + file type flags */
28 unsigned long time_write
; /* Last write time */
39 /* browser context for file or db */
41 /* The directory we are browsing */
42 char currdir
[MAX_PATH
];
43 /* the number of directories we have crossed from / */
45 /* The currently selected file/id3dbitem index (old dircursor+dirfile) */
47 /* The selected item in each directory crossed
48 * (used when we want to return back to a previouws directory)*/
49 int selected_item_history
[MAX_DIR_LEVELS
];
51 int firstpos
; /* which dir entry is on first
52 position in dir buffer */
53 int pos_history
[MAX_DIR_LEVELS
];
54 int dirpos
[MAX_DIR_LEVELS
]; /* the dirstart history */
55 int cursorpos
[MAX_DIR_LEVELS
]; /* the dircursor history */
57 int *dirfilter
; /* file use */
58 int filesindir
; /* The number of files in the dircache */
59 int dirsindir
; /* file use */
60 int dirlength
; /* total number of entries in dir, incl. those not loaded */
62 int table_history
[MAX_DIR_LEVELS
]; /* db use */
63 int extra_history
[MAX_DIR_LEVELS
]; /* db use */
64 int currtable
; /* db use */
65 int currextra
; /* db use */
66 int currextra2
; /* db use */
68 /* A big buffer with plenty of entry structs,
69 * contains all files and dirs in the current
70 * dir (with filters applied) */
79 /* using attribute bits not used by FAT (FAT uses lower 7) */
81 #define TREE_ATTR_THUMBNAIL 0x0080 /* corresponding .talk file exists */
83 /* (this also reflects the sort order if by type) */
84 #define TREE_ATTR_BMARK 0x0100 /* book mark file */
85 #define TREE_ATTR_M3U 0x0200 /* playlist */
86 #define TREE_ATTR_MPA 0x0300 /* mpeg audio file */
87 #define TREE_ATTR_CFG 0x0400 /* config file */
88 #define TREE_ATTR_WPS 0x0500 /* wps config file */
89 #define TREE_ATTR_FONT 0x0600 /* font file */
90 #define TREE_ATTR_LNG 0x0700 /* binary lang file */
91 #define TREE_ATTR_ROCK 0x0800 /* binary rockbox plugin */
92 #define TREE_ATTR_MOD 0x0900 /* firmware file */
93 #define TREE_ATTR_RWPS 0x1000 /* remote-wps config file */
94 #define TREE_ATTR_BMP 0x1100 /* backdrop bmp file */
95 #define TREE_ATTR_KBD 0x1200 /* keyboard file */
96 #define TREE_ATTR_FMR 0x1300 /* preset file */
97 #define TREE_ATTR_CUE 0x1400 /* cuesheet file */
98 #define TREE_ATTR_MASK 0xFF00 /* which bits tree.c uses for file types */
100 void tree_get_filetypes(const struct filetype
**, int*);
101 void tree_init(void);
102 void browse_root(void);
103 void get_current_file(char* buffer
, int buffer_len
);
104 int rockbox_browse(const char *root
, int dirfilter
);
105 bool create_playlist(void);
106 void resume_directory(const char *dir
);
107 char *getcwd(char *buf
, int size
);
108 void reload_directory(void);
109 bool check_rockboxdir(void);
110 struct tree_context
* tree_get_context(void);
111 void tree_flush(void);
112 void tree_restore(void);
115 extern struct gui_synclist tree_lists
;
116 extern struct gui_syncstatusbar statusbars
;