clean up some debugging output.
[kugel-rb.git] / apps / tree.h
blob5cf743c2f8bf1aa4a81dd4ba2d37da18c4ce851b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 ****************************************************************************/
21 #ifndef _TREE_H_
22 #define _TREE_H_
24 #include <stdbool.h>
25 #include <applimits.h>
26 #include <file.h>
28 struct entry {
29 short attr; /* FAT attributes + file type flags */
30 unsigned long time_write; /* Last write time */
31 char *name;
35 /* browser context for file or db */
36 struct tree_context {
37 /* The directory we are browsing */
38 char currdir[MAX_PATH];
39 /* the number of directories we have crossed from / */
40 int dirlevel;
41 /* The currently selected file/id3dbitem index (old dircursor+dirfile) */
42 int selected_item;
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 */
55 #ifdef HAVE_TAGCACHE
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 */
60 #endif
61 /* A big buffer with plenty of entry structs,
62 * contains all files and dirs in the current
63 * dir (with filters applied) */
64 void* dircache;
65 int dircache_size;
66 char* name_buffer;
67 int name_buffer_size;
68 int dentry_size;
69 bool dirfull;
72 void tree_mem_init(void);
73 void tree_gui_init(void);
74 void get_current_file(char* buffer, int buffer_len);
75 void set_dirfilter(int l_dirfilter);
76 void set_current_file(char *path);
77 int rockbox_browse(const char *root, int dirfilter);
78 bool create_playlist(void);
79 void resume_directory(const char *dir);
80 char *getcwd(char *buf, int size);
81 void reload_directory(void);
82 bool check_rockboxdir(void);
83 struct tree_context* tree_get_context(void);
84 void tree_flush(void);
85 void tree_restore(void);
87 bool bookmark_play(char* resume_file, int index, int offset, int seed,
88 char *filename);
90 extern struct gui_synclist tree_lists;
91 extern struct gui_syncstatusbar statusbars;
92 #endif