queue/Playlist: add interface QueueListener, replacing calls to idle_add()

This commit is contained in:
Max Kellermann
2016-03-10 20:10:14 +01:00
parent ba43ec5759
commit 9a9b6fa326
8 changed files with 88 additions and 14 deletions

View File

@@ -29,7 +29,7 @@ Partition::Partition(Instance &_instance,
unsigned max_length,
unsigned buffer_chunks,
unsigned buffered_before_play)
:instance(_instance), playlist(max_length),
:instance(_instance), playlist(max_length, *this),
outputs(*this),
pc(*this, outputs, buffer_chunks, buffered_before_play)
{
@@ -74,6 +74,24 @@ Partition::SyncWithPlayer()
playlist.SyncWithPlayer(pc);
}
void
Partition::OnQueueModified()
{
EmitIdle(IDLE_PLAYLIST);
}
void
Partition::OnQueueOptionsChanged()
{
EmitIdle(IDLE_OPTIONS);
}
void
Partition::OnQueueSongStarted()
{
EmitIdle(IDLE_PLAYER);
}
void
Partition::OnPlayerSync()
{