ifdef all the tagcache code, allows rombox to be compiled again, Thanks Austin Appel
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11338 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
22dfcdb3ec
commit
710ccb7b48
63 changed files with 237 additions and 16 deletions
|
@ -27,7 +27,9 @@ status.c
|
|||
talk.c
|
||||
#endif
|
||||
tree.c
|
||||
#ifdef HAVE_TAGCACHE
|
||||
tagtree.c
|
||||
#endif
|
||||
filetree.c
|
||||
scrobbler.c
|
||||
|
||||
|
@ -82,7 +84,9 @@ eq_arm.S
|
|||
eq_menu.c
|
||||
#endif
|
||||
metadata.c
|
||||
#ifdef HAVE_TAGCACHE
|
||||
tagcache.c
|
||||
#endif
|
||||
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) \
|
||||
|| (CONFIG_KEYPAD == IRIVER_H300_PAD)
|
||||
keymaps/keymap-h1x0_h3x0.c
|
||||
|
|
|
@ -41,7 +41,9 @@
|
|||
#include "misc.h"
|
||||
#include "splash.h"
|
||||
#include "dircache.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagcache.h"
|
||||
#endif
|
||||
#include "lcd-remote.h"
|
||||
#include "crc32.h"
|
||||
#include "logf.h"
|
||||
|
@ -1917,6 +1919,7 @@ static bool dbg_dircache_info(void)
|
|||
#endif /* HAVE_DIRCACHE */
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#ifdef HAVE_TAGCACHE
|
||||
static bool dbg_tagcache_info(void)
|
||||
{
|
||||
bool done = false;
|
||||
|
@ -1960,6 +1963,7 @@ static bool dbg_tagcache_info(void)
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_CPU == SH7034
|
||||
bool dbg_save_roms(void)
|
||||
|
@ -2193,7 +2197,9 @@ bool debug_menu(void)
|
|||
{ "View dircache info", dbg_dircache_info },
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#ifdef HAVE_TAGCACHE
|
||||
{ "View tagcache info", dbg_tagcache_info },
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC || !defined(SIMULATOR)
|
||||
{ "View audio thread", dbg_audio_thread },
|
||||
#endif
|
||||
|
|
11
apps/main.c
11
apps/main.c
|
@ -60,8 +60,10 @@
|
|||
#include "misc.h"
|
||||
#include "database.h"
|
||||
#include "dircache.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagcache.h"
|
||||
#include "tagtree.h"
|
||||
#endif
|
||||
#include "lang.h"
|
||||
#include "string.h"
|
||||
#include "splash.h"
|
||||
|
@ -169,6 +171,7 @@ int init_dircache(bool preinit)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
void init_tagcache(void)
|
||||
{
|
||||
bool clear = false;
|
||||
|
@ -204,6 +207,7 @@ void init_tagcache(void)
|
|||
show_logo();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SIMULATOR
|
||||
|
||||
|
@ -230,7 +234,9 @@ void init(void)
|
|||
settings_apply();
|
||||
init_dircache(true);
|
||||
init_dircache(false);
|
||||
#ifdef HAVE_TAGCACHE
|
||||
init_tagcache();
|
||||
#endif
|
||||
sleep(HZ/2);
|
||||
tree_init();
|
||||
playlist_init();
|
||||
|
@ -436,16 +442,19 @@ void init(void)
|
|||
#endif
|
||||
settings_load(SETTINGS_ALL);
|
||||
|
||||
|
||||
if (init_dircache(true) < 0)
|
||||
{
|
||||
#ifdef HAVE_TAGCACHE
|
||||
remove(TAGCACHE_STATEFILE);
|
||||
#endif
|
||||
}
|
||||
|
||||
gui_sync_wps_init();
|
||||
settings_apply();
|
||||
init_dircache(false);
|
||||
#ifdef HAVE_TAGCACHE
|
||||
init_tagcache();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EEPROM_SETTINGS
|
||||
if (firmware_settings.initialized)
|
||||
|
|
|
@ -370,11 +370,6 @@ bool info_menu(void)
|
|||
#ifdef HAVE_LCD_CHARCELLS
|
||||
static bool do_shutdown(void)
|
||||
{
|
||||
#ifndef SIMULATOR
|
||||
if (charger_inserted())
|
||||
charging_splash();
|
||||
else
|
||||
#endif
|
||||
sys_poweroff();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -543,12 +543,14 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
|||
#ifdef X5_BACKLIGHT_SHUTDOWN
|
||||
x5_backlight_shutdown();
|
||||
#endif
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (!tagcache_prepare_shutdown())
|
||||
{
|
||||
cancel_shutdown();
|
||||
gui_syncsplash(HZ, true, str(LANG_TAGCACHE_BUSY));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
gui_syncsplash(0, true, str(LANG_SHUTTINGDOWN));
|
||||
|
||||
|
|
|
@ -64,7 +64,9 @@
|
|||
#endif
|
||||
#include "playlist_menu.h"
|
||||
#include "playlist_catalog.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagtree.h"
|
||||
#endif
|
||||
|
||||
static int context;
|
||||
static char* selected_file = NULL;
|
||||
|
@ -181,11 +183,13 @@ static bool add_to_playlist(int position, bool queue)
|
|||
if (position == PLAYLIST_INSERT_SHUFFLED)
|
||||
srand(current_tick);
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (context == CONTEXT_ID3DB)
|
||||
{
|
||||
tagtree_insert_selection_playlist(position, queue);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA)
|
||||
playlist_insert_track(NULL, selected_file, position, queue, true);
|
||||
|
|
|
@ -59,7 +59,9 @@
|
|||
#include "buffer.h"
|
||||
#include "dsp.h"
|
||||
#include "abrepeat.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagcache.h"
|
||||
#endif
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
#include "icons.h"
|
||||
#include "peakmeter.h"
|
||||
|
|
|
@ -574,7 +574,9 @@ bool quick_screen_quick(int button_enter)
|
|||
[SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) },
|
||||
[SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) },
|
||||
[SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) },
|
||||
#ifdef HAVE_TAGCACHE
|
||||
[SHOW_ID3DB]={ STR(LANG_SYSFONT_FILTER_ID3DB) }
|
||||
#endif
|
||||
};
|
||||
static const struct opt_items right_items[] = {
|
||||
[REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) },
|
||||
|
|
|
@ -419,7 +419,11 @@ static const struct bit_entry hd_bits[] =
|
|||
|
||||
/* browser */
|
||||
{3, S_O(dirfilter), SHOW_SUPPORTED,
|
||||
"show files", "all,supported,music,playlists,id3 database" },
|
||||
"show files", "all,supported,music,playlists"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
",id3 database"
|
||||
#endif
|
||||
},
|
||||
{1, S_O(sort_case), false, "sort case", off_on },
|
||||
{1, S_O(browse_current), false, "follow playlist", off_on },
|
||||
/* playlist */
|
||||
|
@ -593,10 +597,13 @@ static const struct bit_entry hd_bits[] =
|
|||
{1, S_O(dircache), false, "dircache", off_on },
|
||||
{22, S_O(dircache_size), 0, NULL, NULL },
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
{1, S_O(tagcache_ram), 0, "tagcache_ram", off_on },
|
||||
#endif
|
||||
{1, S_O(tagcache_autoupdate), 0, "tagcache_autoupdate", off_on },
|
||||
#endif
|
||||
|
||||
{4, S_O(default_codepage), 0, "default codepage",
|
||||
"iso8859-1,iso8859-7,iso8859-8,cp1251,iso8859-11,cp1256,iso8859-9,iso8859-2,sjis,gb2312,ksx1001,big5,utf-8,cp1256" },
|
||||
|
|
|
@ -389,10 +389,12 @@ struct user_settings
|
|||
bool dircache; /* enable directory cache */
|
||||
int dircache_size; /* directory cache structure last size, 22 bits */
|
||||
#endif
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
bool tagcache_ram; /* load tagcache to ram? */
|
||||
#endif
|
||||
bool tagcache_autoupdate; /* automatically keep tagcache in sync? */
|
||||
#endif
|
||||
int default_codepage; /* set default codepage for tag conversion */
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
unsigned char rwps_file[MAX_FILENAME+1]; /* last remote-wps */
|
||||
|
|
|
@ -49,8 +49,10 @@
|
|||
#include "database.h"
|
||||
#include "dir.h"
|
||||
#include "dircache.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagcache.h"
|
||||
#include "tagtree.h"
|
||||
#endif
|
||||
#include "rbunicode.h"
|
||||
#include "splash.h"
|
||||
#include "yesno.h"
|
||||
|
@ -749,10 +751,17 @@ static bool dir_filter(void)
|
|||
{ STR(LANG_FILTER_SUPPORTED) },
|
||||
{ STR(LANG_FILTER_MUSIC) },
|
||||
{ STR(LANG_FILTER_PLAYLIST) },
|
||||
#ifdef HAVE_TAGCACHE
|
||||
{ STR(LANG_FILTER_ID3DB) }
|
||||
#endif
|
||||
};
|
||||
#ifdef HAVE_TAGCACHE
|
||||
return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
|
||||
names, 5, NULL );
|
||||
#else
|
||||
return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT,
|
||||
names, 4, NULL );
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool sort_case(void)
|
||||
|
@ -1632,6 +1641,7 @@ static bool dircache(void)
|
|||
}
|
||||
#endif /* HAVE_DIRCACHE */
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
static bool tagcache_ram(void)
|
||||
{
|
||||
|
@ -1688,6 +1698,7 @@ static bool tagcache_settings_menu(void)
|
|||
menu_exit(m);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
static bool unplug_mode(void)
|
||||
|
@ -1853,7 +1864,9 @@ static bool fileview_settings_menu(void)
|
|||
{ ID2P(LANG_FOLLOW), browse_current },
|
||||
{ ID2P(LANG_SHOW_ICONS), show_icons },
|
||||
{ ID2P(LANG_SHOW_PATH), show_path },
|
||||
#ifdef HAVE_TAGCACHE
|
||||
{ ID2P(LANG_TAGCACHE), tagcache_settings_menu},
|
||||
#endif
|
||||
};
|
||||
|
||||
m=menu_init( items, sizeof(items) / sizeof(*items), NULL,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef _TAGCACHE_H
|
||||
#define _TAGCACHE_H
|
||||
|
||||
|
@ -178,3 +179,4 @@ bool tagcache_update(void);
|
|||
bool tagcache_rebuild(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "malloc.h" // realloc() and free()
|
||||
#include <strings.h> // strncasecmp()
|
||||
#include <string.h> // strlen()
|
||||
|
@ -452,3 +453,4 @@ int album_entry_add_song_file(FILE *fd, struct album_entry *e, struct album_size
|
|||
|
||||
return ERR_NO_INPLACE_UPDATE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __ALBUM_H__
|
||||
#define __ALBUM_H__
|
||||
|
||||
|
@ -101,3 +102,4 @@ int album_entry_add_song_file(FILE *fd, struct album_entry *e, struct album_size
|
|||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "malloc.h" // malloc() and free()
|
||||
|
||||
#include "array_buffer.h"
|
||||
|
@ -664,4 +665,4 @@ int array_buffer_write(FILE *fd, struct array_buffer *b) {
|
|||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __ARRAY_BUFFER_H__
|
||||
#define __ARRAY_BUFFER_H__
|
||||
|
||||
|
@ -157,3 +158,4 @@ int array_buffer_write(FILE *fd, struct array_buffer *b);
|
|||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "malloc.h" // realloc() and free()
|
||||
#include <string.h> // strncasecmp()
|
||||
|
||||
|
@ -368,3 +369,4 @@ int artist_entry_add_album_file(FILE *fd, struct artist_entry *e, struct artist_
|
|||
|
||||
return ERR_NO_INPLACE_UPDATE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __ARTIST_H__
|
||||
#define __ARTIST_H__
|
||||
|
||||
|
@ -98,3 +99,4 @@ int artist_entry_add_album_file(FILE *fd, struct artist_entry *e, struct artist_
|
|||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __CONFIG_H // Include me only once
|
||||
#define __CONFIG_H
|
||||
|
||||
|
@ -37,3 +38,4 @@
|
|||
#include <assert.h>
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include <string.h> // strlen() strcpy() strcat()
|
||||
|
||||
#include "malloc.h"
|
||||
|
@ -601,3 +602,4 @@ int tag_info_destruct(struct tag_info *t) {
|
|||
|
||||
return ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __DB_H__
|
||||
#define __DB_H__
|
||||
|
||||
|
@ -35,3 +36,4 @@ struct tag_info* new_tag_info();
|
|||
int tag_info_destruct(struct tag_info *t);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "malloc.h" // realloc() and free()
|
||||
#include <string.h> // strncasecmp()
|
||||
|
||||
|
@ -266,3 +267,4 @@ int file_size_destruct(struct file_size *s) {
|
|||
free(s);
|
||||
return ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __FILE_H__
|
||||
#define __FILE_H__
|
||||
|
||||
|
@ -82,3 +83,4 @@ int file_size_destruct(struct file_size *s);
|
|||
*/
|
||||
|
||||
#endif
|
||||
#ifdef HAVE_TAGCACHE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include <stdio.h>
|
||||
|
||||
#include "header.h"
|
||||
|
@ -119,3 +119,4 @@ int header_write(FILE *fd, const struct header *h) {
|
|||
|
||||
return ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __HEADER_H__
|
||||
#define __HEADER_H__
|
||||
|
||||
|
@ -37,3 +38,4 @@ struct header {
|
|||
int header_write(FILE *fd, const struct header *header);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -113,3 +114,4 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "config.h"
|
||||
#include "malloc.h"
|
||||
|
||||
|
@ -129,3 +130,4 @@ void malloc_stats() {
|
|||
printf(" Maximum amount of allocated memory: %dbytes\n", max_total);
|
||||
printf(" Current amount of allocated memory: %dbytes\n", total);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __MALLOC_H__
|
||||
#define __MALLOC_H__
|
||||
|
||||
|
@ -14,3 +15,4 @@ void *do_realloc(void *ptr, size_t size);
|
|||
void malloc_stats();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -215,3 +216,4 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "malloc.h" // realloc() and free()
|
||||
#include <string.h> // strncasecmp()
|
||||
|
||||
|
@ -448,3 +449,4 @@ int song_size_destruct(struct song_size *s) {
|
|||
free(s);
|
||||
return ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef __SONG_H__
|
||||
#define __SONG_H__
|
||||
|
||||
|
@ -91,3 +92,4 @@ int song_size_destruct(struct song_size *s);
|
|||
*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "config.h"
|
||||
#include "malloc.h"
|
||||
|
||||
|
@ -9,3 +10,4 @@ int tag_dummy(char *file, struct tag_info *t) {
|
|||
strcpy(t->song, file);
|
||||
return ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "db.h"
|
||||
|
||||
int tag_dummy(char *file, struct tag_info *t);
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#ifdef HAVE_TAGCACHE
|
||||
#include "unique.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -14,3 +15,4 @@ char *create_unique_name(char *buffer, const char *prefix, const char *suffix, i
|
|||
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifdef
|
||||
#ifndef __UNIQUE_H__
|
||||
#define __UNIQUE_H__
|
||||
|
||||
char *create_unique_name(char *buffer, const char *prefix, const char *suffix, int digits);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#ifndef _TAGTREE_H
|
||||
#define _TAGTREE_H
|
||||
|
||||
|
@ -53,3 +54,4 @@ int tagtree_get_icon(struct tree_context* c);
|
|||
int tagtree_get_filename(struct tree_context* c, char *buf, int buflen);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
61
apps/tree.c
61
apps/tree.c
|
@ -61,7 +61,9 @@
|
|||
#include "recorder/recording.h"
|
||||
#include "rtc.h"
|
||||
#include "dircache.h"
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#include "tagcache.h"
|
||||
#endif
|
||||
#include "yesno.h"
|
||||
#include "gwps-common.h"
|
||||
#include "eeprom_settings.h"
|
||||
|
@ -177,6 +179,7 @@ char * tree_get_filename(int selected_item, void * data, char *buffer)
|
|||
struct tree_context * local_tc=(struct tree_context *)data;
|
||||
char *name;
|
||||
int attr=0;
|
||||
#ifdef HAVE_TAGCACHE
|
||||
bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
|
||||
|
||||
if (id3db)
|
||||
|
@ -184,6 +187,7 @@ char * tree_get_filename(int selected_item, void * data, char *buffer)
|
|||
return tagtree_get_entry(&tc, selected_item)->name;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
struct entry* dc = local_tc->dircache;
|
||||
struct entry* e = &dc[selected_item];
|
||||
|
@ -205,11 +209,14 @@ char * tree_get_filename(int selected_item, void * data, char *buffer)
|
|||
void tree_get_fileicon(int selected_item, void * data, ICON * icon)
|
||||
{
|
||||
struct tree_context * local_tc=(struct tree_context *)data;
|
||||
#ifdef HAVE_TAGCACHE
|
||||
bool id3db = *(local_tc->dirfilter) == SHOW_ID3DB;
|
||||
if (id3db) {
|
||||
*icon = (ICON)tagtree_get_icon(&tc);
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
struct entry* dc = local_tc->dircache;
|
||||
struct entry* e = &dc[selected_item];
|
||||
*icon = (ICON)filetype_get_icon(e->attr);
|
||||
|
@ -304,8 +311,9 @@ int tree_get_file_position(char * filename)
|
|||
*/
|
||||
static int update_dir(void)
|
||||
{
|
||||
bool id3db = *tc.dirfilter == SHOW_ID3DB;
|
||||
bool changed = false;
|
||||
#ifdef HAVE_TAGCACHE
|
||||
bool id3db = *tc.dirfilter == SHOW_ID3DB;
|
||||
/* Checks for changes */
|
||||
if (id3db) {
|
||||
if (tc.currtable != lasttable ||
|
||||
|
@ -322,7 +330,9 @@ static int update_dir(void)
|
|||
changed = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* if the tc.currdir has been changed, reload it ...*/
|
||||
if (strncmp(tc.currdir, lastdir, sizeof(lastdir)) || reload_dir) {
|
||||
|
||||
|
@ -345,12 +355,17 @@ static int update_dir(void)
|
|||
}
|
||||
if (changed)
|
||||
{
|
||||
if(!id3db && (tc.dirfull ||
|
||||
if(
|
||||
#ifdef HAVE_TAGCACHE
|
||||
!id3db &&
|
||||
#endif
|
||||
(tc.dirfull ||
|
||||
tc.filesindir == global_settings.max_files_in_dir) )
|
||||
{
|
||||
gui_syncsplash(HZ, true, str(LANG_SHOWDIR_BUFFER_FULL));
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
{
|
||||
if (global_settings.show_path_in_browser == SHOW_PATH_FULL
|
||||
|
@ -366,6 +381,7 @@ static int update_dir(void)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (global_settings.show_path_in_browser == SHOW_PATH_FULL)
|
||||
{
|
||||
|
@ -417,7 +433,9 @@ static int update_dir(void)
|
|||
/* load tracks from specified directory to resume play */
|
||||
void resume_directory(const char *dir)
|
||||
{
|
||||
#ifdef HAVE_TAGCACHE
|
||||
bool id3db = *tc.dirfilter == SHOW_ID3DB;
|
||||
#endif
|
||||
|
||||
if (ft_load(&tc, dir) < 0)
|
||||
return;
|
||||
|
@ -425,8 +443,10 @@ void resume_directory(const char *dir)
|
|||
|
||||
ft_build_playlist(&tc, 0);
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
tagtree_load(&tc);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Returns the current working directory and also writes cwd to buf if
|
||||
|
@ -504,10 +524,12 @@ void set_current_file(char *path)
|
|||
char *name;
|
||||
int i;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
/* in ID3DB mode it is a bad idea to call this function */
|
||||
/* (only happens with `follow playlist') */
|
||||
if( *tc.dirfilter == SHOW_ID3DB )
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* separate directory from filename */
|
||||
/* gets the directory's name and put it into tc.currdir */
|
||||
|
@ -552,6 +574,7 @@ void set_current_file(char *path)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
static bool check_changed_id3mode(bool currmode)
|
||||
{
|
||||
if (currmode != (global_settings.dirfilter == SHOW_ID3DB)) {
|
||||
|
@ -571,6 +594,8 @@ static bool check_changed_id3mode(bool currmode)
|
|||
}
|
||||
return currmode;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* main loop, handles key events */
|
||||
static bool dirbrowse(void)
|
||||
{
|
||||
|
@ -586,11 +611,13 @@ static bool dirbrowse(void)
|
|||
long thumbnail_time = -1; /* for delaying a thumbnail */
|
||||
|
||||
char* currdir = tc.currdir; /* just a shortcut */
|
||||
#ifdef HAVE_TAGCACHE
|
||||
bool id3db = *tc.dirfilter == SHOW_ID3DB;
|
||||
|
||||
if (id3db)
|
||||
curr_context=CONTEXT_ID3DB;
|
||||
else
|
||||
#endif
|
||||
curr_context=CONTEXT_TREE;
|
||||
tc.selected_item = 0;
|
||||
tc.dirlevel=0;
|
||||
|
@ -659,7 +686,11 @@ static bool dirbrowse(void)
|
|||
if ( numentries == 0 )
|
||||
break;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
switch (id3db?tagtree_enter(&tc):ft_enter(&tc))
|
||||
#else
|
||||
switch (ft_enter(&tc))
|
||||
#endif
|
||||
{
|
||||
case 1: reload_dir = true; break;
|
||||
case 2: start_wps = true; break;
|
||||
|
@ -678,9 +709,11 @@ static bool dirbrowse(void)
|
|||
if (tc.dirlevel == 0 && !strcmp(currdir,"/"))
|
||||
break;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
tagtree_exit(&tc);
|
||||
else
|
||||
#endif
|
||||
if (ft_exit(&tc) == 3)
|
||||
exit_func = true;
|
||||
|
||||
|
@ -737,9 +770,11 @@ static bool dirbrowse(void)
|
|||
reload_dir = true;
|
||||
restore = true;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
id3db = check_changed_id3mode(id3db);
|
||||
if(id3db)
|
||||
reload_dir = true;
|
||||
#endif
|
||||
}
|
||||
else /* use it as a quick exit instead */
|
||||
exit_func = true;
|
||||
|
@ -769,8 +804,10 @@ static bool dirbrowse(void)
|
|||
reload_dir = true;
|
||||
restore = true;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
id3db = check_changed_id3mode(id3db);
|
||||
reload_dir = true;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -794,6 +831,7 @@ static bool dirbrowse(void)
|
|||
if(!numentries)
|
||||
onplay_result = onplay(NULL, 0, curr_context);
|
||||
else {
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
{
|
||||
if (tagtree_get_attr(&tc) == TREE_ATTR_MPA)
|
||||
|
@ -805,6 +843,7 @@ static bool dirbrowse(void)
|
|||
attr = ATTR_DIRECTORY;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
attr = dircache[tc.selected_item].attr;
|
||||
|
||||
|
@ -843,12 +882,14 @@ static bool dirbrowse(void)
|
|||
int attr;
|
||||
char* name;
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
{
|
||||
attr = tagtree_get_attr(&tc);
|
||||
name = tagtree_get_entry(&tc, lasti)->name;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
attr = dircache[lasti].attr;
|
||||
name = dircache[lasti].name;
|
||||
|
@ -880,7 +921,9 @@ static bool dirbrowse(void)
|
|||
|
||||
#ifdef HAVE_HOTSWAP
|
||||
case SYS_FS_CHANGED:
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (!id3db)
|
||||
#endif
|
||||
reload_dir = true;
|
||||
/* The 'dir no longer valid' situation will be caught later
|
||||
* by checking the showdir() result. */
|
||||
|
@ -916,13 +959,17 @@ static bool dirbrowse(void)
|
|||
reload_dir = true;
|
||||
#ifdef HAVE_HOTSWAP
|
||||
else
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (!id3db) /* Try reload to catch 'no longer valid' case. */
|
||||
#endif
|
||||
reload_dir = true;
|
||||
#endif
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
show_main_backdrop();
|
||||
#endif
|
||||
#ifdef HAVE_TAGCACHE
|
||||
id3db = check_changed_id3mode(id3db);
|
||||
#endif
|
||||
restore = true;
|
||||
start_wps=false;
|
||||
}
|
||||
|
@ -985,12 +1032,14 @@ static bool dirbrowse(void)
|
|||
thumbnail_time = -1; /* Cancel whatever we were
|
||||
about to say */
|
||||
|
||||
#ifdef HAVE_TAGCACHE
|
||||
if (id3db)
|
||||
{
|
||||
attr = tagtree_get_attr(&tc);
|
||||
name = tagtree_get_entry(&tc, tc.selected_item)->name;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
attr = dircache[tc.selected_item].attr;
|
||||
name = dircache[tc.selected_item].name;
|
||||
|
@ -1380,7 +1429,9 @@ void ft_play_filename(char *dir, char *file)
|
|||
void tree_flush(void)
|
||||
{
|
||||
scrobbler_shutdown();
|
||||
#ifdef HAVE_TAGCACHE
|
||||
tagcache_shutdown();
|
||||
#endif
|
||||
playlist_shutdown();
|
||||
|
||||
#ifdef HAVE_TC_RAMCACHE
|
||||
|
@ -1440,6 +1491,8 @@ void tree_restore(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_TAGCACHE
|
||||
tagcache_start_scan();
|
||||
#endif
|
||||
scrobbler_init();
|
||||
}
|
||||
|
|
|
@ -244,3 +244,4 @@ David Quesada
|
|||
Jared Stafford
|
||||
Martin Hensel
|
||||
Stéphane Doyen
|
||||
Austin Appel
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
/* define this if you have access to the quickscreen */
|
||||
#define HAVE_QUICKSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 176
|
||||
#define LCD_HEIGHT 220
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 112
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
/* define this if you have a colour LCD */
|
||||
#define HAVE_LCD_COLOR 1
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 240
|
||||
#define LCD_HEIGHT 320
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
/* define this if you have RTC RAM available for settings */
|
||||
#define HAVE_RTC_RAM 1
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 128
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 128
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 128
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 220
|
||||
#define LCD_HEIGHT 176
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
/* define this if you have a colour LCD */
|
||||
/* #define HAVE_LCD_COLOR 1 */
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 128
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 160
|
||||
#define LCD_HEIGHT 128
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 220
|
||||
#define LCD_HEIGHT 176
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 138
|
||||
#define LCD_HEIGHT 110
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 138
|
||||
#define LCD_HEIGHT 110
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 176
|
||||
#define LCD_HEIGHT 132
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 320
|
||||
#define LCD_HEIGHT 240
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 112
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
/* define this if you can invert the colours on your LCD */
|
||||
#define HAVE_LCD_INVERT
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 112
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* define this if you have a charcell LCD display */
|
||||
#define HAVE_LCD_CHARCELLS 1
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions (for the simulator) */
|
||||
#define LCD_WIDTH 132 /* Display width in pixels */
|
||||
#define LCD_HEIGHT 64 /* Display height in pixels */
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 112
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
/* define this if you have access to the pitchscreen */
|
||||
#define HAVE_PITCHSCREEN
|
||||
|
||||
/* define this if you would like tagcache to build on this target */
|
||||
#define HAVE_TAGCACHE
|
||||
|
||||
/* LCD dimensions */
|
||||
#define LCD_WIDTH 112
|
||||
#define LCD_HEIGHT 64
|
||||
|
|
|
@ -217,8 +217,10 @@
|
|||
* plenty of RAM. Both features can be enabled independently. */
|
||||
#if (MEMORYSIZE > 8 || MEM > 8) && !defined(BOOTLOADER)
|
||||
#define HAVE_DIRCACHE
|
||||
#ifdef HAVE_TAGCACHE
|
||||
#define HAVE_TC_RAMCACHE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR) && !defined(BOOTLOADER)
|
||||
#define HAVE_PRIORITY_SCHEDULING
|
||||
|
|
Loading…
Reference in a new issue