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, write to the Free Software 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 */ 23 24/* 25 * This file is derived from mt-daap project. 26 */ 27 28#ifndef _TAG_H_ 29#define _TAG_H_ 30 31#include <stdio.h> 32#include <sys/types.h> 33#include <sys/stat.h> 34 35#define ROLE_NOUSE 0 36#define ROLE_START 1 37#define ROLE_ARTIST 1 38#define ROLE_COMPOSER 2 39#define ROLE_CONDUCTOR 3 40#define ROLE_BAND 4 41#define ROLE_ALBUMARTIST 5 42#define ROLE_TRACKARTIST 6 43#define ROLE_LAST 6 44#define N_ROLE 7 45 46struct song_metadata { 47 int file_size; 48 char *dirpath; 49 char *path; 50 char *basename; // basename is part of path 51 char *type; 52 int time_modified; 53 54 char *image; // coverart 55 int image_size; 56 57 char *title; // TIT2 58 char *album; // TALB 59 char *genre; // TCON 60 char *comment; // COMM 61 62 char *contributor[N_ROLE]; // TPE1 (artist) 63 // TCOM (composer) 64 // TPE3 (conductor) 65 // TPE2 (orchestra) 66 char *contributor_sort[N_ROLE]; 67 68 69 char *grouping; // TIT1 70 int year; // TDRC 71 int track; // TRCK 72 int total_tracks; // TRCK 73 int disc; // TPOS 74 int total_discs; // TPOS 75 int bpm; // TBPM 76 char compilation; // YTCP 77 78 int 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 WMAV1 0x161 110#define WMAV2 0x162 111#define WMAPRO 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