MiniDLNA update: 1.0.19.1 to 1.0.20
[tomato.git] / release / src / router / minidlna / tagutils / tagutils.h
blob0d5f3625b6b59379c614f252ddeab938ebd1e642
1 //=========================================================================
2 // FILENAME : taguilts.h
3 // DESCRIPTION : Header for tagutils.c
4 //=========================================================================
5 // Copyright (c) 2008- NETGEAR, Inc. All Rights Reserved.
6 //=========================================================================
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.
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.
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/>.
24 * This file is derived from mt-daap project.
27 #ifndef _TAG_H_
28 #define _TAG_H_
30 #include <stdio.h>
31 #include <sys/types.h>
32 #include <sys/stat.h>
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
45 struct 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;
53 char *image; // coverart
54 int image_size;
56 char *title; // TIT2
57 char *album; // TALB
58 char *genre; // TCON
59 char *comment; // COMM
61 char *contributor[N_ROLE]; // TPE1 (artist)
62 // TCOM (composer)
63 // TPE3 (conductor)
64 // TPE2 (orchestra)
65 char *contributor_sort[N_ROLE];
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
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;
89 char *mime; // MIME type
90 char *dlna_pn; // DLNA Profile Name
92 char *tagversion;
94 unsigned long album_id;
95 unsigned long track_id;
96 unsigned long genre_id;
97 unsigned long contributor_id[N_ROLE];
99 char *musicbrainz_albumid;
100 char *musicbrainz_trackid;
101 char *musicbrainz_artistid;
102 char *musicbrainz_albumartistid;
104 int is_plist;
105 int plist_position;
106 int plist_id;
109 #define WMA 0x161
110 #define WMAPRO 0x162
111 #define WMALSL 0x163
113 extern int scan_init(char *path);
114 extern void make_composite_tags(struct song_metadata *psong);
115 extern int readtags(char *path, struct song_metadata *psong, struct stat *stat, char *lang, char *type);
116 extern void freetags(struct song_metadata *psong);
118 extern int start_plist(const char *path, struct song_metadata *psong, struct stat *stat, char *lang, char *type);
119 extern int next_plist_track(struct song_metadata *psong, struct stat *stat, char *lang, char *type);
121 #endif