~q3cpma/mus

ref: cf29c2237d0c99e5240a55895c07564ef4635392 mus/mus_player/tag.h -rw-r--r-- 1001 bytes
cf29c223q3cpma Add a #pragma once to the new xoshiro128plus.h header 1 year, 7 months ago
                                                                                
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once

#include <stddef.h>
#include <stdbool.h>

#include <ao/ao.h>

#include "tag_match.h"


typedef enum
{
	STRING,
	FLOAT
} Tag_type;

/* Tag_id => Tag union type mapping */
static const Tag_type tag_type[NUM_TAG] =
{
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	STRING,
	FLOAT,
	FLOAT,
	FLOAT,
	FLOAT,
};

/* Tag value struct. Tags represents all the tags of a track */
typedef struct
{
	bool empty;
	union
	{
		char *sval;
		float fval;
	};
} Tag;

typedef enum {ALBUM_GAIN, TRACK_GAIN, NO_GAIN} ReplayGain_type;


Tag * tags_init(void);

void tags_free(const Tag *tags);

/* Print the non-empty entries of a Tags to a stream*/
void tags_fprint(FILE *stream, const Tag *tags);

/* Parse a Vorbis comment line and fill tags accordingly */
void tag_vorbis_comment_parse(const char *line, Tag *tags);

/* Compute the gain to apply according to the user options and the tags */
float tag_compute_replay_gain(const Tag *tags, const ReplayGain_type rgtype);