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
|
|
|
|
|
2008-09-06 20:28:31 +02:00
|
|
|
#include "os_compat.h"
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2004-11-11 01:41:28 +01:00
|
|
|
#define SONG_BEGIN "songList begin"
|
|
|
|
#define SONG_END "songList end"
|
|
|
|
|
2006-10-28 01:07:34 +02:00
|
|
|
#define SONG_FILE "file: "
|
|
|
|
#define SONG_TIME "Time: "
|
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
struct song {
|
2008-08-29 09:38:11 +02:00
|
|
|
struct tag *tag;
|
2008-10-08 10:49:05 +02:00
|
|
|
struct directory *parentDir;
|
2004-02-24 00:41:20 +01:00
|
|
|
time_t mtime;
|
2008-10-06 18:48:45 +02:00
|
|
|
char url[sizeof(size_t)];
|
2008-10-08 10:49:11 +02:00
|
|
|
};
|
2008-10-06 18:46:52 +02:00
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
struct song *
|
2008-10-08 10:49:05 +02:00
|
|
|
song_alloc(const char *url, struct directory *parent);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
struct song *
|
|
|
|
newSong(const char *url, struct directory *parentDir);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
void
|
|
|
|
freeJustSong(struct song *);
|
2004-05-13 20:46:38 +02:00
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
int
|
|
|
|
updateSongInfo(struct song *song);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2008-04-12 06:08:18 +02:00
|
|
|
/*
|
|
|
|
* get_song_url - Returns a path of a song in UTF8-encoded form
|
|
|
|
* path_max_tmp is the argument that the URL is written to, this
|
|
|
|
* buffer is assumed to be MPD_PATH_MAX or greater (including
|
|
|
|
* terminating '\0').
|
|
|
|
*/
|
2008-10-08 10:49:11 +02:00
|
|
|
char *
|
|
|
|
get_song_url(char *path_max_tmp, struct song *song);
|
2004-11-11 03:36:25 +01:00
|
|
|
|
2008-10-08 10:49:11 +02:00
|
|
|
static inline int
|
|
|
|
song_is_file(const struct song *song)
|
2008-10-06 18:52:13 +02:00
|
|
|
{
|
|
|
|
return !!song->parentDir;
|
|
|
|
}
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#endif
|