package schedule

type SSTaskId int

const (
	SSTaskId_PlayPlayList      SSTaskId = 1
	SSTaskId_PlaySongList      SSTaskId = 2
	SSTaskId_DevControl        SSTaskId = 3
	SSTaskId_QueryWeather      SSTaskId = 4
	SSTaskId_QueryBirthDay     SSTaskId = 5
	SSTaskId_ControlIOT        SSTaskId = 6
	SSTaskId_PlayNotices       SSTaskId = 7
	SSTaskId_MingXiangJiaoChen SSTaskId = 8
)

type SStaskType uint8

const (
	SStaskType_Once SStaskType = iota
	SStaskType_Continuous
)

type RegistedSceneTask struct {
	GetType func() SStaskType
	GetId   func() SSTaskId

	Play     func(startType PlayerStartType, position int, hd SSceneHd, taskno int)
	PlayNext func(hd SSceneHd)
	PlayPre  func(hd SSceneHd)
	Pause    func(hd SSceneHd)
	Stop     func(hd SSceneHd)
	Seek     func(hd SSceneHd, pos uint32)

	PlayerStatusChange func(status PlayerDetail, hd SSceneHd)
}

var (
	localsstasks = make(map[SSTaskId]*RegistedSceneTask)
)

func RegisteSceneTask(task RegistedSceneTask) error {
	localsstasks[task.GetId()] = &task
	return nil
}
