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 SONG_H
|
|
|
|
#define SONG_H
|
|
|
|
|
2004-03-18 04:29:25 +01:00
|
|
|
#include "../config.h"
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include "tag.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
2004-11-11 01:41:28 +01:00
|
|
|
#define SONG_BEGIN "songList begin"
|
|
|
|
#define SONG_END "songList end"
|
|
|
|
|
|
|
|
#define SONG_TYPE_FILE 1
|
|
|
|
#define SONG_TYPE_URL 2
|
2004-05-13 20:16:03 +02:00
|
|
|
|
2006-10-28 01:07:34 +02:00
|
|
|
#define SONG_FILE "file: "
|
|
|
|
#define SONG_TIME "Time: "
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
typedef struct _Song {
|
2006-07-20 18:02:40 +02:00
|
|
|
char *url;
|
2004-11-11 01:41:28 +01:00
|
|
|
mpd_sint8 type;
|
2006-07-20 18:02:40 +02:00
|
|
|
MpdTag *tag;
|
|
|
|
struct _Directory *parentDir;
|
2004-02-24 00:41:20 +01:00
|
|
|
time_t mtime;
|
|
|
|
} Song;
|
|
|
|
|
|
|
|
typedef List SongList;
|
|
|
|
|
2006-08-20 02:50:44 +02:00
|
|
|
Song *newNullSong(void);
|
2004-05-31 13:42:46 +02:00
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
Song *newSong(char *url, int songType, struct _Directory *parentDir);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
void freeSong(Song *);
|
|
|
|
|
2004-05-13 20:46:38 +02:00
|
|
|
void freeJustSong(Song *);
|
|
|
|
|
2006-08-20 02:50:44 +02:00
|
|
|
SongList *newSongList(void);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
void freeSongList(SongList * list);
|
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
Song *addSongToList(SongList * list, char *url, char *utf8path,
|
|
|
|
int songType, struct _Directory *parentDir);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int printSongInfo(int fd, Song * song);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int printSongInfoFromList(int fd, SongList * list);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
void writeSongInfoFromList(FILE * fp, SongList * list);
|
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
void readSongInfoIntoList(FILE * fp, SongList * list,
|
|
|
|
struct _Directory *parent);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
int updateSongInfo(Song * song);
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
void printSongUrl(int fd, Song * song);
|
2004-11-11 01:41:28 +01:00
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
char *getSongUrl(Song * song);
|
2004-11-11 03:36:25 +01:00
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#endif
|