网络音乐播放器
注意:系统中必须要装了Mplayer,否则不能播放。支持 http:// 网络歌曲地址播放。最简单的播放器了。音乐地址请在源码中修改
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=上海徐高科技
#AutoIt3Wrapper_Res_Description=AU3编写的简单在线音乐播放器
#AutoIt3Wrapper_Res_Fileversion=V1.0
#AutoIt3Wrapper_Res_LegalCopyright=上海徐高科技
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GuiConstants.au3>
#region Object
$oMyError = ObjEvent("AutoIt.Error","Quit")
$oMediaplayer = ObjCreate("WMPlayer.OCX.7")
If Not IsObj($oMediaplayer) Then Exit
$oMediaplayer.Enabled = true
$oMediaplayer.WindowlessVideo= true
$oMediaPlayer.UImode="invisible"
$oMediaPlayer.URL="http://vxp.xugaocn.com/music/爱大了受伤了.mp3"
$oMediaPlayControl=$oMediaPlayer.Controls
$oMediaPlaySettings=$oMediaPlayer.Settings
#endregion
#region GUI
GuiCreate("音乐播放器", 215, 100,(@DesktopWidth-215)/2, (@DesktopHeight-100)/2, -1)
GuiCtrlCreateLabel("音乐播放器", 10, 10, 200, 20)
$Volume = GuiCtrlCreateSlider(20, 30, 180, 20)
GuiCtrlCreateLabel("音量", 85, 50, 40, 20)
GUICtrlSetData($Volume, 100)
$Play = GuiCtrlCreateButton("播放", 30, 60, 50, 30)
$Stop = GuiCtrlCreateButton("停止", 120, 60, 50, 30)
GuiSetState()
$VolLevel = 100
HotKeySet("{F8}", "Hide")
HotKeySet("{F9}", "Show")
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Play
$oMediaPlayControl.Play
Case $msg = $Stop
$oMediaPlayControl.Stop
Case Else
If GUICtrlread($Volume) <> $VolLevel Then
$oMediaPlaySettings.Volume = GUICtrlRead($Volume)
$VolLevel = GUICtrlRead($Volume)
EndIf
EndSelect
WEnd
Exit
#endregion
#region functions
Func Quit()
$oMediaPlayControl.Stop
Exit
EndFunc
Func Hide()
GUISetState(@SW_HIDE)
EndFunc
Func Show()
GUISetState(@SW_SHOW)
EndFunc
#endregion
转自 上海网管联盟
∨ 展开