forked from len0rd/rockbox
Enabled playlist functions on tracks in tagcache
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9877 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b9615514bf
commit
a85b23fa5b
3 changed files with 36 additions and 25 deletions
|
@ -710,15 +710,12 @@ int tagtree_get_filename(struct tree_context* c, char *buf, int buflen)
|
|||
if (!tagcache_search(&tcs, tag_filename))
|
||||
return -1;
|
||||
|
||||
tagcache_search_add_filter(&tcs, tag_title, entry->extraseek);
|
||||
|
||||
if (!tagcache_get_next(&tcs))
|
||||
if (!tagcache_retrieve(&tcs, entry->extraseek, buf, buflen))
|
||||
{
|
||||
tagcache_search_finish(&tcs);
|
||||
return -2;
|
||||
}
|
||||
|
||||
strncpy(buf, tcs.result, buflen-1);
|
||||
tagcache_search_finish(&tcs);
|
||||
|
||||
return 0;
|
||||
|
@ -789,34 +786,52 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id)
|
|||
return &entry[realid];
|
||||
}
|
||||
|
||||
int tagtree_get_attr(struct tree_context* c)
|
||||
{
|
||||
int attr = -1;
|
||||
switch (c->currtable)
|
||||
{
|
||||
case navibrowse:
|
||||
if (csi->tagorder[c->currextra] == tag_title)
|
||||
attr = TREE_ATTR_MPA;
|
||||
else
|
||||
attr = ATTR_DIRECTORY;
|
||||
break;
|
||||
|
||||
case allsubentries:
|
||||
attr = TREE_ATTR_MPA;
|
||||
break;
|
||||
|
||||
default:
|
||||
attr = ATTR_DIRECTORY;
|
||||
break;
|
||||
}
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
const char* tagtree_get_icon(struct tree_context* c)
|
||||
const unsigned char* tagtree_get_icon(struct tree_context* c)
|
||||
#else
|
||||
int tagtree_get_icon(struct tree_context* c)
|
||||
#endif
|
||||
{
|
||||
int icon;
|
||||
|
||||
switch (c->currtable)
|
||||
switch (tagtree_get_attr(c))
|
||||
{
|
||||
case navibrowse:
|
||||
if (csi->tagorder[c->currextra] == tag_title)
|
||||
icon = Icon_Audio;
|
||||
else
|
||||
icon = Icon_Folder;
|
||||
break;
|
||||
|
||||
case allsubentries:
|
||||
case TREE_ATTR_MPA:
|
||||
icon = Icon_Audio;
|
||||
break;
|
||||
|
||||
case ATTR_DIRECTORY:
|
||||
default:
|
||||
icon = Icon_Folder;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
return (char *)bitmap_icons_6x8[icon];
|
||||
return bitmap_icons_6x8[icon];
|
||||
#else
|
||||
return icon;
|
||||
#endif
|
||||
|
|
|
@ -35,12 +35,12 @@ int tagtree_enter(struct tree_context* c);
|
|||
void tagtree_exit(struct tree_context* c);
|
||||
int tagtree_load(struct tree_context* c);
|
||||
struct tagentry* tagtree_get_entry(struct tree_context *c, int id);
|
||||
int tagtree_get_attr(struct tree_context* c);
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
const char* tagtree_get_icon(struct tree_context* c);
|
||||
const unsigned char* tagtree_get_icon(struct tree_context* c);
|
||||
#else
|
||||
int tagtree_get_icon(struct tree_context* c);
|
||||
#endif
|
||||
int tagtree_get_filename(struct tree_context* c, char *buf, int buflen);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
10
apps/tree.c
10
apps/tree.c
|
@ -766,14 +766,10 @@ static bool dirbrowse(void)
|
|||
else {
|
||||
if (id3db)
|
||||
{
|
||||
switch (tc.currtable)
|
||||
if (tagtree_get_attr(&tc) == TREE_ATTR_MPA)
|
||||
{
|
||||
case navibrowse:
|
||||
if (tc.currextra != tag_title)
|
||||
break;
|
||||
attr=TREE_ATTR_MPA;
|
||||
tagtree_get_filename(&tc, buf, sizeof(buf));
|
||||
break;
|
||||
attr = TREE_ATTR_MPA;
|
||||
tagtree_get_filename(&tc, buf, sizeof(buf));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue