diff options
Diffstat (limited to 'apps/tree.h')
-rw-r--r-- | apps/tree.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/apps/tree.h b/apps/tree.h index a6c41f2af5..04532c887d 100644 --- a/apps/tree.h +++ b/apps/tree.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <applimits.h> | 23 | #include <applimits.h> |
24 | #include <file.h> | 24 | #include <file.h> |
25 | 25 | ||
26 | /*FIXME: don't forget to remove PGUP, PGDOW, NEXT, PREV | ||
27 | * when everything will be working with gui_list */ | ||
26 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 28 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ |
27 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | 29 | (CONFIG_KEYPAD == IRIVER_H300_PAD) |
28 | #define TREE_NEXT BUTTON_DOWN | 30 | #define TREE_NEXT BUTTON_DOWN |
@@ -43,8 +45,11 @@ | |||
43 | #define TREE_POWER_BTN BUTTON_ON | 45 | #define TREE_POWER_BTN BUTTON_ON |
44 | #define TREE_QUICK (BUTTON_MODE | BUTTON_REPEAT) | 46 | #define TREE_QUICK (BUTTON_MODE | BUTTON_REPEAT) |
45 | 47 | ||
48 | /* Remote keys */ | ||
46 | #define TREE_RC_NEXT BUTTON_RC_FF | 49 | #define TREE_RC_NEXT BUTTON_RC_FF |
47 | #define TREE_RC_PREV BUTTON_RC_REW | 50 | #define TREE_RC_PREV BUTTON_RC_REW |
51 | #define TREE_RC_PGUP BUTTON_RC_SOURCE | ||
52 | #define TREE_RC_PGDN BUTTON_RC_BITRATE | ||
48 | #define TREE_RC_EXIT BUTTON_RC_STOP | 53 | #define TREE_RC_EXIT BUTTON_RC_STOP |
49 | #define TREE_RC_RUN (BUTTON_RC_MENU | BUTTON_REL) | 54 | #define TREE_RC_RUN (BUTTON_RC_MENU | BUTTON_REL) |
50 | #define TREE_RC_RUN_PRE BUTTON_RC_MENU | 55 | #define TREE_RC_RUN_PRE BUTTON_RC_MENU |
@@ -137,27 +142,36 @@ struct filetype { | |||
137 | int icon; | 142 | int icon; |
138 | int voiceclip; | 143 | int voiceclip; |
139 | }; | 144 | }; |
140 | 145 | ||
141 | /* browser context for file or db */ | 146 | /* browser context for file or db */ |
142 | struct tree_context { | 147 | struct tree_context { |
148 | /* The directory we are browsing */ | ||
149 | char currdir[MAX_PATH]; | ||
150 | /* the number of directories we have crossed from / */ | ||
143 | int dirlevel; | 151 | int dirlevel; |
144 | int dircursor; | 152 | /* The currently selected file/id3dbitem index (old dircursor+dirfile) */ |
145 | int dirstart; | 153 | int selected_item; |
154 | /* The selected item in each directory crossed | ||
155 | * (used when we want to return back to a previouws directory)*/ | ||
156 | int selected_item_history[MAX_DIR_LEVELS]; | ||
157 | |||
146 | int firstpos; /* which dir entry is on first | 158 | int firstpos; /* which dir entry is on first |
147 | position in dir buffer */ | 159 | position in dir buffer */ |
148 | int pos_history[MAX_DIR_LEVELS]; | 160 | int pos_history[MAX_DIR_LEVELS]; |
149 | int dirpos[MAX_DIR_LEVELS]; | 161 | int dirpos[MAX_DIR_LEVELS]; /* the dirstart history */ |
150 | int cursorpos[MAX_DIR_LEVELS]; | 162 | int cursorpos[MAX_DIR_LEVELS]; /* the dircursor history */ |
151 | char currdir[MAX_PATH]; /* file use */ | 163 | |
152 | int *dirfilter; /* file use */ | 164 | int *dirfilter; /* file use */ |
153 | int filesindir; | 165 | int filesindir; /* The number of files in the dircache */ |
154 | int dirsindir; /* file use */ | 166 | int dirsindir; /* file use */ |
155 | int dirlength; /* total number of entries in dir, incl. those not loaded */ | 167 | int dirlength; /* total number of entries in dir, incl. those not loaded */ |
156 | int table_history[MAX_DIR_LEVELS]; /* db use */ | 168 | int table_history[MAX_DIR_LEVELS]; /* db use */ |
157 | int extra_history[MAX_DIR_LEVELS]; /* db use */ | 169 | int extra_history[MAX_DIR_LEVELS]; /* db use */ |
158 | int currtable; /* db use */ | 170 | int currtable; /* db use */ |
159 | int currextra; /* db use */ | 171 | int currextra; /* db use */ |
160 | 172 | /* A big buffer with plenty of entry structs, | |
173 | * contains all files and dirs in the current | ||
174 | * dir (with filters applied) */ | ||
161 | void* dircache; | 175 | void* dircache; |
162 | int dircache_size; | 176 | int dircache_size; |
163 | char* name_buffer; | 177 | char* name_buffer; |
@@ -196,4 +210,7 @@ struct tree_context* tree_get_context(void); | |||
196 | void tree_flush(void); | 210 | void tree_flush(void); |
197 | void tree_restore(void); | 211 | void tree_restore(void); |
198 | 212 | ||
213 | |||
214 | extern struct gui_synclist tree_lists; | ||
215 | extern struct gui_syncstatusbar statusbars; | ||
199 | #endif | 216 | #endif |