Example #1
0
bool Quartet::addInstrument(Handler<Instrument> const& inst)
{
	if(std::find_if(this->players_.begin(), this->players_.end(), PlayerFinder(inst)) != this->players_.end()){
		return false;
	}
	{
		Lock lock(*this);
		inst->onConnected(self(), this->realSpec_);
		this->players_.push_back(Player(inst, inst->spec().byteLength()*this->realSpec_.samples()));
	}
	if(this->startRequested_.load()){
		this->startInner();
	}
	return true;
}