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

namespace Rv\Data\Preferences\Advanced;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Preferences.Advanced.AudioForegroundMediaBehavior</code>
 */
class AudioForegroundMediaBehavior
{
    /**
     * Generated from protobuf enum <code>IGNORE_FOREGROUND_MEDIA = 0;</code>
     */
    const IGNORE_FOREGROUND_MEDIA = 0;
    /**
     * Generated from protobuf enum <code>CLEAR_FOR_ALL_MEDIA = 1;</code>
     */
    const CLEAR_FOR_ALL_MEDIA = 1;
    /**
     * Generated from protobuf enum <code>CLEAR_IF_AUDIO = 2;</code>
     */
    const CLEAR_IF_AUDIO = 2;
    /**
     * Generated from protobuf enum <code>PAUSE_FOR_ALL_MEDIA = 3;</code>
     */
    const PAUSE_FOR_ALL_MEDIA = 3;
    /**
     * Generated from protobuf enum <code>PAUSE_IF_AUDIO = 4;</code>
     */
    const PAUSE_IF_AUDIO = 4;

    private static $valueToName = [
        self::IGNORE_FOREGROUND_MEDIA => 'IGNORE_FOREGROUND_MEDIA',
        self::CLEAR_FOR_ALL_MEDIA => 'CLEAR_FOR_ALL_MEDIA',
        self::CLEAR_IF_AUDIO => 'CLEAR_IF_AUDIO',
        self::PAUSE_FOR_ALL_MEDIA => 'PAUSE_FOR_ALL_MEDIA',
        self::PAUSE_IF_AUDIO => 'PAUSE_IF_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);
    }
}

