Dim bPlaying
Dim bPaused

Sub UpdateAnimateProgress()
	Animate_Progress.left = SliderBar_Progress.left + (SliderBar_Progress.width - 16) * SliderBar_Progress.pos \ 1000 - 32
End Sub

Sub Window_OnInit()
End Sub

Sub Window_OnSize(cx,cy)
End Sub

Sub SliderBar_Progress_OnPosChanged(nPos)
	UpdateAnimateProgress()
End Sub

Sub SliderBar_Progress_OnPosChanging(nPos)
	UpdateAnimateProgress()
End Sub

'处理QQMusic程序发来的事件
Sub Window_OnNotify(code,var)
	If code = 1001 Then	'是否播放
		bPlaying = Var
		If Var = 0 Then
			Picture_Spectrum.visible = true
			Spectrum.visible = false
			SliderBar_Progress.AnimateThumbStop()
			Animate_Progress.Stop()
		Else
			Picture_Spectrum.visible = false
			Spectrum.visible = true
			SliderBar_Progress.AnimateThumbStart()
			Animate_Progress.Start()
		End If
	ElseIf code = 1002 Then	'是否暂停
		bPaused = Var
		If bPlaying And Var = 0 Then
			SliderBar_Progress.AnimateThumbStart()
			Animate_Progress.Start()
		Else
			SliderBar_Progress.AnimateThumbStop()
			Animate_Progress.Stop()
		End If
	ElseIf code = 1003 Then
		UpdateAnimateProgress()
	End If
End Sub
