summaryrefslogtreecommitdiffstats
path: root/apps/tagcache.h
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-04-03 18:57:34 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-04-03 18:57:34 +0000
commit4c6fd0f4c008946760cab37da5f5c270bf0ef18a (patch)
tree97807d6d3f961db1f547bad15b7149e6bd8dec2a /apps/tagcache.h
parenta99bc99b665af9270ae8cada6ae32d4e8705f3d3 (diff)
downloadrockbox-4c6fd0f4c008946760cab37da5f5c270bf0ef18a.tar.gz
rockbox-4c6fd0f4c008946760cab37da5f5c270bf0ef18a.tar.bz2
rockbox-4c6fd0f4c008946760cab37da5f5c270bf0ef18a.zip
Initial conditional filtering support for the tagcache engine and a
fix while building the lookup list. UI part not yet ready. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9465 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.h')
-rw-r--r--apps/tagcache.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/tagcache.h b/apps/tagcache.h
index ddbb8e1dac..052d71b42b 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -39,14 +39,30 @@ enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
#define SEEK_LIST_SIZE 50
#define TAGCACHE_MAX_FILTERS 3
+#define TAGCACHE_MAX_CLAUSES 10
+
+enum clause { clause_none, clause_is, clause_gt, clause_gteq, clause_lt,
+ clause_lteq, clause_contains, clause_begins_with, clause_ends_with };
+enum modifies { clause_mod_none, clause_mod_not };
+
+struct tagcache_search_clause
+{
+ int tag;
+ int type;
+ bool numeric;
+ long numeric_data;
+ char str[32];
+};
struct tagcache_search {
/* For internal use only. */
- int fd;
+ int fd, masterfd;
long seek_list[SEEK_LIST_SIZE];
long filter_tag[TAGCACHE_MAX_FILTERS];
long filter_seek[TAGCACHE_MAX_FILTERS];
int filter_count;
+ struct tagcache_search_clause *clause[TAGCACHE_MAX_CLAUSES];
+ int clause_count;
int seek_list_count;
int seek_pos;
int idx_id;
@@ -62,9 +78,12 @@ struct tagcache_search {
long result_seek;
};
+bool tagcache_is_numeric_tag(int type);
bool tagcache_search(struct tagcache_search *tcs, int tag);
bool tagcache_search_add_filter(struct tagcache_search *tcs,
int tag, int seek);
+bool tagcache_search_add_clause(struct tagcache_search *tcs,
+ struct tagcache_search_clause *clause);
bool tagcache_get_next(struct tagcache_search *tcs);
void tagcache_search_finish(struct tagcache_search *tcs);
long tagcache_get_numeric(const struct tagcache_search *tcs, int tag);