duncan3dc\Sonos\Controller::exportState PHP Method

exportState() public method

Grab the current state of the Controller (including it's queue and playing attributes).
public exportState ( boolean $pause = true ) : duncan3dc\Sonos\ControllerState
$pause boolean Whether to pause the controller or not
return duncan3dc\Sonos\ControllerState
    public function exportState($pause = true)
    {
        if ($pause) {
            $state = $this->getState();
            if ($state === self::STATE_PLAYING) {
                $this->pause();
            }
        }
        $export = new ControllerState($this);
        if ($pause) {
            $export->state = $state;
        }
        return $export;
    }