public function setState($state)
{
switch ($state) {
case self::STATE_PLAYING:
return $this->play();
case self::STATE_PAUSED:
return $this->pause();
case self::STATE_STOPPED:
return $this->pause();
}
throw new \InvalidArgumentException("Unknown state: {$state})");
}