diff options
Diffstat (limited to 'apps/tagcache.h')
-rw-r--r-- | apps/tagcache.h | 78 |
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 | |||
24 | enum 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 | |||
41 | struct 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 | |||
62 | bool tagcache_fill_tags(struct mp3entry *id3, const char *filename); | ||
63 | bool tagcache_search(struct tagcache_search *tcs, int tag); | ||
64 | bool tagcache_search_add_filter(struct tagcache_search *tcs, | ||
65 | int tag, int seek); | ||
66 | bool tagcache_get_next(struct tagcache_search *tcs); | ||
67 | void tagcache_search_finish(struct tagcache_search *tcs); | ||
68 | |||
69 | int tagcache_get_progress(void); | ||
70 | #ifdef HAVE_TC_RAMCACHE | ||
71 | bool tagcache_is_ramcache(void); | ||
72 | #endif | ||
73 | void tagcache_init(void); | ||
74 | void tagcache_start_scan(void); | ||
75 | void tagcache_stop_scan(void); | ||
76 | bool tagcache_force_update(void); | ||
77 | |||
78 | #endif | ||