summaryrefslogtreecommitdiffstats
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.tar.bz2
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 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2005 by Miika Pekkarinen
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef _TAGCACHE_H
+#define _TAGCACHE_H
+
+#include "id3.h"
+
+enum tag_type { tag_artist = 0, tag_album, tag_genre, tag_title,
+ tag_filename/*, tag_checksum*/ };
+#define TAG_COUNT 5
+
+#ifdef HAVE_DIRCACHE
+#define HAVE_TC_RAMCACHE 1
+#endif
+
+/* Allow a little drift to the filename ordering. */
+#define POS_HISTORY_COUNT 4
+
+/* How many entries we can create in one tag file (for sorting). */
+#define TAGFILE_MAX_ENTRIES 20000
+
+#define SEEK_LIST_SIZE 50
+#define TAGCACHE_MAX_FILTERS 3
+
+struct tagcache_search {
+ /* For internal use only. */
+ int fd;
+ long seek_list[SEEK_LIST_SIZE];
+ long filter_tag[TAGCACHE_MAX_FILTERS];
+ long filter_seek[TAGCACHE_MAX_FILTERS];
+ int filter_count;
+ int seek_list_count;
+ int seek_pos;
+ long position;
+ int entry_count;
+ bool valid;
+
+ /* Exported variables. */
+ bool ramsearch;
+ int type;
+ char *result;
+ int result_len;
+ long result_seek;
+};
+
+bool tagcache_fill_tags(struct mp3entry *id3, const char *filename);
+bool tagcache_search(struct tagcache_search *tcs, int tag);
+bool tagcache_search_add_filter(struct tagcache_search *tcs,
+ int tag, int seek);
+bool tagcache_get_next(struct tagcache_search *tcs);
+void tagcache_search_finish(struct tagcache_search *tcs);
+
+int tagcache_get_progress(void);
+#ifdef HAVE_TC_RAMCACHE
+bool tagcache_is_ramcache(void);
+#endif
+void tagcache_init(void);
+void tagcache_start_scan(void);
+void tagcache_stop_scan(void);
+bool tagcache_force_update(void);
+
+#endif