summaryrefslogtreecommitdiff
path: root/apps/tagcache.h
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-03-26 11:33:42 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-03-26 11:33:42 +0000
commit7c4e0c8730d5b076d4db4206361bc38d5256a23f (patch)
tree43382ae25de9bfa0bbabdff7d51c32b651ad47b5 /apps/tagcache.h
parent50d40ea43409745bc828e56af5e3879ea6b48cf1 (diff)
downloadrockbox-7c4e0c8730d5b076d4db4206361bc38d5256a23f.tar.gz
rockbox-7c4e0c8730d5b076d4db4206361bc38d5256a23f.zip
Initial version of tagcache! There are still some bugs in the engine
and much more problems with the UI. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9256 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.h')
-rw-r--r--apps/tagcache.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/apps/tagcache.h b/apps/tagcache.h
new file mode 100644
index 0000000000..a405764644
--- /dev/null
+++ b/apps/tagcache.h
@@ -0,0 +1,78 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Miika Pekkarinen
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef _TAGCACHE_H
20#define _TAGCACHE_H
21
22#include "id3.h"
23
24enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
25 tag_filename/*, tag_checksum*/ };
26#define TAG_COUNT 5
27
28#ifdef HAVE_DIRCACHE
29#define HAVE_TC_RAMCACHE 1
30#endif
31
32/* Allow a little drift to the filename ordering. */
33#define POS_HISTORY_COUNT 4
34
35/* How many entries we can create in one tag file (for sorting). */
36#define TAGFILE_MAX_ENTRIES 20000
37
38#define SEEK_LIST_SIZE 50
39#define TAGCACHE_MAX_FILTERS 3
40
41struct tagcache_search {
42 /* For internal use only. */
43 int fd;
44 long seek_list[SEEK_LIST_SIZE];
45 long filter_tag[TAGCACHE_MAX_FILTERS];
46 long filter_seek[TAGCACHE_MAX_FILTERS];
47 int filter_count;
48 int seek_list_count;
49 int seek_pos;
50 long position;
51 int entry_count;
52 bool valid;
53
54 /* Exported variables. */
55 bool ramsearch;
56 int type;
57 char *result;
58 int result_len;
59 long result_seek;
60};
61
62bool tagcache_fill_tags(struct mp3entry *id3, const char *filename);
63bool tagcache_search(struct tagcache_search *tcs, int tag);
64bool tagcache_search_add_filter(struct tagcache_search *tcs,
65 int tag, int seek);
66bool tagcache_get_next(struct tagcache_search *tcs);
67void tagcache_search_finish(struct tagcache_search *tcs);
68
69int tagcache_get_progress(void);
70#ifdef HAVE_TC_RAMCACHE
71bool tagcache_is_ramcache(void);
72#endif
73void tagcache_init(void);
74void tagcache_start_scan(void);
75void tagcache_stop_scan(void);
76bool tagcache_force_update(void);
77
78#endif