<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_rtc.proto

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.AddTrackRequest</code>
 */
class AddTrackRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * client ID of track, to match it when RTC track is received
     *
     * Generated from protobuf field <code>string cid = 1;</code>
     */
    protected $cid = '';
    /**
     * Generated from protobuf field <code>string name = 2;</code>
     */
    protected $name = '';
    /**
     * Generated from protobuf field <code>.livekit.TrackType type = 3;</code>
     */
    protected $type = 0;
    /**
     * Generated from protobuf field <code>uint32 width = 4;</code>
     */
    protected $width = 0;
    /**
     * Generated from protobuf field <code>uint32 height = 5;</code>
     */
    protected $height = 0;
    /**
     * true to add track and initialize to muted
     *
     * Generated from protobuf field <code>bool muted = 6;</code>
     */
    protected $muted = false;
    /**
     * true if DTX (Discontinuous Transmission) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_dtx = 7 [deprecated = true];</code>
     * @deprecated
     */
    protected $disable_dtx = false;
    /**
     * Generated from protobuf field <code>.livekit.TrackSource source = 8;</code>
     */
    protected $source = 0;
    /**
     * Generated from protobuf field <code>repeated .livekit.VideoLayer layers = 9;</code>
     */
    private $layers;
    /**
     * Generated from protobuf field <code>repeated .livekit.SimulcastCodec simulcast_codecs = 10;</code>
     */
    private $simulcast_codecs;
    /**
     * server ID of track, publish new codec to exist track
     *
     * Generated from protobuf field <code>string sid = 11;</code>
     */
    protected $sid = '';
    /**
     * deprecated in favor of audio_features
     *
     * Generated from protobuf field <code>bool stereo = 12 [deprecated = true];</code>
     * @deprecated
     */
    protected $stereo = false;
    /**
     * true if RED (Redundant Encoding) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_red = 13;</code>
     */
    protected $disable_red = false;
    /**
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 14;</code>
     */
    protected $encryption = 0;
    /**
     * which stream the track belongs to, used to group tracks together.
     * if not specified, server will infer it from track source to bundle camera/microphone, screenshare/audio together
     *
     * Generated from protobuf field <code>string stream = 15;</code>
     */
    protected $stream = '';
    /**
     * Generated from protobuf field <code>.livekit.BackupCodecPolicy backup_codec_policy = 16;</code>
     */
    protected $backup_codec_policy = 0;
    /**
     * Generated from protobuf field <code>repeated .livekit.AudioTrackFeature audio_features = 17;</code>
     */
    private $audio_features;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $cid
     *           client ID of track, to match it when RTC track is received
     *     @type string $name
     *     @type int $type
     *     @type int $width
     *     @type int $height
     *     @type bool $muted
     *           true to add track and initialize to muted
     *     @type bool $disable_dtx
     *           true if DTX (Discontinuous Transmission) is disabled for audio
     *     @type int $source
     *     @type \Livekit\VideoLayer[] $layers
     *     @type \Livekit\SimulcastCodec[] $simulcast_codecs
     *     @type string $sid
     *           server ID of track, publish new codec to exist track
     *     @type bool $stereo
     *           deprecated in favor of audio_features
     *     @type bool $disable_red
     *           true if RED (Redundant Encoding) is disabled for audio
     *     @type int $encryption
     *     @type string $stream
     *           which stream the track belongs to, used to group tracks together.
     *           if not specified, server will infer it from track source to bundle camera/microphone, screenshare/audio together
     *     @type int $backup_codec_policy
     *     @type int[] $audio_features
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

    /**
     * client ID of track, to match it when RTC track is received
     *
     * Generated from protobuf field <code>string cid = 1;</code>
     * @return string
     */
    public function getCid()
    {
        return $this->cid;
    }

    /**
     * client ID of track, to match it when RTC track is received
     *
     * Generated from protobuf field <code>string cid = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setCid($var)
    {
        GPBUtil::checkString($var, True);
        $this->cid = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.TrackType type = 3;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Generated from protobuf field <code>.livekit.TrackType type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Livekit\TrackType::class);
        $this->type = $var;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * true to add track and initialize to muted
     *
     * Generated from protobuf field <code>bool muted = 6;</code>
     * @return bool
     */
    public function getMuted()
    {
        return $this->muted;
    }

    /**
     * true to add track and initialize to muted
     *
     * Generated from protobuf field <code>bool muted = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setMuted($var)
    {
        GPBUtil::checkBool($var);
        $this->muted = $var;

        return $this;
    }

    /**
     * true if DTX (Discontinuous Transmission) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_dtx = 7 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getDisableDtx()
    {
        if ($this->disable_dtx !== false) {
            @trigger_error('disable_dtx is deprecated.', E_USER_DEPRECATED);
        }
        return $this->disable_dtx;
    }

    /**
     * true if DTX (Discontinuous Transmission) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_dtx = 7 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setDisableDtx($var)
    {
        @trigger_error('disable_dtx is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->disable_dtx = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.TrackSource source = 8;</code>
     * @return int
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * Generated from protobuf field <code>.livekit.TrackSource source = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkEnum($var, \Livekit\TrackSource::class);
        $this->source = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.VideoLayer layers = 9;</code>
     * @return RepeatedField<\Livekit\VideoLayer>
     */
    public function getLayers()
    {
        return $this->layers;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.VideoLayer layers = 9;</code>
     * @param \Livekit\VideoLayer[] $var
     * @return $this
     */
    public function setLayers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\VideoLayer::class);
        $this->layers = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.SimulcastCodec simulcast_codecs = 10;</code>
     * @return RepeatedField<\Livekit\SimulcastCodec>
     */
    public function getSimulcastCodecs()
    {
        return $this->simulcast_codecs;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.SimulcastCodec simulcast_codecs = 10;</code>
     * @param \Livekit\SimulcastCodec[] $var
     * @return $this
     */
    public function setSimulcastCodecs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\SimulcastCodec::class);
        $this->simulcast_codecs = $arr;

        return $this;
    }

    /**
     * server ID of track, publish new codec to exist track
     *
     * Generated from protobuf field <code>string sid = 11;</code>
     * @return string
     */
    public function getSid()
    {
        return $this->sid;
    }

    /**
     * server ID of track, publish new codec to exist track
     *
     * Generated from protobuf field <code>string sid = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setSid($var)
    {
        GPBUtil::checkString($var, True);
        $this->sid = $var;

        return $this;
    }

    /**
     * deprecated in favor of audio_features
     *
     * Generated from protobuf field <code>bool stereo = 12 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getStereo()
    {
        if ($this->stereo !== false) {
            @trigger_error('stereo is deprecated.', E_USER_DEPRECATED);
        }
        return $this->stereo;
    }

    /**
     * deprecated in favor of audio_features
     *
     * Generated from protobuf field <code>bool stereo = 12 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setStereo($var)
    {
        @trigger_error('stereo is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->stereo = $var;

        return $this;
    }

    /**
     * true if RED (Redundant Encoding) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_red = 13;</code>
     * @return bool
     */
    public function getDisableRed()
    {
        return $this->disable_red;
    }

    /**
     * true if RED (Redundant Encoding) is disabled for audio
     *
     * Generated from protobuf field <code>bool disable_red = 13;</code>
     * @param bool $var
     * @return $this
     */
    public function setDisableRed($var)
    {
        GPBUtil::checkBool($var);
        $this->disable_red = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 14;</code>
     * @return int
     */
    public function getEncryption()
    {
        return $this->encryption;
    }

    /**
     * Generated from protobuf field <code>.livekit.Encryption.Type encryption = 14;</code>
     * @param int $var
     * @return $this
     */
    public function setEncryption($var)
    {
        GPBUtil::checkEnum($var, \Livekit\Encryption\Type::class);
        $this->encryption = $var;

        return $this;
    }

    /**
     * which stream the track belongs to, used to group tracks together.
     * if not specified, server will infer it from track source to bundle camera/microphone, screenshare/audio together
     *
     * Generated from protobuf field <code>string stream = 15;</code>
     * @return string
     */
    public function getStream()
    {
        return $this->stream;
    }

    /**
     * which stream the track belongs to, used to group tracks together.
     * if not specified, server will infer it from track source to bundle camera/microphone, screenshare/audio together
     *
     * Generated from protobuf field <code>string stream = 15;</code>
     * @param string $var
     * @return $this
     */
    public function setStream($var)
    {
        GPBUtil::checkString($var, True);
        $this->stream = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.BackupCodecPolicy backup_codec_policy = 16;</code>
     * @return int
     */
    public function getBackupCodecPolicy()
    {
        return $this->backup_codec_policy;
    }

    /**
     * Generated from protobuf field <code>.livekit.BackupCodecPolicy backup_codec_policy = 16;</code>
     * @param int $var
     * @return $this
     */
    public function setBackupCodecPolicy($var)
    {
        GPBUtil::checkEnum($var, \Livekit\BackupCodecPolicy::class);
        $this->backup_codec_policy = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.AudioTrackFeature audio_features = 17;</code>
     * @return RepeatedField<int>
     */
    public function getAudioFeatures()
    {
        return $this->audio_features;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.AudioTrackFeature audio_features = 17;</code>
     * @param int[] $var
     * @return $this
     */
    public function setAudioFeatures($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Livekit\AudioTrackFeature::class);
        $this->audio_features = $arr;

        return $this;
    }

}

