summaryrefslogtreecommitdiff
path: root/library.h
blob: 1397c15c71a65295b9bf3b99a06bad5aefe92749 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
#ifndef library_h
#define library_h

#include "memory.h"

typedef struct {
	char path[256];
	char name[64];
	char artist[64];
	char album[64];
} Song;

typedef struct {
	Song* songs;
	int* indices;
	int cap, cnt;
} Library;

typedef struct {
	Song* song;
	void* f;
	int
		seek,
		samples,
		channels,
		play
	;
} Player;

void build_library(
	Arena* a,
	Library* lib,
	const char* path
);

int get_song_meta(const char* path, Song* s);
void play_song(Player* p, Song* song);
void init_player(Player* p);

#endif