forked from len0rd/rockbox
Now we have file type icons on the player, thanks to Justin Heiner
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2144 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1cbc8826e9
commit
10452d285b
1 changed files with 11 additions and 4 deletions
15
apps/tree.c
15
apps/tree.c
|
|
@ -42,9 +42,9 @@
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "ata.h"
|
#include "ata.h"
|
||||||
|
#include "icons.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#include "icons.h"
|
|
||||||
#include "widgets.h"
|
#include "widgets.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6];
|
||||||
|
|
||||||
#define TREE_MAX_ON_SCREEN 2
|
#define TREE_MAX_ON_SCREEN 2
|
||||||
#define TREE_MAX_LEN_DISPLAY 11 /* max length that fits on screen */
|
#define TREE_MAX_LEN_DISPLAY 11 /* max length that fits on screen */
|
||||||
#define LINE_X 1 /* X position the entry-list starts at */
|
#define LINE_X 2 /* X position the entry-list starts at */
|
||||||
#define LINE_Y 0 /* Y position the entry-list starts at */
|
#define LINE_Y 0 /* Y position the entry-list starts at */
|
||||||
|
|
||||||
#define CURSOR_X 0
|
#define CURSOR_X 0
|
||||||
|
|
@ -170,9 +170,11 @@ static int compare(const void* p1, const void* p2)
|
||||||
|
|
||||||
static int showdir(char *path, int start)
|
static int showdir(char *path, int start)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
int icon_type = 0;
|
int icon_type = 0;
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
int line_height = LINE_HEIGTH;
|
int line_height = LINE_HEIGTH;
|
||||||
|
#else
|
||||||
|
char tmpstring[2];
|
||||||
#endif
|
#endif
|
||||||
int i;
|
int i;
|
||||||
int tree_max_on_screen;
|
int tree_max_on_screen;
|
||||||
|
|
@ -291,7 +293,6 @@ static int showdir(char *path, int start)
|
||||||
|
|
||||||
len = strlen(dircache[i].name);
|
len = strlen(dircache[i].name);
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
if ( dircache[i].attr & ATTR_DIRECTORY )
|
if ( dircache[i].attr & ATTR_DIRECTORY )
|
||||||
icon_type = Folder;
|
icon_type = Folder;
|
||||||
else if ( dircache[i].attr & TREE_ATTR_M3U )
|
else if ( dircache[i].attr & TREE_ATTR_M3U )
|
||||||
|
|
@ -303,10 +304,16 @@ static int showdir(char *path, int start)
|
||||||
else
|
else
|
||||||
icon_type = 0;
|
icon_type = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
if (icon_type)
|
if (icon_type)
|
||||||
lcd_bitmap(bitmap_icons_6x8[icon_type],
|
lcd_bitmap(bitmap_icons_6x8[icon_type],
|
||||||
CURSOR_X * 6 + CURSOR_WIDTH,
|
CURSOR_X * 6 + CURSOR_WIDTH,
|
||||||
MARGIN_Y+(i-start)*line_height, 6, 8, true);
|
MARGIN_Y+(i-start)*line_height, 6, 8, true);
|
||||||
|
#else
|
||||||
|
lcd_define_pattern(0,tree_icons_5x7[0],LastTreeIcon*8);
|
||||||
|
tmpstring[0] = icon_type;
|
||||||
|
tmpstring[1] = 0;
|
||||||
|
lcd_puts(LINE_X-1, i-start, tmpstring);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* if MP3 filter is on, cut off the extension */
|
/* if MP3 filter is on, cut off the extension */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue