summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-07-22 22:45:20 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-07-22 22:45:20 +0000
commitfe689a8541e294c472d111759e334d3814bfc5ba (patch)
tree56c260d6cc4150955321603ee1851f2ba81efcc1 /apps/tree.c
parent97f94b4fac9dbbe81b66d96564e1fe80d5adc0c3 (diff)
downloadrockbox-fe689a8541e294c472d111759e334d3814bfc5ba.tar.gz
rockbox-fe689a8541e294c472d111759e334d3814bfc5ba.zip
First crude status display for Players
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1408 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c136
1 files changed, 71 insertions, 65 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 420c55bfcf..2559a1c399 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -36,6 +36,7 @@
36#include "menu.h" 36#include "menu.h"
37#include "wps.h" 37#include "wps.h"
38#include "settings.h" 38#include "settings.h"
39#include "status.h"
39#include "debug.h" 40#include "debug.h"
40 41
41#ifdef HAVE_LCD_BITMAP 42#ifdef HAVE_LCD_BITMAP
@@ -58,7 +59,7 @@ static char lastdir[MAX_PATH] = {0};
58 59
59void browse_root(void) 60void browse_root(void)
60{ 61{
61 dirbrowse("/"); 62 dirbrowse("/");
62} 63}
63 64
64 65
@@ -225,6 +226,7 @@ static int showdir(char *path, int start)
225 lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name); 226 lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name);
226 } 227 }
227 228
229 status_draw();
228 return filesindir; 230 return filesindir;
229} 231}
230 232
@@ -346,6 +348,7 @@ bool dirbrowse(char *root)
346 else { 348 else {
347 mpeg_stop(); 349 mpeg_stop();
348 play_mode = 0; 350 play_mode = 0;
351 status_set_playmode(STATUS_STOP);
349 } 352 }
350 break; 353 break;
351 354
@@ -368,8 +371,8 @@ bool dirbrowse(char *root)
368 play_mode = 0; 371 play_mode = 0;
369 memcpy(currdir,buf,sizeof(currdir)); 372 memcpy(currdir,buf,sizeof(currdir));
370 if ( dirlevel < MAX_DIR_LEVELS ) { 373 if ( dirlevel < MAX_DIR_LEVELS ) {
371 dirpos[dirlevel] = start; 374 dirpos[dirlevel] = start;
372 cursorpos[dirlevel] = dircursor; 375 cursorpos[dirlevel] = dircursor;
373 } 376 }
374 dirlevel++; 377 dirlevel++;
375 dircursor=0; 378 dircursor=0;
@@ -380,11 +383,14 @@ bool dirbrowse(char *root)
380 { 383 {
381 play_mode = 2; 384 play_mode = 2;
382 play_list(currdir, dircacheptr[dircursor+start]->name); 385 play_list(currdir, dircacheptr[dircursor+start]->name);
386 status_set_playmode(STATUS_PLAY);
383 } 387 }
384 else { 388 else {
385 play_mode = 1; 389 play_mode = 1;
386 mpeg_play(buf); 390 mpeg_play(buf);
391 status_set_playmode(STATUS_PLAY);
387 } 392 }
393 status_draw();
388 lcd_stop_scroll(); 394 lcd_stop_scroll();
389 rc = wps_show(); 395 rc = wps_show();
390 if(rc == SYS_USB_CONNECTED) 396 if(rc == SYS_USB_CONNECTED)
@@ -398,71 +404,71 @@ bool dirbrowse(char *root)
398 break; 404 break;
399 405
400 case TREE_PREV: 406 case TREE_PREV:
401 if(filesindir) 407 if(filesindir)
402 { 408 {
403 if(dircursor) { 409 if(dircursor) {
404 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false); 410 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false);
405 dircursor--; 411 dircursor--;
406 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 412 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
407 } 413 }
408 else { 414 else {
409 if (start) { 415 if (start) {
410 start--; 416 start--;
411 numentries = showdir(currdir, start); 417 numentries = showdir(currdir, start);
412 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 418 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
413 } 419 }
414 else { 420 else {
415 if (numentries < TREE_MAX_ON_SCREEN) { 421 if (numentries < TREE_MAX_ON_SCREEN) {
416 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, 422 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor,
417 false); 423 false);
418 dircursor = numentries - 1; 424 dircursor = numentries - 1;
419 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, 425 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor,
420 true); 426 true);
421 } 427 }
422 else { 428 else {
423 start = numentries - TREE_MAX_ON_SCREEN; 429 start = numentries - TREE_MAX_ON_SCREEN;
424 dircursor = TREE_MAX_ON_SCREEN - 1; 430 dircursor = TREE_MAX_ON_SCREEN - 1;
425 numentries = showdir(currdir, start); 431 numentries = showdir(currdir, start);
426 put_cursorxy(0, CURSOR_Y + LINE_Y + 432 put_cursorxy(0, CURSOR_Y + LINE_Y +
427 TREE_MAX_ON_SCREEN - 1, true); 433 TREE_MAX_ON_SCREEN - 1, true);
428 } 434 }
429 } 435 }
430 } 436 }
431 lcd_update(); 437 lcd_update();
432 } 438 }
433 break; 439 break;
434 440
435 case TREE_NEXT: 441 case TREE_NEXT:
436 if(filesindir) 442 if(filesindir)
437 { 443 {
438 if (dircursor + start + 1 < numentries ) { 444 if (dircursor + start + 1 < numentries ) {
439 if(dircursor+1 < TREE_MAX_ON_SCREEN) { 445 if(dircursor+1 < TREE_MAX_ON_SCREEN) {
440 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, 446 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor,
441 false); 447 false);
442 dircursor++; 448 dircursor++;
443 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 449 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
444 } 450 }
445 else { 451 else {
446 start++; 452 start++;
447 numentries = showdir(currdir, start); 453 numentries = showdir(currdir, start);
448 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 454 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
449 } 455 }
450 } 456 }
451 else { 457 else {
452 if(numentries < TREE_MAX_ON_SCREEN) { 458 if(numentries < TREE_MAX_ON_SCREEN) {
453 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, 459 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor,
454 false); 460 false);
455 start = dircursor = 0; 461 start = dircursor = 0;
456 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 462 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
457 } 463 }
458 else { 464 else {
459 start = dircursor = 0; 465 start = dircursor = 0;
460 numentries = showdir(currdir, start); 466 numentries = showdir(currdir, start);
461 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); 467 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
462 } 468 }
463 } 469 }
464 lcd_update(); 470 lcd_update();
465 } 471 }
466 break; 472 break;
467 473
468 case TREE_MENU: { 474 case TREE_MENU: {