1//=========================================================================
2// FILENAME	: taguilts.h
3// DESCRIPTION	: Header for tagutils.c
4//=========================================================================
5// Copyright (c) 2008- NETGEAR, Inc. All Rights Reserved.
6//=========================================================================
7
8/*
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23/*
24 * This file is derived from mt-daap project.
25 */
26
27#ifndef _TAG_H_
28#define _TAG_H_
29
30#include <stdio.h>
31#include <sys/types.h>
32#include <sys/stat.h>
33
34#define ROLE_NOUSE 0
35#define ROLE_START 1
36#define ROLE_ARTIST 1
37#define ROLE_TRACKARTIST 2
38#define ROLE_ALBUMARTIST 3
39#define ROLE_BAND 4
40#define ROLE_CONDUCTOR 5
41#define ROLE_COMPOSER 6
42#define ROLE_LAST 6
43#define N_ROLE 7
44
45struct song_metadata {
46	int file_size;
47	char *dirpath;
48	char *path;
49	char *basename;                         // basename is part of path
50	char *type;
51	int time_modified;
52
53	char *image;                            // coverart
54	int image_size;
55
56	char *title;                            // TIT2
57	char *album;                            // TALB
58	char *genre;                            // TCON
59	char *comment;                          // COMM
60
61	char *contributor[N_ROLE];              // TPE1  (artist)
62						// TCOM  (composer)
63						// TPE3  (conductor)
64						// TPE2  (orchestra)
65	char *contributor_sort[N_ROLE];
66
67
68	char *grouping;                         // TIT1
69	int year;                               // TDRC
70	int track;                              // TRCK
71	int total_tracks;                       // TRCK
72	int disc;                               // TPOS
73	int total_discs;                        // TPOS
74	int bpm;                                // TBPM
75	char compilation;                       // YTCP
76
77	int bitrate;
78	int max_bitrate;
79	int samplerate;
80	int samplesize;
81	int channels;
82	int song_length;                        // TLEN
83	int audio_size;
84	int audio_offset;
85	int vbr_scale;
86	int lossless;
87	int blockalignment;
88
89	char *mime;				// MIME type
90	char *dlna_pn;				// DLNA Profile Name
91
92	char *tagversion;
93
94	unsigned long album_id;
95	unsigned long track_id;
96	unsigned long genre_id;
97	unsigned long contributor_id[N_ROLE];
98
99	char *musicbrainz_albumid;
100	char *musicbrainz_trackid;
101	char *musicbrainz_artistid;
102	char *musicbrainz_albumartistid;
103
104	int is_plist;
105	int plist_position;
106	int plist_id;
107};
108
109#define WMA     0x161
110#define WMAPRO  0x162
111#define WMALSL  0x163
112
113extern int scan_init(char *path);
114extern void make_composite_tags(struct song_metadata *psong);
115extern int readtags(char *path, struct song_metadata *psong, struct stat *stat, char *lang, char *type);
116extern void freetags(struct song_metadata *psong);
117
118extern int start_plist(const char *path, struct song_metadata *psong, struct stat *stat, char *lang, char *type);
119extern int next_plist_track(struct song_metadata *psong, struct stat *stat, char *lang, char *type);
120
121#endif
122