Partition: new class, container for Playlist and PlayerControl

This is the beginning of multi-player support.  There will be support
for multiple Partition objects in one MPD process.
This commit is contained in:
Max Kellermann
2013-01-04 22:42:05 +01:00
parent 1a8ef3cdab
commit d536944beb
11 changed files with 103 additions and 60 deletions

View File

@@ -25,36 +25,28 @@
#include "config.h"
#include "Playlist.hxx"
#include "Main.hxx"
#include "Partition.hxx"
extern "C" {
#include "event_pipe.h"
}
struct playlist g_playlist;
static void
playlist_tag_event(void)
{
playlist_tag_changed(&g_playlist);
playlist_tag_changed(&global_partition->playlist);
}
static void
playlist_event(void)
{
playlist_sync(&g_playlist, global_player_control);
playlist_sync(&global_partition->playlist,
&global_partition->pc);
}
void
playlist_global_init(unsigned max_length)
playlist_global_init()
{
playlist_init(&g_playlist, max_length);
event_pipe_register(PIPE_EVENT_TAG, playlist_tag_event);
event_pipe_register(PIPE_EVENT_PLAYLIST, playlist_event);
}
void
playlist_global_finish(void)
{
playlist_finish(&g_playlist);
}