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

namespace Rv\Data\Media\VideoDevice;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Media.VideoDevice.Type</code>
 */
class Type
{
    /**
     * Generated from protobuf enum <code>TYPE_GENERIC = 0;</code>
     */
    const TYPE_GENERIC = 0;
    /**
     * Generated from protobuf enum <code>TYPE_DIRECTSHOW = 1;</code>
     */
    const TYPE_DIRECTSHOW = 1;
    /**
     * Generated from protobuf enum <code>TYPE_BLACKMAGIC = 2;</code>
     */
    const TYPE_BLACKMAGIC = 2;
    /**
     * Generated from protobuf enum <code>TYPE_AJA = 3;</code>
     */
    const TYPE_AJA = 3;
    /**
     * Generated from protobuf enum <code>TYPE_AV = 4;</code>
     */
    const TYPE_AV = 4;
    /**
     * Generated from protobuf enum <code>TYPE_SYPHON = 5;</code>
     */
    const TYPE_SYPHON = 5;
    /**
     * Generated from protobuf enum <code>TYPE_NDI = 6;</code>
     */
    const TYPE_NDI = 6;
    /**
     * Generated from protobuf enum <code>TYPE_BLUEFISH = 7;</code>
     */
    const TYPE_BLUEFISH = 7;

    private static $valueToName = [
        self::TYPE_GENERIC => 'TYPE_GENERIC',
        self::TYPE_DIRECTSHOW => 'TYPE_DIRECTSHOW',
        self::TYPE_BLACKMAGIC => 'TYPE_BLACKMAGIC',
        self::TYPE_AJA => 'TYPE_AJA',
        self::TYPE_AV => 'TYPE_AV',
        self::TYPE_SYPHON => 'TYPE_SYPHON',
        self::TYPE_NDI => 'TYPE_NDI',
        self::TYPE_BLUEFISH => 'TYPE_BLUEFISH',
    ];

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

