; File name: zPlayer-VLC.au3 #include #include #include Opt("WinTitleMatchMode", 2) HotKeySet("^!{END}", "MyExit") $vlcPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vlc.exe", "") If $vlcPath = "" Then Exit MsgBox(0, "", "VLC is not installed!") Global $fileTypes = "mp4 wmv avi mkv flv webM" Global $aList, $guiMsg, $lPaused If Not FileExists(@ScriptDir & "\VLC-Playlist.txt") Then $aList = _FileListToArrayRec(@ScriptDir, StringReplace("*." & $fileTypes, " ", ";*."), 1, 0, 0, 2) If Not IsArray($aList) Then MsgBox(0, "", "This program should reside in the driectory where video files are located.") Exit EndIf Global $playList = '' $playList &= '' & @CR $playList &= '' & @CR $playList &= @TAB & 'Playlist' & @CR $playList &= @TAB & '' & @CR For $i = 1 To $aList[0] $playList &= @TAB & @TAB & '' & @CR $playList &= @TAB & @TAB & @TAB & 'file:///' & URLEncode($aList[$i]) & '' & @CR $playList &= @TAB & @TAB & @TAB & '' & @CR $playList &= @TAB & @TAB & @TAB & @TAB & '' & $i-1 & '' & @CR $playList &= @TAB & @TAB & @TAB & @TAB & 'file-caching=1000' & @CR $playList &= @TAB & @TAB & @TAB & '' & @CR $playList &= @TAB & @TAB & '' & @CR Next $playList &= @TAB & '' & @CR $playList &= @TAB & '' & @CR For $i = 1 To $aList[0] $playList &= @TAB & @TAB & '' & @CR Next $playList &= @TAB & '' & @CR $playList &= '' & @CR $fh = FileOpen(@ScriptDir & "\VLC-Playlist.xspf", 2) FileWrite($fh, $playList) FileClose($fh) EndIf ; from Koda buttons creation ;~ #include ;~ #include ;~ #include ;~ #Region ### START Koda GUI section ### Form=C:\Users\Carl\Documents\AutoIt\CarlPlay\BigButton-01.kxf ;~ Global $Form1 = GUICreate("Form1", 1025, 801, -1, -1) ;~ Global $Pause = GUICtrlCreateButton("Pause", 8, 48, 1009, 649) ;~ GUICtrlSetFont(-1, 250, 400, 0, "Arial Rounded MT Bold") ;~ Global $Next = GUICtrlCreateButton("Next", 552, 720, 465, 73) ;~ GUICtrlSetFont(-1, 60, 400, 0, "Arial Rounded MT Bold") ;~ Global $Previous = GUICtrlCreateButton("Previous", 8, 720, 457, 73) ;~ GUICtrlSetFont(-1, 60, 400, 0, "Arial Rounded MT Bold") ;~ Global $Exit = GUICtrlCreateButton("Exit", 488, 8, 33, 17) ;~ GUICtrlSetFont(-1, 10, 400, 0, "Arial Rounded MT Bold") ;~ GUISetState(@SW_SHOW) ;~ #EndRegion ### END Koda GUI section ### ;~ While 1 ;~ $nMsg = GUIGetMsg() ;~ Switch $nMsg ;~ Case $GUI_EVENT_CLOSE ;~ Exit ;~ EndSwitch ;~ WEnd ; $vcWidth and $vcHeight set the rectangular dimensions of the control ; Button numbers = Left, Top, Width, Height ;Global $vcWidth = 800, $shuttleWidth = 24, $sliderLength = $vcWidth-$shuttleWidth, $vcHeight = 800 Global $outerBorder = 10 Global $exitHeight = 20 Global $exitWidth = 50 Global $buttonGap = 50 Global $vcWidth = 800, $vcHeight = 800 Global $pauseWidth = $vcWidth-$outerBorder*2 Global $prevnextHeight=80 Global $pauseHeight = $vcHeight - $prevnextHeight - 2*$buttonGap - $exitHeight Global $prevnextTop = $vcHeight -$buttonGap - $prevnextHeight -$outerBorder Global $vcGUI = GUICreate("zPlayer_Carl by C Y Cho", $vcWidth, $vcHeight, -1, -1) Global $vcPause = GUICtrlCreateButton("Pause", $outerBorder, $exitHeight+$buttonGap, $pauseWidth, $pauseHeight) GUICtrlSetFont(-1, 100, 900) GUICtrlSetColor(-1, 0x666666) GUICtrlSetCursor(-1, 0) Global $vcPrevious = GUICtrlCreateButton("Previous", $outerBorder, $prevnextTop+$buttonGap, $vcWidth/2-$buttonGap, $prevnextHeight) GUICtrlSetFont(-1, 40, 900) GUICtrlSetColor(-1, 0x666666) GUICtrlSetCursor(-1, 0) Global $vcNext = GUICtrlCreateButton("Next", $vcWidth/2+$buttonGap, $prevnextTop+$buttonGap, $vcWidth/2 - $buttonGap -$outerBorder, $prevnextHeight) GUICtrlSetFont(-1, 40, 900) GUICtrlSetColor(-1, 0x666666) GUICtrlSetCursor(-1, 0) Global $vcExit = GUICtrlCreateButton("Exit", ($vcWidth-$exitWidth)/2, $outerBorder,$exitWidth,$exitHeight) GUICtrlSetFont(-1, 10, 900) GUICtrlSetColor(-1, 0x666666) GUICtrlSetCursor(-1, 0) GUISetState(@SW_SHOW, $vcGUI) WinSetOnTop($vcGUI, "", 1) Run($vlcPath & " " & @ScriptDir & "\VLC-Playlist.xspf") Sleep(1000) $hWnd = WinGetHandle("[CLASS:Qt5QWindowIcon]") ; Please check if your VLC window class matches with this ;WinMove($hWnd, "", @DesktopWidth, 0) ; This line should be uncommented when using dual monitors WinSetState($hWnd, "", @SW_MAXIMIZE) While 1 $guiMsg = GUIGetMsg() Switch $guiMsg Case $vcNext WinActivate($hWnd) Send("{MEDIA_NEXT}") If $lPaused = True Then GUICtrlSetData($vcPause, "Pause") $lPaused = False EndIf Case $vcPrevious WinActivate($hWnd) Send("{MEDIA_PREV}") If $lPaused = True Then GUICtrlSetData($vcPause, "Pause") $lPaused = False EndIf Case $vcPause WinActivate($hWnd) If $lPaused = False Then GUICtrlSetData($vcPause, "Play") $lPaused = True Else GUICtrlSetData($vcPause, "Pause") $lPaused = False EndIf Send("{MEDIA_PLAY_PAUSE}") Case $vcExit, $GUI_EVENT_CLOSE MyExit() EndSwitch If Not WinExists($hWnd) Then MyExit() WEnd Func URLEncode($sFileName) Local $sBinary = StringToBinary($sFileName, 4) Local $sEncodedName = "" For $j = 1 To BinaryLen($sBinary) Local $sByte = StringTrimLeft(BinaryMid($sBinary, $j, 1), 2) Local $ascii = Dec($sByte) If ($ascii >= 48 And $ascii <= 57) Or ($ascii >= 65 And $ascii <= 90) Or ($ascii >= 97 And $ascii <= 122) _ Or StringInStr("45 46 58 91 93 95", StringRight(1000+$ascii, 2)) Then $sEncodedName &= Chr($ascii) ElseIf $ascii = 92 Then $sEncodedName &= "/" Else $sEncodedName &= "%" & $sByte EndIf Next Return $sEncodedName EndFunc Func MyExit() ProcessClose("vlc.exe") Exit EndFunc