<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: livekit_room.proto

namespace Livekit;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Generated from protobuf message <code>livekit.RoomConfiguration</code>
 */
class RoomConfiguration extends \Google\Protobuf\Internal\Message
{
    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     */
    protected $empty_timeout = 0;
    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     */
    protected $departure_timeout = 0;
    /**
     * limit number of participants that can be in a room
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     */
    protected $max_participants = 0;
    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 5;</code>
     */
    protected $egress = null;
    /**
     * agent
     *
     * Generated from protobuf field <code>.livekit.RoomAgent agent = 6;</code>
     */
    protected $agent = null;
    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     */
    protected $min_playout_delay = 0;
    /**
     * Generated from protobuf field <code>uint32 max_playout_delay = 8;</code>
     */
    protected $max_playout_delay = 0;
    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     */
    protected $sync_streams = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Used as ID, must be unique
     *     @type int $empty_timeout
     *           number of seconds to keep the room open if no one joins
     *     @type int $departure_timeout
     *           number of seconds to keep the room open after everyone leaves
     *     @type int $max_participants
     *           limit number of participants that can be in a room
     *     @type \Livekit\RoomEgress $egress
     *           egress
     *     @type \Livekit\RoomAgent $agent
     *           agent
     *     @type int $min_playout_delay
     *           playout delay of subscriber
     *     @type int $max_playout_delay
     *     @type bool $sync_streams
     *           improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     *           so not recommended for rooms with frequent subscription changes
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRoom::initOnce();
        parent::__construct($data);
    }

    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     * @return int
     */
    public function getEmptyTimeout()
    {
        return $this->empty_timeout;
    }

    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setEmptyTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->empty_timeout = $var;

        return $this;
    }

    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     * @return int
     */
    public function getDepartureTimeout()
    {
        return $this->departure_timeout;
    }

    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setDepartureTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->departure_timeout = $var;

        return $this;
    }

    /**
     * limit number of participants that can be in a room
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     * @return int
     */
    public function getMaxParticipants()
    {
        return $this->max_participants;
    }

    /**
     * limit number of participants that can be in a room
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxParticipants($var)
    {
        GPBUtil::checkUint32($var);
        $this->max_participants = $var;

        return $this;
    }

    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 5;</code>
     * @return \Livekit\RoomEgress|null
     */
    public function getEgress()
    {
        return $this->egress;
    }

    public function hasEgress()
    {
        return isset($this->egress);
    }

    public function clearEgress()
    {
        unset($this->egress);
    }

    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 5;</code>
     * @param \Livekit\RoomEgress $var
     * @return $this
     */
    public function setEgress($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RoomEgress::class);
        $this->egress = $var;

        return $this;
    }

    /**
     * agent
     *
     * Generated from protobuf field <code>.livekit.RoomAgent agent = 6;</code>
     * @return \Livekit\RoomAgent|null
     */
    public function getAgent()
    {
        return $this->agent;
    }

    public function hasAgent()
    {
        return isset($this->agent);
    }

    public function clearAgent()
    {
        unset($this->agent);
    }

    /**
     * agent
     *
     * Generated from protobuf field <code>.livekit.RoomAgent agent = 6;</code>
     * @param \Livekit\RoomAgent $var
     * @return $this
     */
    public function setAgent($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RoomAgent::class);
        $this->agent = $var;

        return $this;
    }

    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     * @return int
     */
    public function getMinPlayoutDelay()
    {
        return $this->min_playout_delay;
    }

    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setMinPlayoutDelay($var)
    {
        GPBUtil::checkUint32($var);
        $this->min_playout_delay = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint32 max_playout_delay = 8;</code>
     * @return int
     */
    public function getMaxPlayoutDelay()
    {
        return $this->max_playout_delay;
    }

    /**
     * Generated from protobuf field <code>uint32 max_playout_delay = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxPlayoutDelay($var)
    {
        GPBUtil::checkUint32($var);
        $this->max_playout_delay = $var;

        return $this;
    }

    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     * @return bool
     */
    public function getSyncStreams()
    {
        return $this->sync_streams;
    }

    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     * @param bool $var
     * @return $this
     */
    public function setSyncStreams($var)
    {
        GPBUtil::checkBool($var);
        $this->sync_streams = $var;

        return $this;
    }

}

