public function getStateDetails(): StateInterface
    {
        $data = $this->soap("AVTransport", "GetPositionInfo");

        # Check for line in mode
        if ($data["TrackMetaData"] === "NOT_IMPLEMENTED") {
            $state = new State($data["TrackURI"]);
            $state->setStream(new Stream("x-rincon-stream:" . $this->getUuid(), "Line-In"));
            return $state;
        }

        # Check for an empty queue
        if (!$data["TrackMetaData"]) {
            return new State();
        }

        $parser = new XmlParser($data["TrackMetaData"]);
        $state = State::createFromXml($parser->getTag("item"), $this);

        if ((string) $parser->getTag("streamContent")) {
            $info = $this->getMediaInfo();
            $meta = new XmlParser($info["CurrentURIMetaData"]);
            if ($title = (string) $meta->getTag("title")) {
                $state->setStream(new Stream("", $title));
            } else {
                $state->setStream(new Stream("", $parser->getTag("title")));
            }
        }

        $state->setNumber($data["Track"]);
        $state->setDuration(Time::parse($data["TrackDuration"]));
        $state->setPosition(Time::parse($data["RelTime"]));

        # If we have a queue number, it'll be one-based, rather than zero-based, so convert it
        if ($state->getNumber() > 0) {
            $state->setNumber($state->getNumber() - 1);
        }

        return $state;
    }