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

namespace Livekit;

use UnexpectedValueException;

/**
 * Protobuf type <code>livekit.TrackSource</code>
 */
class TrackSource
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>CAMERA = 1;</code>
     */
    const CAMERA = 1;
    /**
     * Generated from protobuf enum <code>MICROPHONE = 2;</code>
     */
    const MICROPHONE = 2;
    /**
     * Generated from protobuf enum <code>SCREEN_SHARE = 3;</code>
     */
    const SCREEN_SHARE = 3;
    /**
     * Generated from protobuf enum <code>SCREEN_SHARE_AUDIO = 4;</code>
     */
    const SCREEN_SHARE_AUDIO = 4;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::CAMERA => 'CAMERA',
        self::MICROPHONE => 'MICROPHONE',
        self::SCREEN_SHARE => 'SCREEN_SHARE',
        self::SCREEN_SHARE_AUDIO => 'SCREEN_SHARE_AUDIO',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

