output/Multiple: move Wait() to struct PlayerControl

Eliminate a dependency from MultipleOutputs on PlayerControl.
This commit is contained in:
Max Kellermann
2016-12-14 12:54:19 +01:00
parent 7c6b0d5c31
commit ece5971027
5 changed files with 32 additions and 29 deletions

View File

@@ -21,6 +21,7 @@
#include "Control.hxx"
#include "Idle.hxx"
#include "DetachedSong.hxx"
#include "output/MultipleOutputs.hxx"
#include <algorithm>
@@ -46,6 +47,18 @@ PlayerControl::~PlayerControl()
delete tagged_song;
}
bool
PlayerControl::WaitOutputConsumed(unsigned threshold)
{
bool result = outputs.Check() < threshold;
if (!result && command == PlayerCommand::NONE) {
Wait();
result = outputs.Check() < threshold;
}
return result;
}
void
PlayerControl::Play(DetachedSong *song)
{