2004-02-24 00:41:20 +01:00
|
|
|
/* the Music Player Daemon (MPD)
|
2007-04-05 05:22:33 +02:00
|
|
|
* Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
|
2004-02-24 00:41:20 +01:00
|
|
|
* This project's homepage is: http://www.musicpd.org
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TAG_H
|
|
|
|
#define TAG_H
|
|
|
|
|
2004-03-18 04:29:25 +01:00
|
|
|
#include "../config.h"
|
|
|
|
|
2004-11-10 22:58:27 +01:00
|
|
|
#include "mpd_types.h"
|
|
|
|
|
2004-06-01 14:50:15 +02:00
|
|
|
#ifdef HAVE_ID3TAG
|
|
|
|
#include <id3tag.h>
|
|
|
|
#endif
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2008-08-26 08:27:09 +02:00
|
|
|
enum tag_type {
|
|
|
|
TAG_ITEM_ARTIST,
|
|
|
|
TAG_ITEM_ALBUM,
|
|
|
|
TAG_ITEM_TITLE,
|
|
|
|
TAG_ITEM_TRACK,
|
|
|
|
TAG_ITEM_NAME,
|
|
|
|
TAG_ITEM_GENRE,
|
|
|
|
TAG_ITEM_DATE,
|
|
|
|
TAG_ITEM_COMPOSER,
|
|
|
|
TAG_ITEM_PERFORMER,
|
|
|
|
TAG_ITEM_COMMENT,
|
|
|
|
TAG_ITEM_DISC,
|
|
|
|
TAG_NUM_OF_ITEM_TYPES
|
|
|
|
};
|
2004-11-10 22:58:27 +01:00
|
|
|
|
2008-02-05 11:17:33 +01:00
|
|
|
extern const char *mpdTagItemKeys[];
|
2004-11-10 22:58:27 +01:00
|
|
|
|
|
|
|
typedef struct _MpdTagItem {
|
2008-08-26 08:27:09 +02:00
|
|
|
enum tag_type type;
|
2006-07-20 18:02:40 +02:00
|
|
|
char *value;
|
2004-11-10 22:58:27 +01:00
|
|
|
} MpdTagItem;
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
typedef struct _MpdTag {
|
2004-03-11 01:16:49 +01:00
|
|
|
int time;
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTagItem *items;
|
2004-11-10 22:58:27 +01:00
|
|
|
mpd_uint8 numOfItems;
|
2004-02-24 00:41:20 +01:00
|
|
|
} MpdTag;
|
|
|
|
|
2004-06-01 14:50:15 +02:00
|
|
|
#ifdef HAVE_ID3TAG
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTag *parseId3Tag(struct id3_tag *);
|
2004-06-01 14:50:15 +02:00
|
|
|
#endif
|
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTag *apeDup(char *file);
|
2005-03-07 01:51:21 +01:00
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTag *id3Dup(char *file);
|
2004-05-31 03:21:17 +02:00
|
|
|
|
2006-08-20 02:50:44 +02:00
|
|
|
MpdTag *newMpdTag(void);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-08-20 02:50:44 +02:00
|
|
|
void initTagConfig(void);
|
2004-11-10 22:58:27 +01:00
|
|
|
|
2008-08-26 08:27:09 +02:00
|
|
|
void clearItemsFromMpdTag(MpdTag * tag, enum tag_type itemType);
|
2004-11-10 22:58:27 +01:00
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
void freeMpdTag(MpdTag * tag);
|
|
|
|
|
2008-08-26 08:27:09 +02:00
|
|
|
void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType,
|
|
|
|
char *value, int len);
|
2004-11-10 22:58:27 +01:00
|
|
|
|
|
|
|
#define addItemToMpdTag(tag, itemType, value) \
|
|
|
|
addItemToMpdTagWithLen(tag, itemType, value, strlen(value))
|
|
|
|
|
2007-03-31 20:43:16 +02:00
|
|
|
void printTagTypes(int fd);
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
void printMpdTag(int fd, MpdTag * tag);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTag *mpdTagDup(MpdTag * tag);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2004-06-01 12:28:06 +02:00
|
|
|
int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2);
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#endif
|