1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00
icecast-server/src/playlist.h
Philipp Schafft 5f77b35d14 Initial patch for playlist history support.
This allows to store a history of played songs along the source
object and report it as part of the status XML.

Additional work needs to be done to make this configurable.
Also format_mp3.c needs work to support this.

A generic song changed handler should be implemented to handle this
in a nice way.
That one should also be the point to call logging_playlist().

See: #766
2015-03-28 16:15:49 +00:00

39 lines
1.1 KiB
C

/* Icecast
*
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2015, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
#ifndef __PLAYLIST_H__
#define __PLAYLIST_H__
#include <vorbis/codec.h>
typedef struct playlist_tag playlist_t;
playlist_t * playlist_new(ssize_t max_tracks);
int playlist_ref(playlist_t *playlist);
int playlist_release(playlist_t *playlist);
/* set maximum size of playlist.
* Will not reduce number of tracks if there are more in the list
* than the new limit.
*/
int playlist_set_max_tracks(playlist_t *playlist, ssize_t max_tracks);
/* push a new track at the end of the playlist.
* If the playlist is already at maximum size the oldest track
* is automatically removed.
*/
int playlist_push_track(playlist_t *playlist, vorbis_comment *vc);
/* this function returns the root node of the playlist.
* If you want to use this for file output you need to generate
* your own xmlDocPtr and attach it as root node.
*/
xmlNodePtr playlist_render_xspf(playlist_t *playlist);
#endif