2009-03-13 18:43:16 +01:00
|
|
|
/*
|
2015-01-01 19:48:13 +01:00
|
|
|
* Copyright (C) 2003-2015 The Music Player Daemon Project
|
2009-03-13 18:43:16 +01:00
|
|
|
* http://www.musicpd.org
|
2007-05-16 14:02:10 +02:00
|
|
|
*
|
|
|
|
* 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.
|
2009-03-13 18:43:16 +01:00
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-05-16 14:02:10 +02:00
|
|
|
*/
|
|
|
|
|
2012-09-28 00:40:00 +02:00
|
|
|
#ifndef MPD_PLAYLIST_FILE_HXX
|
|
|
|
#define MPD_PLAYLIST_FILE_HXX
|
2007-05-16 14:02:10 +02:00
|
|
|
|
2012-09-27 23:48:29 +02:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2014-01-07 21:39:47 +01:00
|
|
|
class DetachedSong;
|
2014-02-03 23:30:34 +01:00
|
|
|
class SongLoader;
|
2013-01-04 00:02:09 +01:00
|
|
|
class PlaylistVector;
|
2013-08-10 18:02:44 +02:00
|
|
|
class Error;
|
2015-03-24 20:40:35 +01:00
|
|
|
class AllocatedPath;
|
2012-09-27 23:48:29 +02:00
|
|
|
|
|
|
|
typedef std::vector<std::string> PlaylistFileContents;
|
|
|
|
|
2009-01-25 13:53:16 +01:00
|
|
|
extern bool playlist_saveAbsolutePaths;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Perform some global initialization, e.g. load configuration values.
|
|
|
|
*/
|
|
|
|
void
|
2015-03-03 20:05:08 +01:00
|
|
|
spl_global_init();
|
2009-01-25 13:53:16 +01:00
|
|
|
|
2009-01-25 14:19:28 +01:00
|
|
|
/**
|
|
|
|
* Determines whether the specified string is a valid name for a
|
|
|
|
* stored playlist.
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
spl_valid_name(const char *name_utf8);
|
|
|
|
|
2015-03-24 20:40:35 +01:00
|
|
|
AllocatedPath
|
|
|
|
spl_map_to_fs(const char *name_utf8, Error &error);
|
|
|
|
|
2008-10-22 19:15:50 +02:00
|
|
|
/**
|
|
|
|
* Returns a list of stored_playlist_info struct pointers. Returns
|
2013-10-02 08:13:28 +02:00
|
|
|
* nullptr if an error occurred.
|
2008-10-22 19:15:50 +02:00
|
|
|
*/
|
2013-01-04 00:02:09 +01:00
|
|
|
PlaylistVector
|
2013-08-10 18:02:44 +02:00
|
|
|
ListPlaylistFiles(Error &error);
|
2008-10-22 19:15:50 +02:00
|
|
|
|
2012-09-27 23:48:29 +02:00
|
|
|
PlaylistFileContents
|
2013-08-10 18:02:44 +02:00
|
|
|
LoadPlaylistFile(const char *utf8path, Error &error);
|
2008-10-23 09:54:28 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
|
|
|
spl_move_index(const char *utf8path, unsigned src, unsigned dest,
|
2013-08-10 18:02:44 +02:00
|
|
|
Error &error);
|
2007-05-16 14:02:10 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2013-08-10 18:02:44 +02:00
|
|
|
spl_clear(const char *utf8path, Error &error);
|
2007-05-16 14:02:10 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2013-08-10 18:02:44 +02:00
|
|
|
spl_delete(const char *name_utf8, Error &error);
|
2008-10-23 09:54:32 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2013-08-10 18:02:44 +02:00
|
|
|
spl_remove_index(const char *utf8path, unsigned pos, Error &error);
|
2008-09-07 13:44:12 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2014-01-07 21:39:47 +01:00
|
|
|
spl_append_song(const char *utf8path, const DetachedSong &song, Error &error);
|
2008-09-07 13:44:12 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2014-02-03 23:30:34 +01:00
|
|
|
spl_append_uri(const char *path_utf8,
|
|
|
|
const SongLoader &loader, const char *uri_utf8,
|
|
|
|
Error &error);
|
2008-10-22 17:23:11 +02:00
|
|
|
|
2011-09-11 07:41:25 +02:00
|
|
|
bool
|
2013-08-10 18:02:44 +02:00
|
|
|
spl_rename(const char *utf8from, const char *utf8to, Error &error);
|
2007-05-24 20:07:19 +02:00
|
|
|
|
2012-09-27 23:48:29 +02:00
|
|
|
#endif
|