comparison src/libaudtag/wma/wma_fmt.h @ 4887:0ddbd0025174 default tip

added libaudtag. (not used yet.)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 05 May 2010 18:26:06 +0900
parents
children
comparison
equal deleted inserted replaced
4886:54b4f7aaca24 4887:0ddbd0025174
1 /*
2 * Copyright 2009 Paula Stanciu
3 *
4 * This file is part of Audacious.
5 *
6 * Audacious is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3 of the License.
9 *
10 * Audacious is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * Audacious. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * The Audacious team does not consider modular code linking to Audacious or
18 * using our public API to be a derived work.
19 */
20
21 #ifndef _WMA_FMT_H
22 #define _WMA_FMT_H
23
24 #include "guid.h"
25
26
27 #define ASF_HEADER_OBJECT_GUID "75B22630-668E-11CF-A6D900AA0062CE6C"
28 #define ASF_FILE_PROPERTIES_OBJECT_GUID "8CABDCA1-A947-11CF-8EE400C00C205365"
29 #define ASF_STREAM_PROPERTIES_OBJECT_GUID "B7DC0791-A9B7-11CF-8EE600C00C205365"
30 #define ASF_HEADER_EXTENSION_OBJECT_GUID "5FBF03B5-A92E-11CF-8EE300C00C205365"
31 #define ASF_CODEC_LIST_OBJECT_GUID "86D15240-311D-11D0-A3A400A0C90348F6"
32 #define ASF_SCRIPT_COMMAND_OBJECT_GUID "1EFB1A30-0B62-11D0-A39B00A0C90348F6"
33 #define ASF_MARKER_OBJECT_GUID "F487CD01-A951-11CF-8EE600C00C205365"
34 #define ASF_BITRATE_MUTUAL_EXCLUSION_OBJECT_GUID "D6E229DC-35DA-11D1-903400A0C90349BE"
35 #define ASF_ERROR_CORRECTION_OBJECT_GUID "75B22635-668E-11CF-A6D900AA0062CE6C"
36 #define ASF_CONTENT_DESCRIPTION_OBJECT_GUID "75B22633-668E-11CF-A6D900AA0062CE6C"
37 #define ASF_EXTENDED_CONTENT_DESCRIPTION_OBJECT_GUID "D2D0A440-E307-11D2-97F000A0C95EA850"
38 #define ASF_CONTENT_BRANDING_OBJECT_GUID "2211B3FA-BD23-11D2-B4B700A0C955FC6E"
39 #define ASF_STREAM_BITRATE_PROPERTIES_OBJECT_GUID "7BF875CE-468D-11D1-8D82006097C9A2B2"
40 #define ASF_CONTENT_ENCRYPTION_OBJECT_GUID "2211B3FB-BD23-11D2-B4B700A0C955FC6E"
41 #define ASF_EXTENDED_CONTENT_ENCRYPTION_OBJECT_GUID "298AE614-2622-4C17-B935DAE07EE9289C"
42 #define ASF_DIGITAL_SIGNATURE_OBJECT_GUID "2211B3FC-BD23-11D2-B4B700A0C955FC6E"
43 #define ASF_PADDING_OBJECT_GUID "1806D474-CADF-4509-A4BA9AABCB96AAE8"
44
45 typedef enum {
46 ASF_HEADER_OBJECT = 0,
47 ASF_FILE_PROPERTIES_OBJECT, /* 1 */
48 ASF_STREAM_PROPERTIES_OBJECT,
49 ASF_HEADER_EXTENSION_OBJECT,
50 ASF_CODEC_LIST_OBJECT,
51 ASF_SCRIPT_COMMAND_OBJECT, /* 5 */
52 ASF_MARKER_OBJECT,
53 ASF_BITRATE_MUTUAL_EXCLUSION_OBJECT,
54 ASF_ERROR_CORRECTION_OBJECT,
55 ASF_CONTENT_DESCRIPTION_OBJECT,
56 ASF_EXTENDED_CONTENT_DESCRIPTION_OBJECT, /* 10*/
57 ASF_CONTENT_BRANDING_OBJECT,
58 ASF_STREAM_BITRATE_PROPERTIES_OBJECT,
59 ASF_CONTENT_ENCRYPTION_OBJECT,
60 ASF_EXTENDED_CONTENT_ENCRYPTION_OBJECT,
61 ASF_DIGITAL_SIGNATURE_OBJECT, /* 15 */
62 ASF_PADDING_OBJECT,
63 ASF_OBJECT_LAST /* dummy */
64 } ObjectType;
65
66 #define DESC_ALBUM_STR "WM/AlbumTitle"
67 #define DESC_YEAR_STR "WM/Year"
68 #define DESC_GENRE_STR "WM/Genre"
69 #define DESC_TRACK_STR "WM/TrackNumber"
70
71 typedef enum {
72 DESC_ALBUM = 0,
73 DESC_YEAR,
74 DESC_GENRE,
75 DESC_TRACK,
76 DESC_LAST
77 } DescrIndexes;
78
79 /*
80 * this should be fine for all headers whose content is irrelevant,
81 * but the size is needed so that we can skip it
82 */
83 typedef struct _generic_header {
84 GUID *guid;
85 guint64 size;
86 gchar *data;
87 } GenericHeader;
88
89 typedef struct _header_object {
90 GUID *guid;
91 guint64 size;
92 guint32 objectsNr;
93 guint8 res1;
94 guint8 res2;
95 } HeaderObj;
96
97 /*
98 * this is special, its size does not include the size of the ext_data
99 */
100 typedef struct _header_extension_object {
101 GUID *guid;
102 guint64 size;
103 guint32 objects_count;
104 guint8 res1;
105 guint8 res2;
106 guint32 ext_data_size;
107 gchar *ext_data;
108 } HeaderExtensionObject;
109
110 typedef struct _file_properties_header {
111 GUID *guid;
112 guint64 size;
113 gchar dontcare1[16];
114 guint64 duration; //expressed as the count of 100ns intervals
115 gchar dontcare2[32];
116 } FilePropertiesHeader;
117
118 typedef struct _content_description_object {
119 GUID *guid;
120 guint64 size;
121 guint16 title_length;
122 guint16 author_length;
123 guint16 copyright_length; /* dontcare*/
124 guint16 desc_length;
125 guint16 rating_length; /* dontcare*/
126 gunichar2 *title;
127 gunichar2 *author;
128 gunichar2 *copyright; /* dontcare*/
129 gunichar2 *description;
130 gunichar2 *rating; /* dontcare*/
131 } ContentDescrObj;
132
133 /* descr_val_type's meaning
134 * Value Type length
135 * 0x0000 Unicode string varies
136 * 0x0001 BYTE array varies
137 * 0x0002 BOOL 32
138 * 0x0003 DWORD 32
139 * 0x0004 QWORD 64
140 * 0x0005 WORD 16
141 */
142 typedef struct _content_descriptor {
143 guint16 name_len;
144 gunichar2 *name;
145 guint16 val_type;
146 guint16 val_len;
147 gchar * val;
148 } ContentDescriptor;
149
150 typedef struct _extended_content_description_object {
151 GUID *guid;
152 guint64 size;
153 guint16 content_desc_count;
154 ContentDescriptor **descriptors;
155 } ExtContentDescrObj;
156
157 typedef struct _content_field {
158 guint16 size;
159 gunichar2 *strValue;
160 } ContentField;
161
162 #endif /* _WMA_FMT_H */