output/Multiple: move Wait() to struct PlayerControl
Eliminate a dependency from MultipleOutputs on PlayerControl.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user