PlayModeEnum.kt 654 Bytes
Newer Older
konghaorui committed
1
package com.ydl.media.audio.enums
konghaorui committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

/**
 * Created by haorui on 2019-10-27 .
 * Des: 播放模式
 */
enum class PlayModeEnum private constructor(private val value: Int) {
    //列表循环
    LIST_LOOP(0),
    //随机播放
    SHUFFLE(1),
    //单曲循环
    SINGLE_LOOP(2),
    //单曲播放
    SINGLE(3);

    fun value(): Int {
        return value
    }

    companion object {

        fun valueOf(value: Int): PlayModeEnum {
            when (value) {
                1 -> return SHUFFLE
                2 -> return SINGLE_LOOP
                0 -> return LIST_LOOP
                else -> return LIST_LOOP
            }
        }
    }
}