summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libgme/m3u_playlist.h
blob: 06a5d3024b68272516ebeeb45931b8fb7f9d45f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// M3U entries parser, with support for subtrack information

// Game_Music_Emu 0.5.2
#ifndef M3U_PLAYLIST_H
#define M3U_PLAYILST_H

#include "blargg_common.h"

struct entry_t
{
	unsigned char track;  // 1-based
	int length; // milliseconds
};

/* Short version of the m3u playlist */
struct M3u_Playlist
{
	unsigned char size;
	struct entry_t *entries;
};

static inline void M3u_load_data(struct M3u_Playlist* this, void *addr)
{
	if( addr == NULL ) return;
	/* m3u entries data must be at offset 100,
		the first 99 bytes are used by metadata info */
	this->size = *(unsigned char *)(addr + 99);
	this->entries = (struct entry_t *)(addr+100);
}

#endif