Advertisement
Najeebsk

VIDEO-LISTS.ahk

Mar 22nd, 2023 (edited)
1,885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*   INFO
  2.    VLC VIDEOS PLAYER
  3.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  4.    Last Modified: 3-20-2023
  5. */
  6. ;#warn
  7. #NoEnv
  8. #SingleInstance, Force
  9. Process, Priority, , A
  10. SendMode, Input
  11. SetBatchLines, -1
  12. ;#NoTrayIcon
  13. SetWorkingDir %A_ScriptDir%  
  14. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  15. FileCreateDir, %A_ScriptDir%\DATA
  16. FileInstall , VIDEO-LISTS.ahk, %A_ScriptDir%\DATA\VIDEO-LISTS.ahk, 1
  17. FileInstall , Milikymac.msstyles, %A_ScriptDir%\DATA\Milikymac.msstyles, 1
  18. FileInstall , USkin.dll, %A_ScriptDir%\DATA\USkin.dll, 1
  19. FileSetAttrib +HS, %A_ScriptDir%\DATA\VIDEO-LISTS.ahk, 2
  20. FileSetAttrib +HS, %A_ScriptDir%\DATA\Milikymac.msstyles, 2
  21. FileSetAttrib +HS, %A_ScriptDir%\DATA\USkin.dll, 2
  22. FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
  23. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  24. SkinForm(Apply, A_ScriptDir . "\DATA\USkin.dll", A_ScriptDir . "\DATA\Milikymac.msstyles")
  25. OnExit, GetOut
  26.  
  27.  
  28. VLC         =%A_programfiles%\VideoLAN\VLC\vlc.exe
  29. name1=Najeeb Audio Video Channel List
  30. SetFormat, float, 04
  31. Gui, 2:Default
  32. Gui,2:Font,  S12 ,Lucida Console
  33. Gui,2:Color,Black
  34.  
  35. EXTX=flv,vob,mp4,mpg,wmv,avi,m3u,mp3         ;-- <<  Videos Audio Channel
  36.  
  37.    ;----------------------------
  38.  
  39.    Menu,S0,add,SelectVideo      ,MH0
  40.    Menu,S0,add,OpenVideo        ,MH0
  41.    ;----------------------------
  42.    menu,myMenuBar,Add,Folder    ,:S0
  43.    ;----------------------------
  44.    gui,2:menu,MyMenuBar
  45.    ;----------------------------
  46.  
  47.  
  48. RSSINI=%a_scriptdir%\VLC_RSSINI.ini
  49. ifnotexist,%rssini%                       ;-- first run
  50.     IniWrite, No video folder selected , %rssini% ,section1   , KEY
  51. IniRead, A1XX, %rssini% , section1  , Key    ;-- folder selected      c:\xy
  52.  
  53. T1=300
  54. T2=500
  55. Gui,2:Add,ListView,grid backgroundTeal cWhite x5 y5 w890 h600 +hscroll altsubmit vA1 gA2, Name|FullPath
  56. LV_ModifyCol(1,T1)
  57. LV_ModifyCol(2,T2)
  58.  
  59. aa =00:01:30
  60. bb =00:01:40
  61. Gui,2:add,edit, x10  y630 h22 w100 right vBegintime,%aa%
  62. Gui,2:add,edit, x130 y630 h22 w100 right vEndtime,%bb%
  63. ;Gui,2:add,Edit  , x220 y630 h27 w280 cGreen vSearch1 gSearch1,
  64. Gui,2:Show, x50 y10 w900 h660,%name1%
  65. ;gosub,timecalc
  66. Gosub,filllist
  67. GuiControl,2:Focus,search1
  68. return
  69. ;===========================================================================
  70.  
  71. 2guiclose:
  72. exitapp
  73.  
  74. ;-------------------- MENU -----------------------------
  75. MH0:
  76. if A_thisMenuItem=SelectVideo
  77.    gosub,selectvideo
  78.  
  79. if A_thisMenuItem=OpenVideo
  80.    gosub,openvideo
  81.  
  82. return
  83. ;----------------------------------
  84.  
  85.  
  86. selectvideo:
  87. gui,2:submit,nohide
  88.    MF=
  89.    preselected=C:\M_VIDEO
  90.    FileSelectFolder,MF,%preselected%,3
  91.    if MF=
  92.      return
  93.    IniWrite,%mf%    , %RSSINI%  ,section1      , KEY
  94.    IniWrite,video   , %RSSINI%  ,section21     , KEY
  95.    gosub,filllist
  96. return
  97. ;-----------------------------------
  98.  
  99.  
  100. Openvideo:
  101. IniRead, A1XX, %rssini% , section1 , Key         ;-- which folder
  102. run,%A1XX%
  103. return
  104. ;-----------------------------------------
  105.  
  106.  
  107. Filllist:
  108. Gui,2:default
  109. Gui,2:submit,nohide
  110. Gui,2:ListView,A1
  111.   IniRead, AXXX, %rssini% , section1 , Key         ;-- which folder
  112.   extxx=%extx%
  113.  
  114. ix=0
  115. LV_Delete()
  116. Loop, %axxx%\*.*, 0, 1
  117.     {
  118.    SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
  119.    If Ext In %extxx%
  120.           LV_Add("",A_LoopFileName,A_LoopFileFullPath)
  121.      }
  122. LV_Modify(LV_GetCount(), "Vis")   ; jump to last row
  123. return
  124. ;---------------------------------------------------------------------
  125.  
  126.  
  127. ;----------------  LISTVIEW ----------------------------
  128. A2:
  129. Gui,2:ListView,A1
  130. Gui,2:submit,nohide
  131.      RN:=LV_GetNext("C")  ;2  selected checked
  132.      RF:=LV_GetNext("F")  ;2  selected focused
  133.      GC:=LV_GetCount()    ;4  total
  134.  
  135. if A_GuiEvent = Normal
  136. {
  137.   ;-- get time from gui, but time will be not overwritten when vlc.exe starts with --one-instance
  138.   guicontrolget,begintime
  139.   guicontrolget,endtime
  140.   gosub,timecalc
  141.   ;msgbox,%begin%`n%end%
  142.  
  143.   LV_GetText(C1,RF,1)
  144.   LV_GetText(C2,RF,2)
  145.   ;INPUT   =--qt-start-minimized --play-and-exit --height=500 --width=700 --input-repeat=1 --start-time=%begin% --stop-time=%end%
  146.   ;INPUT   =--play-and-exit --height=500 --width=700 --input-repeat=1 --start-time=%begin% --stop-time=%end%
  147.   ;INPUT   =--one-instance --height=500 --width=700 --start-time=%begin% --stop-time=%end%
  148.   ; position x y not works
  149.   ;INPUT   =--one-instance --play-and-stop --video-x=0 --video-y=50 --height=500 --width=700 --start-time=%begin% --stop-time=%end%
  150.   ;INPUT   =--one-instance --play-and-exit --height=500 --width=700 --start-time=%begin% --stop-time=%end%
  151.   INPUT   =--one-instance --play-and-stop --height=500 --width=700 --start-time=%begin% --stop-time=%end%
  152.   run,%VLC% %input% "%C2%"
  153. }
  154. return
  155. ;---------------------------------------------------
  156. timecalc:
  157. gui,2:submit,nohide
  158.  stringsplit,b,begintime,`:
  159.  hours  :=(b1*60*60)
  160.  minutes:=(b2*60)
  161.  seconds:=(b3)
  162.  begin  :=(hours+minutes+seconds)
  163.  ;--
  164.  stringsplit,e,endtime,`:
  165.  hours2  :=(e1*60*60)
  166.  minutes2:=(e2*60)
  167.  seconds2:=(e3)
  168.  end     :=(hours2+minutes2+seconds2)
  169. return
  170. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171. GetOut:
  172. GuiClose:
  173. Gui, Hide
  174. SkinForm(0)
  175. ExitApp
  176. return
  177.  
  178. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  179.     if(Param1 = Apply){
  180.         DllCall("LoadLibrary", str, DLL)
  181.         DllCall(DLL . "\USkinInit", Int,0, Int,0, AStr, SkinName)
  182.     }else if(Param1 = 0){
  183.         DllCall(DLL . "\USkinExit")
  184.         }
  185. }
  186. ;=-=-=-=-=-=- END Script VideoPlay ActiveX-=-=-=-=-=-=-=-=-
  187. #S::Suspend
  188. #R::Reload
  189. #P::Pause
  190. ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement