summaryrefslogtreecommitdiff
path: root/apps/metadata/metadata_common.h
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2007-06-16 18:19:51 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2007-06-16 18:19:51 +0000
commit2175d1edf65367fd3fe3cff266b8d6ea12930f2f (patch)
tree9d6f50ebfc7919b4e2f0853fc8c0cb844cabe995 /apps/metadata/metadata_common.h
parentc3206a455a455fadb282d09f9af482c66b6bdf8e (diff)
downloadrockbox-2175d1edf65367fd3fe3cff266b8d6ea12930f2f.zip
rockbox-2175d1edf65367fd3fe3cff266b8d6ea12930f2f.tar.gz
rockbox-2175d1edf65367fd3fe3cff266b8d6ea12930f2f.tar.bz2
rockbox-2175d1edf65367fd3fe3cff266b8d6ea12930f2f.tar.xz
split up the metadata parser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13637 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata/metadata_common.h')
-rw-r--r--apps/metadata/metadata_common.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/metadata/metadata_common.h b/apps/metadata/metadata_common.h
new file mode 100644
index 0000000..70e7080
--- /dev/null
+++ b/apps/metadata/metadata_common.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2005 Dave Chapman
+ *
+ * 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.
+ *
+ ****************************************************************************/
+#include "id3.h"
+
+#ifdef ROCKBOX_BIG_ENDIAN
+#define IS_BIG_ENDIAN 1
+#else
+#define IS_BIG_ENDIAN 0
+#endif
+
+#define TAG_NAME_LENGTH 32
+#define TAG_VALUE_LENGTH 128
+
+enum tagtype { TAGTYPE_APE = 1, TAGTYPE_VORBIS };
+
+bool read_ape_tags(int fd, struct mp3entry* id3);
+bool read_vorbis_tags(int fd, struct mp3entry *id3,
+ long tag_remaining);
+
+bool skip_id3v2(int fd, struct mp3entry *id3);
+long read_string(int fd, char* buf, long buf_size, int eos, long size);
+int read_uint32be(int fd, unsigned int* buf);
+unsigned long get_long_le(void* buf);
+unsigned short get_short_le(void* buf);
+unsigned long get_long_be(void* buf);
+long get_slong(void* buf);
+unsigned long get_itunes_int32(char* value, int count);
+long parse_tag(const char* name, char* value, struct mp3entry* id3,
+ char* buf, long buf_remaining, enum tagtype type);