diff options
-rw-r--r-- | apps/tree.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/apps/tree.c b/apps/tree.c index 6f1258392f..b873b11483 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include <stdio.h> | ||
20 | #include <string.h> | 21 | #include <string.h> |
21 | #include <stdlib.h> | 22 | #include <stdlib.h> |
22 | #include <stdbool.h> | 23 | #include <stdbool.h> |
@@ -27,7 +28,7 @@ | |||
27 | #include "button.h" | 28 | #include "button.h" |
28 | #include "kernel.h" | 29 | #include "kernel.h" |
29 | #include "tree.h" | 30 | #include "tree.h" |
30 | //#include "play.h" | 31 | #include "play.h" |
31 | 32 | ||
32 | #ifdef HAVE_LCD_BITMAP | 33 | #ifdef HAVE_LCD_BITMAP |
33 | #include "icons.h" | 34 | #include "icons.h" |
@@ -187,8 +188,10 @@ bool dirbrowse(char *root) | |||
187 | case BUTTON_OFF: | 188 | case BUTTON_OFF: |
188 | return false; | 189 | return false; |
189 | break; | 190 | break; |
190 | #endif | ||
191 | case BUTTON_LEFT: | 191 | case BUTTON_LEFT: |
192 | #else | ||
193 | case BUTTON_STOP: | ||
194 | #endif | ||
192 | i=strlen(currdir); | 195 | i=strlen(currdir); |
193 | if (i==1) { | 196 | if (i==1) { |
194 | return false; | 197 | return false; |
@@ -226,14 +229,14 @@ bool dirbrowse(char *root) | |||
226 | 229 | ||
227 | break; | 230 | break; |
228 | 231 | ||
229 | case BUTTON_RIGHT: | ||
230 | #ifdef HAVE_RECORDER_KEYPAD | 232 | #ifdef HAVE_RECORDER_KEYPAD |
231 | case BUTTON_PLAY: | 233 | case BUTTON_RIGHT: |
232 | #endif | 234 | #endif |
235 | case BUTTON_PLAY: | ||
233 | if ((currdir[0]=='/') && (currdir[1]==0)) { | 236 | if ((currdir[0]=='/') && (currdir[1]==0)) { |
234 | sprintf(buf,"%s%s",currdir,buffer[dircursor].name); | 237 | snprintf(buf,sizeof(buf),"%s%s",currdir,buffer[dircursor].name); |
235 | } else { | 238 | } else { |
236 | sprintf(buf,"%s/%s",currdir,buffer[dircursor].name); | 239 | snprintf(buf,sizeof(buf),"%s/%s",currdir,buffer[dircursor].name); |
237 | } | 240 | } |
238 | 241 | ||
239 | if (!buffer[dircursor].file) { | 242 | if (!buffer[dircursor].file) { |
@@ -259,13 +262,19 @@ bool dirbrowse(char *root) | |||
259 | lcd_update(); | 262 | lcd_update(); |
260 | #endif | 263 | #endif |
261 | break; | 264 | break; |
262 | 265 | ||
266 | #ifdef HAVE_RECORDER_KEYPAD | ||
263 | case BUTTON_UP: | 267 | case BUTTON_UP: |
268 | #else | ||
269 | case BUTTON_LEFT: | ||
270 | #endif | ||
264 | if(dircursor) { | 271 | if(dircursor) { |
265 | lcd_puts(0, LINE_Y+dircursor, " "); | 272 | lcd_puts(0, LINE_Y+dircursor, " "); |
266 | dircursor--; | 273 | dircursor--; |
267 | lcd_puts(0, LINE_Y+dircursor, "-"); | 274 | lcd_puts(0, LINE_Y+dircursor, "-"); |
275 | #ifdef HAVE_LCD_BITMAP | ||
268 | lcd_update(); | 276 | lcd_update(); |
277 | #endif | ||
269 | } | 278 | } |
270 | else { | 279 | else { |
271 | if (start) { | 280 | if (start) { |
@@ -281,7 +290,12 @@ bool dirbrowse(char *root) | |||
281 | } | 290 | } |
282 | } | 291 | } |
283 | break; | 292 | break; |
293 | |||
294 | #ifdef HAVE_RECORDER_KEYPAD | ||
284 | case BUTTON_DOWN: | 295 | case BUTTON_DOWN: |
296 | #else | ||
297 | case BUTTON_RIGHT: | ||
298 | #endif | ||
285 | if(dircursor+1 < numentries) { | 299 | if(dircursor+1 < numentries) { |
286 | lcd_puts(0, LINE_Y+dircursor, " "); | 300 | lcd_puts(0, LINE_Y+dircursor, " "); |
287 | dircursor++; | 301 | dircursor++; |