PlaylistRegistry.hxx 2.06 KB
Newer Older
1
/*
Max Kellermann's avatar
Max Kellermann committed
2
 * Copyright 2003-2017 The Music Player Daemon Project
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 * 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.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

20 21
#ifndef MPD_PLAYLIST_REGISTRY_HXX
#define MPD_PLAYLIST_REGISTRY_HXX
22

23 24
#include "input/Ptr.hxx"

25 26
class Mutex;
class Cond;
27
class SongEnumerator;
28

29 30 31 32 33
extern const struct playlist_plugin *const playlist_plugins[];

#define playlist_plugins_for_each(plugin) \
	for (const struct playlist_plugin *plugin, \
		*const*playlist_plugin_iterator = &playlist_plugins[0]; \
34
		(plugin = *playlist_plugin_iterator) != nullptr; \
35 36
		++playlist_plugin_iterator)

37 38 39 40
/**
 * Initializes all playlist plugins.
 */
void
41
playlist_list_global_init();
42 43 44 45 46

/**
 * Deinitializes all playlist plugins.
 */
void
47
playlist_list_global_finish();
48 49 50 51

/**
 * Opens a playlist by its URI.
 */
52
SongEnumerator *
53
playlist_list_open_uri(const char *uri, Mutex &mutex, Cond &cond);
54

55
SongEnumerator *
56
playlist_list_open_stream_suffix(InputStreamPtr &&is, const char *suffix);
57

58 59 60
/**
 * Opens a playlist from an input stream.
 *
61
 * @param is an #InputStream object which is open and ready
62 63 64
 * @param uri optional URI which was used to open the stream; may be
 * used to select the appropriate playlist plugin
 */
65
SongEnumerator *
66
playlist_list_open_stream(InputStreamPtr &&is, const char *uri);
67

68 69 70 71 72 73 74
/**
 * Determines if there is a playlist plugin which can handle the
 * specified file name suffix.
 */
bool
playlist_suffix_supported(const char *suffix);

75
#endif