Ported to AROS.
[AROS-Contrib.git] / libs / mpega / tag.h
blob96280fd316a684a9aefff8a965d280f6555ae2de
1 /*
2 * madplay - MPEG audio decoder and player
3 * Copyright (C) 2000-2004 Robert Leslie
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * $Id$
22 # ifndef TAG_H
23 # define TAG_H
25 #include "fixed.h"
26 #include "stream.h"
28 enum {
29 TAG_XING = 0x0001,
30 TAG_LAME = 0x0002,
31 TAG_VBR = 0x0100
34 enum {
35 TAG_XING_FRAMES = 0x00000001L,
36 TAG_XING_BYTES = 0x00000002L,
37 TAG_XING_TOC = 0x00000004L,
38 TAG_XING_SCALE = 0x00000008L
41 enum {
42 TAG_LAME_NSPSYTUNE = 0x01,
43 TAG_LAME_NSSAFEJOINT = 0x02,
44 TAG_LAME_NOGAP_NEXT = 0x04,
45 TAG_LAME_NOGAP_PREV = 0x08,
46 TAG_LAME_UNWISE = 0x10
49 enum tag_lame_vbr {
50 TAG_LAME_VBR_CONSTANT = 1,
51 TAG_LAME_VBR_ABR = 2,
52 TAG_LAME_VBR_METHOD1 = 3,
53 TAG_LAME_VBR_METHOD2 = 4,
54 TAG_LAME_VBR_METHOD3 = 5,
55 TAG_LAME_VBR_METHOD4 = 6,
56 TAG_LAME_VBR_CONSTANT2PASS = 8,
57 TAG_LAME_VBR_ABR2PASS = 9
60 enum tag_lame_source {
61 TAG_LAME_SOURCE_32LOWER = 0x00,
62 TAG_LAME_SOURCE_44_1 = 0x01,
63 TAG_LAME_SOURCE_48 = 0x02,
64 TAG_LAME_SOURCE_HIGHER48 = 0x03
67 enum tag_lame_mode {
68 TAG_LAME_MODE_MONO = 0x00,
69 TAG_LAME_MODE_STEREO = 0x01,
70 TAG_LAME_MODE_DUAL = 0x02,
71 TAG_LAME_MODE_JOINT = 0x03,
72 TAG_LAME_MODE_FORCE = 0x04,
73 TAG_LAME_MODE_AUTO = 0x05,
74 TAG_LAME_MODE_INTENSITY = 0x06,
75 TAG_LAME_MODE_UNDEFINED = 0x07
78 enum tag_lame_surround {
79 TAG_LAME_SURROUND_NONE = 0,
80 TAG_LAME_SURROUND_DPL = 1,
81 TAG_LAME_SURROUND_DPL2 = 2,
82 TAG_LAME_SURROUND_AMBISONIC = 3
85 enum tag_lame_preset {
86 TAG_LAME_PRESET_NONE = 0,
87 TAG_LAME_PRESET_V9 = 410,
88 TAG_LAME_PRESET_V8 = 420,
89 TAG_LAME_PRESET_V7 = 430,
90 TAG_LAME_PRESET_V6 = 440,
91 TAG_LAME_PRESET_V5 = 450,
92 TAG_LAME_PRESET_V4 = 460,
93 TAG_LAME_PRESET_V3 = 470,
94 TAG_LAME_PRESET_V2 = 480,
95 TAG_LAME_PRESET_V1 = 490,
96 TAG_LAME_PRESET_V0 = 500,
97 TAG_LAME_PRESET_R3MIX = 1000,
98 TAG_LAME_PRESET_STANDARD = 1001,
99 TAG_LAME_PRESET_EXTREME = 1002,
100 TAG_LAME_PRESET_INSANE = 1003,
101 TAG_LAME_PRESET_STANDARD_FAST = 1004,
102 TAG_LAME_PRESET_EXTREME_FAST = 1005,
103 TAG_LAME_PRESET_MEDIUM = 1006,
104 TAG_LAME_PRESET_MEDIUM_FAST = 1007
107 struct tag_xing {
108 long flags; /* valid fields (see below) */
109 unsigned long frames; /* total number of frames */
110 unsigned long bytes; /* total number of bytes */
111 unsigned char toc[100]; /* 100-point seek table */
112 long scale; /* VBR quality indicator (0 best - 100 worst) */
115 enum tag_rgain_name {
116 TAG_RGAIN_NAME_NOT_SET = 0x0,
117 TAG_RGAIN_NAME_RADIO = 0x1,
118 TAG_RGAIN_NAME_AUDIOPHILE = 0x2
121 enum tag_rgain_originator {
122 TAG_RGAIN_ORIGINATOR_UNSPECIFIED = 0x0,
123 TAG_RGAIN_ORIGINATOR_PRESET = 0x1,
124 TAG_RGAIN_ORIGINATOR_USER = 0x2,
125 TAG_RGAIN_ORIGINATOR_AUTOMATIC = 0x3
128 struct tag_rgain {
129 enum tag_rgain_name name;
130 enum tag_rgain_originator originator;
131 signed short adjustment;
134 struct tag_lame {
135 unsigned char revision;
136 unsigned char flags;
138 enum tag_lame_vbr vbr_method;
139 unsigned short lowpass_filter;
141 mad_fixed_t peak;
142 struct tag_rgain replay_gain[2];
144 unsigned char ath_type;
145 unsigned char bitrate;
147 unsigned short start_delay;
148 unsigned short end_padding;
150 enum tag_lame_source source_samplerate;
151 enum tag_lame_mode stereo_mode;
152 unsigned char noise_shaping;
154 signed char gain;
155 enum tag_lame_surround surround;
156 enum tag_lame_preset preset;
158 unsigned long music_length;
159 unsigned short music_crc;
162 struct tag {
163 int flags;
164 struct tag_xing xing;
165 struct tag_lame lame;
166 char encoder[21];
169 void tag_init(struct tag *);
171 # define tag_finish(tag) /* nothing */
173 int tag_parse(struct tag *, struct mad_stream const *);
174 void tag_parse_rgain(struct tag_rgain *, struct mad_bitptr *);
176 # endif