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

namespace Livekit;

use UnexpectedValueException;

/**
 * Protobuf type <code>livekit.AudioTrackFeature</code>
 */
class AudioTrackFeature
{
    /**
     * Generated from protobuf enum <code>TF_STEREO = 0;</code>
     */
    const TF_STEREO = 0;
    /**
     * Generated from protobuf enum <code>TF_NO_DTX = 1;</code>
     */
    const TF_NO_DTX = 1;
    /**
     * Generated from protobuf enum <code>TF_AUTO_GAIN_CONTROL = 2;</code>
     */
    const TF_AUTO_GAIN_CONTROL = 2;
    /**
     * Generated from protobuf enum <code>TF_ECHO_CANCELLATION = 3;</code>
     */
    const TF_ECHO_CANCELLATION = 3;
    /**
     * Generated from protobuf enum <code>TF_NOISE_SUPPRESSION = 4;</code>
     */
    const TF_NOISE_SUPPRESSION = 4;
    /**
     * Generated from protobuf enum <code>TF_ENHANCED_NOISE_CANCELLATION = 5;</code>
     */
    const TF_ENHANCED_NOISE_CANCELLATION = 5;

    private static $valueToName = [
        self::TF_STEREO => 'TF_STEREO',
        self::TF_NO_DTX => 'TF_NO_DTX',
        self::TF_AUTO_GAIN_CONTROL => 'TF_AUTO_GAIN_CONTROL',
        self::TF_ECHO_CANCELLATION => 'TF_ECHO_CANCELLATION',
        self::TF_NOISE_SUPPRESSION => 'TF_NOISE_SUPPRESSION',
        self::TF_ENHANCED_NOISE_CANCELLATION => 'TF_ENHANCED_NOISE_CANCELLATION',
    ];

    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);
    }
}

