package globals

import (
	"strings"
	"time"
)

type PlayerType uint32

const (
	PlayerType_Wifi PlayerType = iota + 1
	PlayerType_Dlna
	PlayerType_Airplay
	PlayerType_Bt

	PlayerType_Other
)

type MusicSrcOnOffSt struct {
	DlnaOn    bool
	AirPlayOn bool
	BtOn      bool
}

const (
	AIRPLAY_MODE_ITSELF   uint8 = iota + 0 // airplay模块调用alsa播放
	AIRPLAY_MODE_TOPLAYER                  // airplay将数据丢给播放器播放
)

const AirPlay_Mode = AIRPLAY_MODE_ITSELF

/*
 todo 暂时变量，后续处理去掉
*/
type PlayerSrcType uint8

const (
	WIFI_SRC PlayerSrcType = iota
	DLNA_SRC
	BT_SRC
	AIRPLAY_SRC
	OTHER_SRC
)

type BirthdayPlayTime uint8

const (
	BIRTHDAY_BEFORE_TASK = iota + 1
	BIRTHDAY_AFTER_TASK
	BIRTHDAY_NULL_ACTION
)

const (
	CONST_AUDIO_ID  string = "const_audio_uuid"
	WAKEUP_AUDIO_ID string = "wakeup_audio_uuid"

	SUB_AUDIO_ID string = "audio_uuid"

	BT_WIFI_RESUME_TIME_LIMIT time.Duration = 30 * time.Second
)

const (
	VOL_THREADSHOLD_PHONE2BOX = 20
	VOL_PRE_CHANGE_STEP       = 5
)

func IsLocalAudioUuid(uuid string) bool {
	return strings.Contains(uuid, SUB_AUDIO_ID)
}

type WifiSrcRec struct {
	HasBack  bool
	NeedSeek bool
	Uuid     string
	CurPos   int
}

var (
	AirPlayUuid string = "airPlayUuid"
	BtUuid      string = "btUuid"

	RspId *string = nil

	//CurMusicSrcOnOffSt MusicSrcOnOffSt
	//modify by lupeng 20180516
	CurMusicSrcOnOffSt MusicSrcOnOffSt = MusicSrcOnOffSt{
		BtOn: true,
	}

	CurPlayerSrc PlayerSrcType = WIFI_SRC

	BirthdayAction BirthdayPlayTime = BIRTHDAY_NULL_ACTION

	KeyVolTest bool = false

	GetFrom163Test bool = true

	BtAvkDataRecving bool = false
)
