Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* INFO
- VLC VIDEOS PLAYER
- Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
- Last Modified: 3-20-2023
- */
- ;#warn
- #NoEnv
- #SingleInstance, Force
- Process, Priority, , A
- SendMode, Input
- SetBatchLines, -1
- ;#NoTrayIcon
- SetWorkingDir %A_ScriptDir%
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- FileCreateDir, %A_ScriptDir%\DATA
- FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
- FileInstall , VLC-PLAYER1.ahk, %A_ScriptDir%\DATA\VLC-PLAYER1.ahk, 1
- FileSetAttrib +HS, %A_ScriptDir%\DATA\VLC-PLAYER1.ahk, 2
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
- if (wa=3840)
- fontsize1=14
- else if (wa=1920)
- fontsize1=11
- else
- fontsize1=9
- Gui,2:default
- Gui,2: +HwndAId +0x2000000 ; +WS_CLIPCHILDREN Fixes drawing problems with child.
- Gui,2: -DPIScale
- SS_REALSIZECONTROL := 0x40
- Gui,2:Color,Black,Black
- Gui,2:Font,s%fontsize1% cGray,Lucida Console
- ;-------------------------------------------
- editorx1=F:\PORTABLE\Notepad++\notepad++.exe
- ifnotexist,%editorx1%
- editorx1:=""
- ;---------------------
- Name1=NAJEEB-MEDIATHEK
- RSSINI=%A_scriptdir%\%name1%_RSSINI.txt
- ifnotexist,%rssini%
- {
- xxca:="https://mediandr-a.akamaihd.net/download/podcasts/extradrei196/TV-20210108-1424-4800.hi.mp4"
- IniWrite,%xxca%, %rssini% ,A1 , KEY1
- }
- IniRead, C2, %rssini% , A1 , Key1
- ;--------------------------------------------------
- ;======================================================
- ;filename1=FILE_URL_YOUTUBE
- vlc1 =%a_programfiles%\videolan\vlc\vlc.exe ;- works with vlc.exe ( check path )
- ;------- download here : -------
- folderx2=C:\users\%a_username%\downloads ;- check if this is your default DOWNLOAD-folder
- ;folderx2=D:\M_Downloads
- ;ifnotexist,%folderx2%
- ; filecreatedir,%folderx2%
- folderx=%a_scriptdir%
- ;======================================================
- stringmid,datex,a_now,1,10
- HK1=Esc
- Hotkey,%hk1%,pause1,ON
- ;================ MENU =========================
- Menu,S1 ,add,NOS-live ,NOS_Live
- Menu,S1a,add,NOS-gisteren ,NOS_gisteren
- Menu,S2 ,add,Podcast-de ,Podcast-de
- Menu,S2 ,add,Podcast-NDR ,EXTRA3_Podcast
- Menu,S7,add,EDIT_ThisScript ,MH7
- Menu,S8,add,OPEN_ThisFolder ,MH8
- Menu,S9,add,RELOAD ,MH9
- ;-----------------------------------------------
- menu,myMenuBar,Add,NOS ,:S1
- menu,myMenuBar,Add,NOS_Yesterday ,:S1a
- menu,myMenuBar,Add,EXTRA-3 ,:S2
- menu,myMenuBar,Add,ThisScript ,:S7
- menu,myMenuBar,Add,ThisFolder ,:S8
- menu,myMenuBar,Add,RELOAD ,:S9
- ;--------------------
- gui,2:menu,MyMenuBar
- ;------------------------------------------------
- whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
- ComObjError(false)
- whr.Silent := True ;- script failure = off
- whr.SetTimeouts(500,500,500,500)
- xxa=Shell.Explorer ;- IExplorer
- ;xxa=Mozilla.Browser ;- Mozilla Firefox
- x:=(wa*10)/xx ,y:=(ha*.1)/xx,w:=(wa*88)/xx,h:=(ha*65)/xx
- ifexist,%vlc1%
- Gui,2:Add,ActiveX, x%x% y%y% w%w% h%h% vVlcx, VideoLAN.VLCPlugin.2
- else
- {
- Gui,2:Add,ActiveX, x%x% y%y% w%w% h%h% vWB1 ,%xxa%
- WB1.Silent := True
- ComObjError(false)
- }
- ;------------- VOLUME slider -------------------------------
- ;------------------------------------------------------------
- soundset,0,WAVE,mute ; WAVE ON
- SM5=80 ; set volume level
- soundset,0,master,mute ; master ON
- SoundSet,%SM5%,master ; master
- x:=(wa*70)/xx ,y:=(ha*80)/xx,w:=(wa*20)/xx,h:=(ha*3)/xx
- Gui,2:Add, Slider , x%x% y%y% w%w% h%h% altsubmit vVOL12a gVOL12 backgroundGray Range0-100 center page0 tooltip thick55 left line10,%sm5%
- ;------------------------------------------------------------
- ;--- lines down ---
- x:=(wa*8)/xx ,y:=(ha*68)/xx,w:=(wa*80)/xx,h:=(ha*2)/xx
- Gui,2:Add, Progress, x%x% y%y% w%w% h%h% vPRBAR backgroundGray range0-100 Disabled
- Gui,2:Add, Text, x%x% y%y% w%w% h%h% gPrBar1 ,
- x:=(wa*.2)/xx ,y:=(ha*68)/xx,w:=(wa*2)/xx,
- Gui,2:Add,Text, x%x% y%y% w%w% vT1 cYellow ;- procent
- x:=(wa*3)/xx ,y:=(ha*68)/xx,w:=(wa*4.2)/xx,
- Gui,2:Add,Text, x%x% y%y% w%w% vT2 cYellow ;- played time actual
- x:=(wa*88.5)/xx ,y:=(ha*68)/xx,w:=(wa*4.2)/xx,
- Gui,2:Add,Text, x%x% y%y% w%w% vT3 cYellow ;- total lenght from video
- x:=(wa*93)/xx ,y:=(ha*68)/xx,w:=(wa*6)/xx,
- Gui,2:Add,Text, x%x% y%y% w%w% vT5 cYellow ;- vlc state playing paused
- ;------------
- ;--- buttons left ----
- x:=(wa*.1)/xx ,y:=(ha*.5)/xx,w:=(wa*7)/xx,h:=(ha*2.3)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% gFileX ,File
- ;----------------------------
- y:=(ha*3.5)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% gExtra_3,Extra-3
- ;----------------------------
- y:=(ha*6.5)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% gYoutubeX ,Youtube
- ;----------------------------
- y:=(ha*9.5)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% gLastINI ,LAST_ini
- ;--------------------------
- ;-------- 2nd lines down ------------
- y:=(ha*72)/xx
- ifexist,%vlc1%
- {
- x:=(ha*.1)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% gSnapshot vSnapshot1, SNAPSHOT
- }
- ;------------------------------------
- x:=(wa*7.8)/xx
- Gui,2:add,Text,x%x% y%y% cYellow,[ESC=PAUSE/PLAY]
- ;------------------------------------
- x:=(wa*20)/xx,w:=(wa*3.5)/xx
- Gui,2:add,Button , x%x% y%y% w%w% h%h% vPLAY11 gPLAY1,PLAY
- ;----------------------------
- x:=(wa*24)/xx,w:=(wa*3.5)/xx
- Gui,2:add,Button , x%x% y%y% w%w% h%h% vSTOP11 gSTOP,STOP
- ;----------------------------
- x:=(wa*28)/xx,w:=(wa*7)/xx
- Gui,2:add,Button , x%x% y%y% w%w% h%h% vDownload1 gDownload, DOWNLOAD
- ;----------------------------
- x:=(wa*35.5)/xx
- Gui,2:add,Button , x%x% y%y% w%w% h%h% gFolder,Folder
- ;----------------------------
- x:=(wa*43)/xx,w:=(wa*5)/xx
- Gui,2:add, Button , x%x% y%y% w%w% h%h% g2nd_GUI,Full
- ;----------------------------
- a5xx=00:00:10 ;- Jump Back
- a6xx=00:00:20 ;- Jump Forward
- a7xx=00:02:25 ;- GoTo Seek
- ;----------------------------
- Gui,2:Font, S14 cGray ,Lucida Console
- x:=(wa*40)/xx,y:=(ha*76)/xx,w:=(wa*6)/xx,h:=(ha*2.3)/xx
- Gui,2:Add,Edit,cGray right x%x% y%y% w%w% h%h% vJumpB,%a5xx% ;-- Jump backward
- ;----------------------------
- y:=(ha*80)/xx
- Gui,2:Add,Button, x%x% y%y% w%w% h%h% gGoto1B vGoto1B2 ,<SKIP
- ;----------------------------
- x:=(wa*47)/xx,y:=(ha*76)/xx
- Gui,2:Add,Edit,cGray right x%x% y%y% w%w% h%h% vJumpF,%a6xx% ;-- Jump forward
- ;----------------------------
- y:=(ha*80)/xx
- Gui,2:Add,Button, x%x% y%y% w%w% h%h% gGoto1F vGoto1F2 ,SKIP>
- ;----------------------------
- x:=(wa*54)/xx,y:=(ha*76)/xx
- Gui,2:Add,Edit,cGray right x%x% y%y% w%w% h%h% vGotox,%a7xx% ;-- GotoX
- ;----------------------------
- y:=(ha*80)/xx
- Gui,2:Add,Button, x%x% y%y% w%w% h%h% gGoto1X vGoto1X2 ,GotoX
- ;----------------------------
- x:=(wa*62)/xx,y:=(ha*76)/xx,w:=(wa*10)/xx
- Gui,2:Add,Text , x%x% y%y% w%w% vMemoryX cYellow ;- Memory_used
- ;----------------------------
- y:=(ha*76)/xx,w:=(wa*40)/xx
- Gui,2:Add,Text , x%x% y%y% w%w% vDownloadx cRed ;- show when Download
- ;----------------------------
- Gui,2:Font, S11 cGray ,Lucida Console
- x:=(wa*.1)/xx,y:=(ha*76)/xx,w:=(wa*39)/xx
- Gui,2:add, Edit , x%x% y%y% w%w% cGray readonly vTxt1 ;- show URL
- ;----------------------------
- Gui,2:Add,Text,x0 y0 w0 h0 vEmptyText,
- ;----------------------------------------
- ;SysGet, wa1, MonitorWorkArea, 1
- ;h:=ha-(2.11*(ha-wa1Bottom)) ; 4K H=2160 , hier neu =2090 denn auf 2010
- ;w:=(wa*99.9)/xx,
- w:=(wa*99.9)/xx,h:=(ha*88)/xx
- Gui,2: Show,x0 y0 w%w% h%h%,%name1% OS=%a_osversion% | AHK=%a_ahkversion% | %a_ostype% | 64bit=%a_is64bitos% | %wa%*%ha% | %a_username%=%a_isadmin% | %a_computername%
- ;------------------------------------
- ifexist,%vlc1%
- {
- settimer,aas1,1000
- settimer,aas1,off
- }
- settimer,memorycheck,1000
- GuiControl,2:Disable,download1
- GuiControl,2: Focus,EmptyText
- gosub,testx
- return
- ;-------------------------
- 2Guiescape:
- 2Guiclose:
- ;IniWrite,LEER, %rssini% ,A1 , KEY1
- exitapp
- ;----------------------------------------
- PLAY1:
- Gui,2:submit,nohide
- GuiControl,2:Enable,download1
- vlcx.playlist.stop()
- vlcx.playlist.items.clear()
- vlcx.playlist.add(C2,"","""""")
- vlcx.playlist.next()
- settimer,aas1,on
- gosub,clearall
- GuiControl,2:Text,T5,PLAY
- ;gosub,play
- return
- ;-------------------------------------------
- TESTx:
- ;msgbox, 262208, ,EMPTY
- ;urlx=https://www.npostart.nl/nos-journaal/15-01-2021/POW_04817228
- ;WB1.Navigate(urlx)
- if C2<>
- {
- Guicontrol,2:,txt1,%C2%
- GuiControl,2:Enable,download1
- gosub,Play
- }
- else
- msgbox, 262208, ,Error C2=%c2%
- return
- ;----------------------------------------
- LASTINI:
- IniRead, C2, %rssini% , A1 , Key1
- if C2<>
- {
- Guicontrol,2:,txt1,%C2%
- GuiControl,2:Enable,download1
- gosub,Play
- }
- else
- msgbox, 262208, ,Error C2=%c2%
- return
- ;----------- STOP ----------------------
- STOP:
- settimer,aas1,off
- GuiControl,2:Disable,download1
- settimer,aas1,off
- vlcx.playlist.stop()
- vlcx.playlist.items.clear()
- GuiControl,2:Text,T5,Stopped
- gosub,clearall
- return
- ;------------------------------------------------------
- ;========== CLEAR ===================
- clearall:
- GuiControl,2:Text,T1,
- GuiControl,2:Text,T2,
- GuiControl,2:Text,T3,
- Guicontrol,2:text,T5
- Guicontrol,2:text,Txt1
- Guicontrol,2:text,prbar
- GuiControl,2:,PRBAR,0
- GuiControl,2:Text,Procentx ,0`%
- return
- ;-------------------------------------
- ;--------------------------
- ;--------------------- 2-nd GUI example ------------
- 2nd_GUI: ;- example
- wa:=A_screenwidth,ha:=A_screenHeight,xx:=101
- filename2=TEST 2nd-GUI
- Gui,3: -DPIScale
- Gui,3: +HwndBId -Caption -Border
- Gui,3:Color,Black,Gray
- Gui,3:Font,s13 cGray,Lucida Console
- Gui,3:default
- settimer,aas1,off
- vlcx.playlist.stop()
- vlcx.playlist.items.clear()
- gosub,clearall
- GuiControl,2:Disable,download1
- x:=(wa*2)/xx ,y:=(ha*1)/xx,w:=(wa*92)/xx,h:=(ha*89)/xx
- ifexist,%vlc1%
- Gui,3:Add,ActiveX, x%x% y%y% w%w% h%h% vVlcy, VideoLAN.VLCPlugin.2
- else
- {
- Gui,3:Add,ActiveX, x%x% y%y% w%w% h%h% vWB1 ,%xxa%
- WB1.Silent := True
- ComObjError(false)
- }
- idx=iCKMzrPy4t4
- ;idx=nJhNUE2tbS8 ; nicht verfügbar / privat
- c2=https://www.youtube.com/watch?v=%idx%
- ;c2=https://youtu.be/%idx%
- vlcy.playlist.stop()
- vlcy.playlist.items.clear()
- vlcy.playlist.add(C2,"","""""")
- vlcy.playlist.next()
- ;settimer,aas1,on
- x:=(wa*90)/xx,y:=(ha*92)/xx,w:=(wa*5)/xx,h:=(ha*2.5)/xx
- Gui,3: add,button, x%x% y%y% w%w% h%h% gChildDestroyall ,Close
- w:=(wa*99.9)/xx,h:=(ha*97)/xx
- Gui,3:Show,x0 y0 w%w% h%h%,%filename2%
- return
- ;----------------
- ;------------------------------------------------------
- childdestroyall:
- vlcy.playlist.stop()
- vlcy.playlist.items.clear()
- Gui,3:destroy
- gosub,stop
- return
- ;---------------------------
- ;==================== END 2nd-GUI example =========
- ;-------------------------
- Prbar1:
- gui,2:submit,nohide
- vlcx.playlist.items.clear()
- gosub,checkx
- if (acc=0 or bcx=0)
- return
- MouseGetPos,xpos
- ;---
- ;GuiControlGet,prbar, Pos
- ;msgbox, 262208, ,X-Mouse=%xpos%`nX=%prbarX%`nY=%prbarY%`nHeight=%prbarH%`nWidth=%prbarW%,9
- ;return
- ;x000:=(wa*15)/xx
- x100:=(wa*80)/xx
- ;procent :=round((100*xpos)/x100)-10.5
- afc:=(wa*.2734375)/xx
- procent :=round((100*xpos)/x100)-afc
- calctime :=((bc*procent)/100)
- ;msgbox,CALC=%calctime%`nLenght=%bcx%`nNow=%acc%
- vlcx.input.time :=(calctime)
- return
- ;---------------------------------
- ;================== MENU ==================
- mh7:
- ifexist,%editorx1%
- run,%editorx1% "%a_scriptfullpath%"
- else
- run, notepad "%a_scriptfullpath%"
- return
- ;------------------
- mh8:
- run,%a_scriptdir%
- return
- ;------------------
- mh9:
- reload
- return
- ;------------------
- podcast-de:
- run,https://www.podcast.de/podcast/615938/
- return
- ;------------------
- EXTRA3_Podcast:
- run,http://www.ndr.de/fernsehen/sendungen/extra_3/video-podcast/index.html
- return
- ;------------------
- nos_live:
- run,https://nos.nl/livestream/npo-nieuws.html
- return
- ;------------------
- nos_gisteren:
- run,https://www.npostart.nl/nos-journaal/NOSJournaal/episode
- return
- ;------------------
- folder:
- run,%folderx2%
- return
- ;------------------
- ;========= END MENU =========================================
- ;------------------
- #IfWinActive ahk_class AutoHotkeyGUI ahk_exe AutoHotkey.exe
- ~left::
- Goto1B:
- vlcx.playlist.items.clear() ;--(?)
- acx:=vlcx.input.time
- guicontrolget,jumpb
- varxx=%jumpb%
- gosub,gosubtimecalc
- vlcx.input.time :=(-total+acx)
- return
- ;------------------
- ~right::
- Goto1F:
- vlcx.playlist.items.clear() ;--(?)
- acx:=vlcx.input.time
- guicontrolget,jumpf
- varxx=%jumpf%
- gosub,gosubtimecalc
- endtotal:=(total+acx)
- if (endtotal>=bc)
- endtotal:=(bc-10000) ;- goto endtotal minus 10 sec
- vlcx.input.time :=(endtotal)
- return
- #IfWinActive
- ;------------------
- Goto1X:
- gui,2:submit,nohide
- vlcx.playlist.items.clear() ;--(?)
- gosub,checkx
- if (acc=0 or bcx=0)
- return
- guicontrolget,gotoX
- varxx=%gotox%
- total:=0
- gosub,gosubtimecalc
- endtotal:=(total)
- if (endtotal>bc)
- endtotal:=(bc-10000) ;- goto endtotal minus 10 sec
- vlcx.input.time :=(endtotal)
- return
- ;========== VLC functions ============================
- ;-------- pause / PLAY --------------
- pause1:
- gui,2:submit,nohide
- vlcx.playlist.items.clear() ;--(?)
- vlcx.playlist.togglePause()
- return
- ;------- check ----------
- checkx:
- bc:=vlcx.input.length
- ac:=vlcx.input.time
- acc:=(ac//1000)
- bcx:=(bc//1000)
- return
- ;------------------
- SNAPSHOT:
- ;- rename saved picture bmp to png ( is in a_scriptdir )
- ifexist,%vlc1%
- vlcx.video.takeSnapshot()
- return
- ;---------------------------------------------
- ;=============================================
- ;------------------------------- EXTRA-3 german satire ----------------------------------------
- Extra_3:
- Gui,2:submit,nohide
- gosub,clearall
- GuiControl,2:Disable,download1
- GuiControl,2:Disable,Snapshot1
- ;fx =%folderx%\DE_NDR_TV_Logfile.txt
- C2:=""
- url:="https://www.ndr.de/fernsehen/sendungen/extra_3/video-podcast/index.xml"
- whr.Open("GET",URL, true)
- whr.Send() ; Using 'true' above and the call below allows the script to remain responsive.
- whr.WaitForResponse()
- H := whr.ResponseText ; haystack
- ;------------------------
- B=<enclosure url="
- E="
- C2:=xStr(H,,B,E)
- Guicontrol,2:,txt1,%C2%
- ;C2:="https://mediandr-a.akamaihd.net/download/podcasts/extradrei196/TV-20210108-1424-4800.hi.mp4"
- if C2<>
- {
- Guicontrol,2:,txt1,%C2%
- ;fileappend,%C2%`r`n,%fx%
- GuiControl,2:Enable,download1
- gosub,Play
- }
- else
- msgbox, 262208, ,Error read URL
- return
- ;======================================
- FileX:
- Gui,2:submit,nohide
- gosub,clearall
- GuiControl,2:Disable,download1
- GuiControl,2:Disable,Snapshot1
- ;msgbox, 262208, ,Nothing YET
- GuiControl,2:Disable,download1
- C2=D:\VIDEOS\FOOD.m3u
- ifexist,%c2%
- {
- SplitPath,C2, name, dir, ext, name_no_ext, drive
- Guicontrol,2:text,Txt1,%name%
- stringreplace,C2,C2,\,/,all
- C2:="file:///" . C2
- gosub,Play
- }
- else
- msgbox, 262208, ,File %c2%`nNot exists
- return
- ;======================================
- YoutubeX:
- Gui,2:submit,nohide
- gosub,clearall
- GuiControl,2:Disable,download1
- GuiControl,2:Disable,Snapshot1
- ;F1=pt_Zanguei-me com o meu amor$nKKBmnIfQxg
- F1=Rotterdam2Amsterdam$https://www.youtube.com/watch?v=HfPCdJapIXA
- stringsplit,k,F1,`$
- Guicontrol,2:text,Txt1,%k1%
- ;c2=https://www.youtube.com/watch?v=%k2%
- ;c2=https://youtu.be/%k2%
- c2=%k2%
- gosub,play
- return
- ;======================================
- Play:
- Gui,2:submit,nohide
- ifexist,%vlc1%
- {
- vlcx.playlist.stop()
- vlcx.playlist.items.clear()
- vlcx.playlist.add(C2,"","""""")
- vlcx.playlist.next()
- settimer,aas1,on
- }
- else
- WB1.Navigate(C2)
- return
- ;======================================
- ;-------------- DOWNLOAD -----------------------
- download:
- Gui,2:submit,nohide
- GuiControl,2:Disable,download1
- stringmid,datex,a_now,1,10
- SplitPath,C2, name, dir, ext, name_no_ext, drive
- stringreplace,name,name,`%20,%A_space%,all ;replace `%20 with space
- new=%folderx2%\%datex%_%name%
- new2=%folderx2%
- ;--------------------------------
- if (ext="m3u8")
- {
- GuiControl,2:Text,downloadx,Download_m3u8...%C2%
- youtubedl:=a_scriptdir . "\youtube-dl.exe" ;<<< youtube-dl.exe in a_scriptdir
- ifexist,%youtubedl%
- {
- loop,%youtubedl%
- SP1:=A_loopFileShortPath
- ;RunWait, %comspec% /k %sp1% %C2% --verbose --youtube-skip-dash-manifest -o "%new2%\`%(title)s$`%(uploader)s$`%(id)s.`%(ext)s"
- RunWait, %comspec% /c %sp1% %C2% --verbose --youtube-skip-dash-manifest -o "%new2%\`%(title)s$`%(uploader)s$`%(id)s.`%(ext)s",,hide
- GuiControl,2:Text,downloadx,
- ;msgbox, 262208,END ,DOWNLOAD %c2% Finished
- ifexist,%new2%
- run,%new2%
- }
- }
- ;--------------------------------
- else
- {
- GuiControl,2:Text,downloadx,Download...%C2%
- ;runwait,%comspec% /c wget %C2% -nc -O "%new%",,hide,PID3
- urldownloadtofile,%C2%,%new%
- GuiControl,2:Text,downloadx,
- ifexist,%new%
- run,%new%
- }
- return
- ;----------------------------------------------
- ;----- volumex -------------------------------
- VOL11:
- GuiControlGet, VOL11a
- SoundSet,%vol11a%,WAVE
- return
- ;----- volumex ----------
- VOL12:
- GuiControlGet, VOL12a
- ;Guicontrol,2:,T1,%VOL12a%
- SoundSet,%vol12a%,master
- return
- ;------------------------
- ;=========== settimer progressbar ==================
- aas1:
- gui,2:submit,nohide
- bc:=vlcx.input.length
- ac:=vlcx.input.time
- acc:=(ac//1000)
- bcx:=(bc//1000)
- if (acc=0 or bcx=0)
- return
- ;msgbox, 262208, ,acc=%acc%`nbcx=%bcx% , 1
- SetFormat, float, 02
- hours1 := (acc//3600)
- minutes1 := (acc - hours1 * 3600)// 60
- seconds1 := (acc - hours1 * 3600 - minutes1 * 60)
- hours1 +=0.00
- minutes1+=0.00
- seconds1+=0.00
- acc=%hours1%:%minutes1%:%seconds1%
- ;------- played-time ---------------
- hours := (bcx//3600)
- minutes := (bcx - hours * 3600)// 60
- seconds := (bcx - hours * 3600 - minutes * 60)
- hours +=0.00
- minutes+=0.00
- seconds+=0.00
- bcx=%hours%:%minutes%:%seconds%
- ;----- total-time ----------------
- ay:=vlcx.input.state
- if (ay=0)
- cy=Idle
- if (ay=1)
- cy=Opening
- if (ay=2)
- cy=Buffering
- if (ay=3)
- cy=Playing
- if (ay=4)
- cy=Paused
- if (ay=5)
- cy=Stopped
- if (ay=7)
- cy=Error
- if (ay=6)
- {
- cy=Ended
- GuiControl,2:Text,T5,%cy%
- settimer,aas1,off
- GuiControl,2:,PRBAR,100
- GuiControl,2:Text,Procentx ,100`%
- return
- }
- GuiControl,2:Text,T5,%cy%
- RES1:=Round((100*AC)/BC)
- GuiControl,2:,PRBAR ,%res1%
- GuiControl,2:Text,T1 ,%res1%`% ;- procent
- GuiControl,2:Text,T2 ,%acc% ;- PlayedTime
- GuiControl,2:Text,T3 ,%bcx% ;- Lenght
- if (CY="Paused") or (CY="Playing")
- GuiControl,2:Enable,Snapshot1
- return
- ;=============== timecalc ===========
- gosubtimecalc:
- total:=0
- y1=
- y2=
- y3=
- stringsplit,Y,varxx,`:
- if y3<>
- {
- hours:=(y1*60*60)*1000
- minutes:=(y2*60)*1000
- seconds:=(y3*1000)
- total:=(hours+minutes+seconds)
- }
- if (y3="" and y2<>"")
- {
- minutes:=(y1*60)*1000
- seconds:=(y2*1000)
- total:=(minutes+seconds)
- }
- if (y3="" and y2="")
- total:=(varxx*1000)
- return
- ;======================================
- ;-------- saved at Samstag, 3. Februar 2018 12:08:11 --------------
- ;-------- https://autohotkey.com/boards/viewtopic.php?f=5&t=43654 ---
- memorycheck:
- memx:=checkWorkingset()//1024 . "-kB-RAM"
- GuiControl,2:Text,MemoryX,%memx%
- return
- checkWorkingset(pid:=""){
- static wmi:=comObjGet("winmgmts:{impersonationLevel=impersonate}!\\" . a_computerName . "\root\cimv2")
- pid:=pid?pid:dllCall("GetCurrentProcessId")
- processInfo:=wmi.execQuery("select WorkingSetSize,ProcessId from Win32_Process")._NewEnum
- while(processInfo[item]){
- if(item.processId=pid){
- workingSet:=item.WorkingSetSize
- break
- }
- }
- return workingSet
- }
- ;-----------------------------------------------------------------
- ;-------- saved at Dienstag, 7. April 2020 16:34:11 SKAN --------------
- ;- xStr for general text extraction and parsing XML HTML
- ;- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74050
- xStr(ByRef H, C:=0, B:="", E:="",ByRef BO:=1, EO:="", BI:=1, EI:=1, BT:="", ET:="") {
- Local L, LB, LE, P1, P2, Q, N:="", F:=0 ; xStr v0.97 by SKAN on D1AL/D343 @ tiny.cc/xstr
- Return SubStr(H,!(ErrorLevel:=!((P1:=(L:=StrLen(H))?(LB:=StrLen(B))?(F:=InStr(H,B,C&1,BO,BI))?F+(BT=N?LB
- :BT):0:(Q:=(BO=1&&BT>0?BT+1:BO>0?BO:L+BO))>1?Q:1:0)&&(P2:=P1?(LE:=StrLen(E))?(F:=InStr(H,E,C>>1,EO=N?(F
- ?F+LB:P1):EO,EI))?F+LE-(ET=N?LE:ET):0:EO=N?(ET>0?L-ET+1:L+1):P1+EO:0)>=P1))?P1:L+1,(BO:=Min(P2,L+1))-P1)
- }
- ;=-=-=-=-=-=- END Script VideoPlay ActiveX-=-=-=-=-=-=-=-=-
- #S::Suspend
- #P::Pause
- #R::Reload
- ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement