|
发表于 2021-3-7 10:46:26
|
显示全部楼层
本帖最后由 chzj589 于 2021-3-8 08:28 编辑
#NoTrayIcon
#include <Sound.au3>
#include <Array.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
#include <GuiSlider.au3>
#include <GuiStatusBar.au3>
#include <ProgressConstants.au3>
Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 0)
TraySetClick(0)
TraySetState()
TraySetToolTip("chzj589 " & @YEAR & "年" & @MON & "月" & @MDAY & "日")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$title = "简易MP3播放器";& StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC)
$work = 0
$uselrc = 0
$line_1 = 0
Dim $geshu, $sjpd, $Label1
Global $g_iMsecs = 0
Local $open, $numold, $Array[1]
Global $g_iTimer1, $g_iTimer2, $Form1, $idChange, $iWait = 10, $idState, $ListView1, $Input1, $Progress1, $Durata2
Global $Pause, $Durata1, $Durata, $Tempo, $WaveVolume, $hListview1, $CheckBox2, $Pausea, $iTimerProgress, $Play
Global $g_idMemo, $g_hStatus, $g_idProgress, $g_iPercent = 0, $g_iDirection = 1
If WinExists($title) Then Exit
_Example_Events()
While 1
Sleep(1000)
WEnd
Func _Example_Events()
$Form1 = GUICreate($title, 415, 440)
GUISetBkColor(0x007180);GUISetBkColor(0x008099)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Label1a = GUICtrlCreateLabel("播放歌曲", 5, 45, 60, 25)
GUICtrlSetColor(-1, 0xFFFFFF);
$Label1 = GUICtrlCreateLabel("", 65, 45, 130, 20)
GUICtrlSetColor(-1, 0xFFFFFF);
GUICtrlSetBkColor(-1, -2)
$Progress1 = GUICtrlCreateProgress(5, 70, 260, 17, $PBS_SMOOTH);$PBS_MARQUEE);
GUICtrlSetData($Progress1, 1)
$Durata2 = GUICtrlCreateInput("", 275, 45, 55, 17)
$Durata1 = GUICtrlCreateInput(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 335, 45, 75, 17)
$Durata = GUICtrlCreateInput("", 275, 70, 55, 17)
$Tempo = GUICtrlCreateInput(StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC + 8), 335, 70, 75, 17)
$Play = GUICtrlCreateButton("播放", 180, 95, 40, 22)
GUICtrlSetOnEvent(-1, "MPlayClick2")
;$idState= GUICtrlCreateButton("启动", 230, 95, 40, 22)
$Pause = GUICtrlCreateButton("暂停", 230, 95, 40, 22)
GUICtrlSetOnEvent(-1, "PlayClick");"_idState");
$Pausea = GUICtrlCreateButton("恢复", 230, 95, 40, 22)
GUICtrlSetOnEvent(-1, "PlayClick1")
GUICtrlSetState($Pausea, 32)
$Next = GUICtrlCreateButton("停止", 280, 95, 40, 22)
GUICtrlSetOnEvent(-1, "MPlayClick1")
$Input1 = GUICtrlCreateInput("", 5, 15, 355, 21)
$AddFile = GUICtrlCreateButton("歌曲", 365, 15, 40, 22)
GUICtrlSetOnEvent(-1, "AddFileClick1")
$WaveVolume = GUICtrlCreateSlider(5, 95, 110, 22)
GUICtrlSetBkColor(-1, 0x990000);0xFFFFFF);0x007180)
GUICtrlSetOnEvent(-1, "WaveVolumeChange")
_GUICtrlSlider_SetRange(-1, 0, 100)
_GUICtrlSlider_SetPos(-1, 60)
;GUICtrlSetData(-1, 60)
SoundSetWaveVolume(100)
$ListView1 = GUICtrlCreateListView("", 10, 130, 395, 300)
Dim $hListview1 = GUICtrlGetHandle(-1)
_GUICtrlListView_AddColumn($ListView1, "歌曲列表", 80, 0)
_GUICtrlListView_AddColumn($ListView1, "歌曲时间", 100, 0)
_GUICtrlListView_AddColumn($ListView1, "歌曲目录", 210, 0)
$caidan = GUICtrlCreateContextMenu($ListView1)
$MPlay = GUICtrlCreateMenuItem("播放此歌", $caidan)
GUICtrlSetOnEvent(-1, "MPlayClick")
$MPlay1 = GUICtrlCreateMenuItem("停止播放", $caidan)
GUICtrlSetOnEvent(-1, "MPlayClick1")
$DPlay = GUICtrlCreateMenuItem("删除此歌", $caidan)
GUICtrlSetOnEvent(-1, "DPlayClick")
$Clean = GUICtrlCreateMenuItem("清除列表", $caidan)
GUICtrlSetOnEvent(-1, "CleanClick")
AddFileClick()
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
$CheckBox2 = GUICtrlCreateCheckbox("循环", 120, 98, 47, 17)
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF);
;GUICtrlSetOnEvent(-1, "_Checkbox2")
_Timer_SetTimer($Form1, 1000, "_UpdateStatusBarClocka") ; 创建计时器
GUISetState(@SW_SHOW)
$pos = WinGetPos($Form1)
GUIRegisterMsg($WM_TIMER, "WM_TIMER")
$g_iTimer1 = _Timer_SetTimer($Form1, 1000)
GUICtrlSetData($Durata2, 56)
EndFunc ;==>_Example_Events
Func Form1Close()
GUIDelete()
Exit
EndFunc ;==>Form1Close
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|