2004-02-24 00:41:20 +01:00
|
|
|
/* the Music Player Daemon (MPD)
|
2006-07-14 21:37:45 +02:00
|
|
|
* (c)2003-2006 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 PLAYLIST_H
|
|
|
|
#define PLAYLIST_H
|
|
|
|
|
2004-03-18 04:29:25 +01:00
|
|
|
#include "../config.h"
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#include "song.h"
|
2004-06-05 03:14:37 +02:00
|
|
|
#include "mpd_types.h"
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#define PLAYLIST_FILE_SUFFIX "m3u"
|
|
|
|
|
|
|
|
void initPlaylist();
|
|
|
|
|
|
|
|
void finishPlaylist();
|
|
|
|
|
|
|
|
void readPlaylistState();
|
|
|
|
|
|
|
|
void savePlaylistState();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int clearPlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int addToPlaylist(int fd, char *file, int printId);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int addSongToPlaylist(int fd, Song * song, int printId);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int showPlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int deleteFromPlaylist(int fd, int song);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int deleteFromPlaylistById(int fd, int song);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playlistInfo(int fd, int song);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playlistId(int fd, int song);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int stopPlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playPlaylist(int fd, int song, int stopOnError);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playPlaylistById(int fd, int song, int stopOnError);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int nextSongInPlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
void syncPlayerAndPlaylist();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int previousSongInPlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int shufflePlaylist(int fd);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int savePlaylist(int fd, char *utf8file);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int deletePlaylist(int fd, char *utf8file);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int deletePlaylistById(int fd, char *utf8file);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
void deleteASongFromPlaylist(Song * song);
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int moveSongInPlaylist(int fd, int from, int to);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int moveSongInPlaylistById(int fd, int id, int to);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int swapSongsInPlaylist(int fd, int song1, int song2);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int swapSongsInPlaylistById(int fd, int id1, int id2);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int loadPlaylist(int fd, char *utf8file);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
int getPlaylistRepeatStatus();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int setPlaylistRepeatStatus(int fd, int status);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
int getPlaylistRandomStatus();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int setPlaylistRandomStatus(int fd, int status);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
|
|
|
int getPlaylistCurrentSong();
|
|
|
|
|
2004-06-09 04:50:44 +02:00
|
|
|
int getPlaylistSongId(int song);
|
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
int getPlaylistLength();
|
|
|
|
|
|
|
|
unsigned long getPlaylistVersion();
|
|
|
|
|
|
|
|
void playPlaylistIfPlayerStopped();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int seekSongInPlaylist(int fd, int song, float time);
|
2004-02-24 00:41:20 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int seekSongInPlaylistById(int fd, int id, float time);
|
2004-06-09 04:50:44 +02:00
|
|
|
|
2004-06-05 03:14:37 +02:00
|
|
|
void playlistVersionChange();
|
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playlistChanges(int fd, mpd_uint32 version);
|
2004-03-10 11:00:47 +01:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int playlistChangesPosId(int fd, mpd_uint32 version);
|
2006-04-23 13:10:41 +02:00
|
|
|
|
2006-07-30 05:43:38 +02:00
|
|
|
int PlaylistInfo(int fd, char *utf8file, int detail);
|
2006-03-26 15:46:05 +02:00
|
|
|
|
2006-07-20 18:02:40 +02:00
|
|
|
char *getStateFile();
|
2006-03-26 15:46:05 +02:00
|
|
|
|
2004-02-24 00:41:20 +01:00
|
|
|
#endif
|