package vui

import (
	"netease_control_center/interfaces/vui/cvui"
	"time"
)

type IconLedDesc struct {
	Name        string
	OnHold      time.Duration
	IsMusicShow bool
	Arg         interface{}
	CanNotOff   bool
}

func (this *IconLedDesc) GetPath() string {
	return cvui.GetSkinRes(this.Name)
}
func (this IconLedDesc) Show() {
	ShowIcon(this)
}

func (this IconLedDesc) Clear() {
	ClearIcon(this)
}

func (this IconLedDesc) Equal(icons ...IconLedDesc) bool {
	for _, icon := range icons {
		if this.Name == icon.Name && this.Arg == icon.Arg {
			return true
		}
	}

	return false
}

func (this IconLedDesc) IsStatusIcon() bool {
	if this.OnHold > 0 {
		return false
	} else {
		return true
	}
}

func (this IconLedDesc) IsInsertIcon() bool {
	if this.OnHold > 0 {
		return true
	} else {
		return false
	}
}

type IconLed = IconLedDesc

var (
	/*Clear*/
	IconLed_Clear         = IconLedDesc{Name: "Iconstart001", OnHold: 0 * time.Second, CanNotOff: true}
	IconLed_StopMusicMode = IconLedDesc{Name: "StopMusicMode", OnHold: 0 * time.Second}
	IconLed_ShowVolume    = IconLedDesc{Name: "ShowVolume", OnHold: 2 * time.Second}
	IconLed_DoNothing     = IconLedDesc{Name: "", OnHold: 0 * time.Second}

	/*
		开机初始化
		音箱通电之后立即出现•
		包括：开机Icon&初始化Icon
		&初始成功Icon
	*/
	IconLed_InitPowerUp = IconLedDesc{Name: "p301", OnHold: 0 * time.Second}
	/*升级中（非限制） 时长=升级过程*/
	IconLed_Otaing = IconLedDesc{Name: "p302", OnHold: 0 * time.Second, CanNotOff: true}
	/*升级成功 时长=升级成功维持s，3s后消失*/
	IconLed_OtaSuccess = IconLedDesc{Name: "p303", OnHold: 3 * time.Second}
	/*系统错误*/
	IconLed_SystemErr = IconLedDesc{Name: "p304", OnHold: 0 * time.Second}

	/*配网模式（BLE模式，soft AP模式）*/
	IconLed_Wifiparing_Ble = IconLedDesc{Name: "p601", OnHold: 0 * time.Second, CanNotOff: true} //Iconlianwang001
	IconLed_Wifiparing_Ap  = IconLedDesc{Name: "p605", OnHold: 0 * time.Second, CanNotOff: true} //Iconlianwang005
	/*联网中*/
	IconLed_WifiConnecting = IconLedDesc{Name: "p602", OnHold: 0 * time.Second}
	/*联网成功*/
	IconLed_WifiConnectSuccess = IconLedDesc{Name: "p603", OnHold: 2 * time.Second}
	/*联网失败*/
	IconLed_WifiConnectFail = IconLedDesc{Name: "p604", OnHold: 2 * time.Second}

	/*唤醒中*/
	IconLed_VoiceWakeup = IconLedDesc{Name: "p701", OnHold: 0 * time.Second}
	/*识别等待中*/
	IconLed_VoiceRecoging = IconLedDesc{Name: "p702", OnHold: 0 * time.Second}
	/*执行中*/
	IconLed_VoiceExecResult = IconLedDesc{Name: "p703", OnHold: 0 * time.Second}

	/*暂停*/
	IconLed_IconChaozuo001 = IconLedDesc{Name: "p001", OnHold: 2 * time.Second, IsMusicShow: true}
	/*上一首*/
	IconLed_IconChaozuo002 = IconLedDesc{Name: "p002", OnHold: 3 * time.Second}
	/*下一首*/
	IconLed_IconChaozuo003 = IconLedDesc{Name: "p003", OnHold: 3 * time.Second}
	/*播放模式*/
	IconLed_IconChaozuo004 = IconLedDesc{Name: "IconChaozuo004", OnHold: 3 * time.Second}
	/*收藏成功*/
	IconLed_IconChaozuo005 = IconLedDesc{Name: "p005", OnHold: 3 * time.Second}
	/*重复*/
	IconLed_IconChaozuo006 = IconLedDesc{Name: "IconChaozuo006", OnHold: 0 * time.Second}
	/*播放*/
	IconLed_IconChaozuo007 = IconLedDesc{Name: "IconChaozuo007", OnHold: 0 * time.Second}

	/*用户用蓝牙连接音箱*/
	IconLed_IconLianjie001 = IconLedDesc{Name: "p101", OnHold: 2 * time.Second}
	/*用户用dlna连接音箱并播放歌曲*/
	IconLed_IconLianjie002 = IconLedDesc{Name: "p102", OnHold: 2 * time.Second}
	/*用户用AirPlay连接音箱并播放歌曲*/
	IconLed_IconLianjie003 = IconLedDesc{Name: "p103", OnHold: 2 * time.Second}

	/*音乐播放节奏灯（圆形）prd:辐射*/
	IconLed_iconMusic001 = IconLedDesc{Name: "iconMusic001", OnHold: 0 * time.Second, IsMusicShow: true}
	/*音乐播放节奏灯（九段）prd:煎茶*/
	IconLed_iconMusic002 = IconLedDesc{Name: "iconMusic002", OnHold: 0 * time.Second, IsMusicShow: true}
	/*音乐播放节奏灯（一条线） prd:经典*/
	IconLed_iconMusic003 = IconLedDesc{Name: "iconMusic003", OnHold: 0 * time.Second, IsMusicShow: true}

	IconLed_iconMusic004 = IconLedDesc{Name: "iconMusic004", OnHold: 0 * time.Second, IsMusicShow: false}

	/*闹钟到时间响起*/
	IconLed_IconNaozhong001 = IconLedDesc{Name: "p201", OnHold: 0 * time.Second}
	/*提醒到时间响起*/
	IconLed_IconTixing001 = IconLedDesc{Name: "p401", OnHold: 0 * time.Second}
	/*执行闹钟取消命令*/
	IconLed_IconNaozhong002 = IconLedDesc{Name: "IconNaozhong002", OnHold: 0 * time.Second}
	/*执行提醒取消命令*/
	IconLed_IconTixing002 = IconLedDesc{Name: "IconTixing002", OnHold: 0 * time.Second}
)
