summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libgme/m3u_playlist.h
diff options
context:
space:
mode:
authorSean Bartell <wingedtachikoma@gmail.com>2011-06-25 21:32:25 -0400
committerNils Wallménius <nils@rockbox.org>2012-04-25 22:13:20 +0200
commitf40bfc9267b13b54e6379dfe7539447662879d24 (patch)
tree9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libgme/m3u_playlist.h
parenta0009907de7a0107d49040d8a180f140e2eff299 (diff)
downloadrockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz
rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97 Reviewed-on: http://gerrit.rockbox.org/137 Reviewed-by: Nils Wallménius <nils@rockbox.org> Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libgme/m3u_playlist.h')
-rw-r--r--lib/rbcodec/codecs/libgme/m3u_playlist.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libgme/m3u_playlist.h b/lib/rbcodec/codecs/libgme/m3u_playlist.h
new file mode 100644
index 0000000000..06a5d3024b
--- /dev/null
+++ b/lib/rbcodec/codecs/libgme/m3u_playlist.h
@@ -0,0 +1,31 @@
1// M3U entries parser, with support for subtrack information
2
3// Game_Music_Emu 0.5.2
4#ifndef M3U_PLAYLIST_H
5#define M3U_PLAYILST_H
6
7#include "blargg_common.h"
8
9struct entry_t
10{
11 unsigned char track; // 1-based
12 int length; // milliseconds
13};
14
15/* Short version of the m3u playlist */
16struct M3u_Playlist
17{
18 unsigned char size;
19 struct entry_t *entries;
20};
21
22static inline void M3u_load_data(struct M3u_Playlist* this, void *addr)
23{
24 if( addr == NULL ) return;
25 /* m3u entries data must be at offset 100,
26 the first 99 bytes are used by metadata info */
27 this->size = *(unsigned char *)(addr + 99);
28 this->entries = (struct entry_t *)(addr+100);
29}
30
31#endif