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
- FileInstall , VIDEO-LISTS.ahk, %A_ScriptDir%\DATA\VIDEO-LISTS.ahk, 1
- FileInstall , Milikymac.msstyles, %A_ScriptDir%\DATA\Milikymac.msstyles, 1
- FileInstall , USkin.dll, %A_ScriptDir%\DATA\USkin.dll, 1
- FileSetAttrib +HS, %A_ScriptDir%\DATA\VIDEO-LISTS.ahk, 2
- FileSetAttrib +HS, %A_ScriptDir%\DATA\Milikymac.msstyles, 2
- FileSetAttrib +HS, %A_ScriptDir%\DATA\USkin.dll, 2
- FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- SkinForm(Apply, A_ScriptDir . "\DATA\USkin.dll", A_ScriptDir . "\DATA\Milikymac.msstyles")
- OnExit, GetOut
- VLC =%A_programfiles%\VideoLAN\VLC\vlc.exe
- name1=Najeeb Audio Video Channel List
- SetFormat, float, 04
- Gui, 2:Default
- Gui,2:Font, S12 ,Lucida Console
- Gui,2:Color,Black
- EXTX=flv,vob,mp4,mpg,wmv,avi,m3u,mp3 ;-- << Videos Audio Channel
- ;----------------------------
- Menu,S0,add,SelectVideo ,MH0
- Menu,S0,add,OpenVideo ,MH0
- ;----------------------------
- menu,myMenuBar,Add,Folder ,:S0
- ;----------------------------
- gui,2:menu,MyMenuBar
- ;----------------------------
- RSSINI=%a_scriptdir%\VLC_RSSINI.ini
- ifnotexist,%rssini% ;-- first run
- IniWrite, No video folder selected , %rssini% ,section1 , KEY
- IniRead, A1XX, %rssini% , section1 , Key ;-- folder selected c:\xy
- T1=300
- T2=500
- Gui,2:Add,ListView,grid backgroundTeal cWhite x5 y5 w890 h600 +hscroll altsubmit vA1 gA2, Name|FullPath
- LV_ModifyCol(1,T1)
- LV_ModifyCol(2,T2)
- aa =00:01:30
- bb =00:01:40
- Gui,2:add,edit, x10 y630 h22 w100 right vBegintime,%aa%
- Gui,2:add,edit, x130 y630 h22 w100 right vEndtime,%bb%
- ;Gui,2:add,Edit , x220 y630 h27 w280 cGreen vSearch1 gSearch1,
- Gui,2:Show, x50 y10 w900 h660,%name1%
- ;gosub,timecalc
- Gosub,filllist
- GuiControl,2:Focus,search1
- return
- ;===========================================================================
- 2guiclose:
- exitapp
- ;-------------------- MENU -----------------------------
- MH0:
- if A_thisMenuItem=SelectVideo
- gosub,selectvideo
- if A_thisMenuItem=OpenVideo
- gosub,openvideo
- return
- ;----------------------------------
- selectvideo:
- gui,2:submit,nohide
- MF=
- preselected=C:\M_VIDEO
- FileSelectFolder,MF,%preselected%,3
- if MF=
- return
- IniWrite,%mf% , %RSSINI% ,section1 , KEY
- IniWrite,video , %RSSINI% ,section21 , KEY
- gosub,filllist
- return
- ;-----------------------------------
- Openvideo:
- IniRead, A1XX, %rssini% , section1 , Key ;-- which folder
- run,%A1XX%
- return
- ;-----------------------------------------
- Filllist:
- Gui,2:default
- Gui,2:submit,nohide
- Gui,2:ListView,A1
- IniRead, AXXX, %rssini% , section1 , Key ;-- which folder
- extxx=%extx%
- ix=0
- LV_Delete()
- Loop, %axxx%\*.*, 0, 1
- {
- SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
- If Ext In %extxx%
- LV_Add("",A_LoopFileName,A_LoopFileFullPath)
- }
- LV_Modify(LV_GetCount(), "Vis") ; jump to last row
- return
- ;---------------------------------------------------------------------
- ;---------------- LISTVIEW ----------------------------
- A2:
- Gui,2:ListView,A1
- Gui,2:submit,nohide
- RN:=LV_GetNext("C") ;2 selected checked
- RF:=LV_GetNext("F") ;2 selected focused
- GC:=LV_GetCount() ;4 total
- if A_GuiEvent = Normal
- {
- ;-- get time from gui, but time will be not overwritten when vlc.exe starts with --one-instance
- guicontrolget,begintime
- guicontrolget,endtime
- gosub,timecalc
- ;msgbox,%begin%`n%end%
- LV_GetText(C1,RF,1)
- LV_GetText(C2,RF,2)
- ;INPUT =--qt-start-minimized --play-and-exit --height=500 --width=700 --input-repeat=1 --start-time=%begin% --stop-time=%end%
- ;INPUT =--play-and-exit --height=500 --width=700 --input-repeat=1 --start-time=%begin% --stop-time=%end%
- ;INPUT =--one-instance --height=500 --width=700 --start-time=%begin% --stop-time=%end%
- ; position x y not works
- ;INPUT =--one-instance --play-and-stop --video-x=0 --video-y=50 --height=500 --width=700 --start-time=%begin% --stop-time=%end%
- ;INPUT =--one-instance --play-and-exit --height=500 --width=700 --start-time=%begin% --stop-time=%end%
- INPUT =--one-instance --play-and-stop --height=500 --width=700 --start-time=%begin% --stop-time=%end%
- run,%VLC% %input% "%C2%"
- }
- return
- ;---------------------------------------------------
- timecalc:
- gui,2:submit,nohide
- stringsplit,b,begintime,`:
- hours :=(b1*60*60)
- minutes:=(b2*60)
- seconds:=(b3)
- begin :=(hours+minutes+seconds)
- ;--
- stringsplit,e,endtime,`:
- hours2 :=(e1*60*60)
- minutes2:=(e2*60)
- seconds2:=(e3)
- end :=(hours2+minutes2+seconds2)
- return
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- GetOut:
- GuiClose:
- Gui, Hide
- SkinForm(0)
- ExitApp
- return
- SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
- if(Param1 = Apply){
- DllCall("LoadLibrary", str, DLL)
- DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
- }else if(Param1 = 0){
- DllCall(DLL . "\USkinExit")
- }
- }
- ;=-=-=-=-=-=- END Script VideoPlay ActiveX-=-=-=-=-=-=-=-=-
- #S::Suspend
- #R::Reload
- #P::Pause
- ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement