summaryrefslogtreecommitdiff
path: root/apps/tagcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.h')
-rw-r--r--apps/tagcache.h56
1 files changed, 0 insertions, 56 deletions
diff --git a/apps/tagcache.h b/apps/tagcache.h
index 690506b308..f6cd03e972 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -44,61 +44,12 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
44 tag_virt_entryage, tag_virt_autoscore, 44 tag_virt_entryage, tag_virt_autoscore,
45 TAG_COUNT_ALL}; 45 TAG_COUNT_ALL};
46 46
47/* Maximum length of a single tag. */
48#define TAG_MAXLEN (MAX_PATH*2)
49
50/* Allow a little drift to the filename ordering (should not be too high/low). */
51#define POS_HISTORY_COUNT 4
52
53/* How much to pre-load entries while committing to prevent seeking. */
54#define IDX_BUF_DEPTH 64
55
56/* Tag Cache Header version 'TCHxx'. Increment when changing internal structures. */
57#define TAGCACHE_MAGIC 0x54434810
58
59/* Dump store/restore header version 'TCSxx'. */
60#define TAGCACHE_STATEFILE_MAGIC 0x54435301
61
62/* How much to allocate extra space for ramcache. */
63#define TAGCACHE_RESERVE 32768
64
65/**
66 * Define how long one entry must be at least (longer -> less memory at commit).
67 * Must be at least 4 bytes in length for correct alignment.
68 */
69#define TAGFILE_ENTRY_CHUNK_LENGTH 8
70
71/* Used to guess the necessary buffer size at commit. */
72#define TAGFILE_ENTRY_AVG_LENGTH 16
73
74/* How many entries to fetch to the seek table at once while searching. */ 47/* How many entries to fetch to the seek table at once while searching. */
75#define SEEK_LIST_SIZE 32 48#define SEEK_LIST_SIZE 32
76 49
77/* Always strict align entries for best performance and binary compatibility. */
78#define TAGCACHE_STRICT_ALIGN 1
79
80/* Max events in the internal tagcache command queue. */
81#define TAGCACHE_COMMAND_QUEUE_LENGTH 32
82/* Idle time before committing events in the command queue. */
83#define TAGCACHE_COMMAND_QUEUE_COMMIT_DELAY HZ*2
84
85#define TAGCACHE_MAX_FILTERS 4 50#define TAGCACHE_MAX_FILTERS 4
86#define TAGCACHE_MAX_CLAUSES 32 51#define TAGCACHE_MAX_CLAUSES 32
87 52
88/* Tag database files. */
89
90/* Temporary database containing new tags to be committed to the main db. */
91#define TAGCACHE_FILE_TEMP ROCKBOX_DIR "/database_tmp.tcd"
92
93/* The main database master index and numeric data. */
94#define TAGCACHE_FILE_MASTER ROCKBOX_DIR "/database_idx.tcd"
95
96/* The main database string data. */
97#define TAGCACHE_FILE_INDEX ROCKBOX_DIR "/database_%d.tcd"
98
99/* ASCII dumpfile of the DB contents. */
100#define TAGCACHE_FILE_CHANGELOG ROCKBOX_DIR "/database_changelog.txt"
101
102/* Serialized DB. */ 53/* Serialized DB. */
103#define TAGCACHE_STATEFILE ROCKBOX_DIR "/database_state.tcd" 54#define TAGCACHE_STATEFILE ROCKBOX_DIR "/database_state.tcd"
104 55
@@ -117,13 +68,6 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
117 68
118#define TAGCACHE_IS_NUMERIC(tag) (BIT_N(tag) & TAGCACHE_NUMERIC_TAGS) 69#define TAGCACHE_IS_NUMERIC(tag) (BIT_N(tag) & TAGCACHE_NUMERIC_TAGS)
119 70
120/* Flags */
121#define FLAG_DELETED 0x0001 /* Entry has been removed from db */
122#define FLAG_DIRCACHE 0x0002 /* Filename is a dircache pointer */
123#define FLAG_DIRTYNUM 0x0004 /* Numeric data has been modified */
124#define FLAG_TRKNUMGEN 0x0008 /* Track number has been generated */
125#define FLAG_RESURRECTED 0x0010 /* Statistics data has been resurrected */
126
127enum clause { clause_none, clause_is, clause_is_not, clause_gt, clause_gteq, 71enum clause { clause_none, clause_is, clause_is_not, clause_gt, clause_gteq,
128 clause_lt, clause_lteq, clause_contains, clause_not_contains, 72 clause_lt, clause_lteq, clause_contains, clause_not_contains,
129 clause_begins_with, clause_not_begins_with, clause_ends_with, 73 clause_begins_with, clause_not_begins_with, clause_ends_with,