Advertisement
Najeebsk

VLC-PLAYER3.ahk

Mar 22nd, 2023 (edited)
1,855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MODIFIED= 20111120
  2. /*   INFO
  3.    VLC VIDEOS PLAYER
  4.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  5.    Last Modified: 3-20-2023
  6. */
  7. ;#warn
  8. #NoEnv
  9. #SingleInstance, Force
  10. Process, Priority, , A
  11. SendMode, Input
  12. SetBatchLines, -1
  13. ;#NoTrayIcon
  14. SetWorkingDir %A_ScriptDir%  
  15. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  16. FileCreateDir, %A_ScriptDir%\DATA
  17. FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
  18. FileInstall , VLC-PLAYER3.ahk, %A_ScriptDir%\DATA\VLC-PLAYER3.ahk, 1
  19. FileSetAttrib +HS, %A_ScriptDir%\DATA\VLC-PLAYER3.ahk, 2
  20. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  21.  
  22.  
  23. /* ----------- a videolan example to play video or audio ---------------------------
  24.  
  25. script uses vlc.exe http://www.videolan.org/
  26. 1- start video while click on column A or rightclick to mark then start
  27. use buttons below to skip etc ....
  28.  
  29. Example: ( mark row with rightclick )
  30. start-time = 0:40
  31. stop-time = 1:10
  32. repeat = 2
  33. The button "Start/Stop/repeat" plays marked video-file from 0:40 until 1:10 twice
  34.  
  35. */ ----------------------------------------------------------------------------------
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. TMR=D:\VIDEOS ;-- << path from your video files
  44. vlc=%A_programfiles%\VideoLAN\VLC\vlc.exe ;-- << path from vlc.exe
  45. ;F1=%A_scriptdir%\videolanvlc.txt
  46. EXTX=flv,vob,mp4,mpg,wmv,avi ;-- << only videos
  47.  
  48.  
  49.  
  50.  
  51. HK1=Esc
  52. Hotkey,%hk1%,mute1,ON
  53. HK2=space
  54. Hotkey,%hk2%,pause1,ON
  55.  
  56.  
  57. ;------------------------------------------------------------------------------
  58.  
  59. Gui,2:default
  60. Gui,2: Font, S12, Lucida Console
  61. Gui,2:Color,Black
  62.  
  63. sendmode,input
  64. setworkingdir,%A_scriptdir%
  65. DetectHiddenWindows, On
  66. SetTitleMatchMode, 2
  67.  
  68. SW=%A_screenwidth%
  69. SH=%A_screenheight%
  70. GSW:=(SW*99)/100 ;-- GUI width
  71. GSH:=(SH*90)/100 ;-- GUI height
  72. LSW:=(SW*99)/100 ;-- LV width
  73. LSH:=(SH*65)/100 ;-- LV height
  74.  
  75. T1:=(SW*23 )/100 ;NAME
  76. T2:=(SW*15 )/100 ;PATH
  77. T3:=(SW*9 )/100 ;SIZE
  78. T4:=(SW*14 )/100 ;C
  79. T5:=(SW*14 )/100 ;A
  80. T6:=(SW*14 )/100 ;M
  81. T7:=(SW*8 )/100 ;FULLPATH
  82.  
  83. T1A:=T1
  84. T2A:=T1+T2
  85. T3A:=T1+T2+T3
  86. T4A:=T1+T2+T3+T4
  87. T5A:=T1+T2+T3+T4+T5
  88. T6A:=T1+T2+T3+T4+T5+T6
  89. T7A:=T1+T2+T3+T4+T5+T6+T7
  90.  
  91. Gui,2:Add,ListView,grid backgroundTeal cWhite x0 y0 w%LSW% h%LSH% +hscroll altsubmit vA1 gA2, Name|FOLDER|Size|Created|LastAccess|Modified|FullPath
  92. LV_ModifyCol(1,T1)
  93. LV_ModifyCol(2,T2)
  94. LV_ModifyCol(3,T3)
  95. LV_ModifyCol(4,T4)
  96. LV_ModifyCol(5,T5)
  97. LV_ModifyCol(6,T6)
  98. LV_ModifyCol(7,T7)
  99.  
  100. LV_ModifyCol(3,"Integer")
  101. LV_ModifyCol(4,"digit")
  102. LV_ModifyCol(5,"digit")
  103. LV_ModifyCol(6,"digit")
  104.  
  105.  
  106. Y1 :=(SH*67)/100
  107. Y2 :=(SH*72)/100
  108. Y3 :=(SH*76)/100
  109. Y4 :=(SH*80)/100
  110. Y5 :=(SH*85)/100
  111.  
  112.  
  113. WDTH1:=(SW*90 )/100
  114. X1:=(SW*91.5 )/100
  115. X2:=(SW*94 )/100
  116.  
  117. Gui,2:Font,,FixedSys
  118. Gui,2:Add,Edit, right x%x1% y%Y2% w70 h20 vI2 ; I2 focussed
  119. Gui,2:Add,Edit, right x%x1% y%Y4% w70 h20 vI3 ; I3 total
  120. Gui,2:Add,Edit, readonly x5 y%Y2% w%wdth1% h20 cWhite vFPH ; path
  121.  
  122.  
  123. Gui,2:add,button, x10 y%y3% w100 gFULLSCREEN vFULLSCREEN1 ,FULLSCREEN
  124.  
  125. Gui,2:add,button, x10 y%y4% w100 gPlay1 vPlay2 ,PLAY
  126. Gui,2:add,button, x130 y%y4% w100 gPAUSE1 vPAUSE1 ,PAUSE/PLAY
  127. Gui,2:add,button, x10 y%y5% w100 gSTATUS1 vStatus1 ,STATUS
  128.  
  129. Gui,2:Add,Edit, x240 y%Y3% w60 h20 vBack1 ,30
  130. Gui,2:add,button, x240 y%y4% w60 gSKIPBACK vSKIPBACK1 ,<<<<
  131.  
  132. Gui,2:Add,Edit, x310 y%Y3% w60 h20 vFWD1 ,30
  133. Gui,2:add,button, x310 y%y4% w60 gSKIPFWD1 vSKIPFWD1 ,>>>>
  134.  
  135. Gui,2:Add,Edit, x380 y%Y3% w70 h20 vJUMP ,1:30
  136. Gui,2:add,button, x380 y%y4% w70 gJUMPTO vJUMPTO ,JUMP-TO
  137.  
  138. Gui,2:Add,Edit, x460 y%Y3% w90 h20 vStartTimex ,0:40
  139. Gui,2:add,button, x460 y%y4% w90 gStarttime1 vStarttime2 ,Start-Time
  140.  
  141. Gui,2:Add,Edit, x560 y%Y3% w90 h20 vStopTimex ,1:10
  142. Gui,2:add,button, x560 y%y4% w90 gStoptime1 vStoptime2 ,Stop-Time
  143. Gui,2:add,button, x460 y%y5% w190 gStartStoptime1 vStartStoptime2 ,Start/Stop-Time
  144.  
  145. Gui,2:Add,Edit, x660 y%Y3% w90 h20 vRuntimex ,20
  146. Gui,2:add,button, x660 y%y4% w90 gRuntime1 vRuntime2 ,Run-Time
  147.  
  148. Gui,2:Add,Edit, x760 y%Y3% w40 h20 vRepeatx ,2
  149. Gui,2:add,button, x760 y%y4% w70 gRepeat1 vRepeat2 ,Repeat
  150. Gui,2:add,button, x660 y%y5% w170 gStartStopRepeat1 vStartStoprepeat2 ,Start/Stop/Repeat
  151.  
  152.  
  153. Gui,2:add,button, x840 y%y4% w90 gQUIT1 vQUIT1 ,STOP
  154.  
  155. Gui,2:add,button, x820 y%y3% w90 gVOLUMEDOWN vVDOWN ,<<VOLUME
  156. Gui,2:add,button, x920 y%y3% w90 gVOLUMEUP vVUP ,VOLUME>>
  157.  
  158.  
  159. Gui,2:Add,Edit, x10 y%Y1% w200 h20 vSRCHSTR ; search
  160. Gui,2:add,button, x220 y%y1% w80 gSearchx ,<search
  161. Gui,2:add,button, x320 y%y1% w120 gShowall ,Show-ALL
  162.  
  163.  
  164. Gui,2: Show, x1 y1 w%GSW% h%GSH%,VLC_TEST [ Click Column A (Name) or mark with rightclick ] SPACE=stop/start ESC=Volume on/off
  165. gosub,disable1
  166. gosub,disable2
  167. gosub,filllist
  168. GuiControl,2:Focus,SRCHSTR
  169.  
  170. return
  171. ;---------------------------------------------------------------------
  172.  
  173. 2Guiclose:
  174. exitapp
  175. ;----------------------------------
  176.  
  177.  
  178.  
  179.  
  180.  
  181. MUTE1:
  182. soundset,+1,master,mute
  183. return
  184.  
  185.  
  186.  
  187.  
  188. ;----------------------------------
  189. starttime1:
  190. ;gui,2:submit,nohide
  191. guicontrolget,starttimex
  192. X1=
  193. X2=
  194. X=
  195. stringsplit,X,starttimex,`:
  196. if x2<>
  197. X:=(X1*60)+X2
  198. else
  199. X:=starttimex
  200. gosub,WHENPLAY
  201. runwait,%vlc% --intf qt --extraintf http --start-time=%x% "%c7%",,,PID1
  202. gosub,whenstop
  203. ;run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
  204. return
  205.  
  206.  
  207.  
  208. ;----------------------------------
  209. stopTIME1:
  210. ;gui,2:submit,nohide
  211. guicontrolget,stoptimex
  212. X1=
  213. X2=
  214. X=
  215. stringsplit,X,stoptimex,`:
  216. if x2<>
  217. X:=(X1*60)+X2
  218. else
  219. X:=stoptimex
  220. runwait,%vlc% --intf qt --extraintf http --stop-time=%x% "%c7%",,,PID1
  221. gosub,whenstop
  222. return
  223.  
  224.  
  225. ;----------------------------------
  226. StartstopTIME1:
  227. ;gui,2:submit,nohide
  228. guicontrolget,starttimex
  229. guicontrolget,stoptimex
  230.  
  231. X1=
  232. X2=
  233. X=
  234. y1=
  235. y2=
  236. y=
  237.  
  238. stringsplit,x,starttimex,`:
  239. if x2<>
  240. x:=(x1*60)+X2
  241. else
  242. x:=starttimex
  243.  
  244. stringsplit,Y,stoptimex,`:
  245. if y2<>
  246. y:=(y1*60)+y2
  247. else
  248. y:=stoptimex
  249. gosub,WHENPLAY
  250. runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% "%c7%",,,PID1
  251. gosub,whenstop
  252. return
  253.  
  254.  
  255.  
  256. ;----------------------------------
  257. StartStopRepeat1:
  258. ;gui,2:submit,nohide
  259. guicontrolget,starttimex
  260. guicontrolget,stoptimex
  261. guicontrolget,repeatx
  262.  
  263. X1=
  264. X2=
  265. X=
  266. y1=
  267. y2=
  268. y=
  269. z=
  270. stringsplit,x,starttimex,`:
  271. if x2<>
  272. x:=(x1*60)+X2
  273. else
  274. x:=starttimex
  275.  
  276. stringsplit,Y,stoptimex,`:
  277. if y2<>
  278. y:=(y1*60)+y2
  279. else
  280. y:=stoptimex
  281.  
  282. z:=(repeatx-1)
  283. gosub,WHENPLAY
  284. runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% --input-repeat=%z% "%c7%",,,PID1
  285. gosub,whenstop
  286. return
  287.  
  288.  
  289.  
  290.  
  291. ;----------------------------------
  292. runtime1:
  293. ;gui,2:submit,nohide
  294. guicontrolget,runtimex
  295.  
  296. X1=
  297. X2=
  298. X=
  299. stringsplit,X,runtimex,`:
  300. if x2<>
  301. X:=(X1*60)+X2
  302. else
  303. X:=runtimex
  304. gosub,WHENPLAY
  305. runwait,%vlc% --intf qt --extraintf http --run-time=%x% "%c7%",,,PID1
  306. gosub,whenstop
  307. return
  308.  
  309.  
  310.  
  311.  
  312. ;----------------------------------
  313. repeat1:
  314. ;gui,2:submit,nohide
  315. guicontrolget,repeatx
  316.  
  317. x=
  318. X:=(repeatx-1)
  319. gosub,WHENPLAY
  320. runwait,%vlc% --intf qt --extraintf http --input-repeat=%x% "%c7%",,,PID1
  321. gosub,whenstop
  322. return
  323.  
  324.  
  325.  
  326.  
  327. ;----------------------------------
  328. PLAY1:
  329. gui,2:submit,nohide
  330. gosub,WHENPLAY
  331. runwait,%vlc% --intf qt --extraintf http "%c7%",,,PID1
  332. gosub,WHENSTOP
  333. return
  334.  
  335.  
  336.  
  337.  
  338.  
  339. ;----------------------------------
  340. STATUS1:
  341. F1=http://127.0.0.1:8080/requests/status.xml
  342. AA:=UrlDownloadToVar(F1)
  343. msgbox,%aa%
  344. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
  345. return
  346.  
  347.  
  348.  
  349.  
  350.  
  351. ;----------------------------------
  352. PAUSE1:
  353. ;Hotkey,%hk1%,mute1,OFF
  354. F1=http://127.0.0.1:8080/?control=pause
  355. AA:=UrlDownloadToVar(F1)
  356. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
  357. return
  358.  
  359.  
  360.  
  361. ;----------------------------------
  362. STOP1:
  363. gosub,WHENSTOP
  364. F1=http://127.0.0.1:8080/?control=stop
  365. AA:=UrlDownloadToVar(F1)
  366. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=stop, %F1%
  367. return
  368.  
  369.  
  370.  
  371.  
  372. ;----------------------------------
  373. QUIT1:
  374. ID := WinExist( "ahk_pid" PID1 )
  375. if (ID<>0x0)
  376. {
  377. WinClose, ahk_id %ID%
  378. ;process,exist,pid1
  379. Process,close,%Pid1%
  380. WinWaitClose, ahk_id %ID%
  381. gosub,disable1
  382. }
  383. gosub,WHENSTOP
  384. return
  385.  
  386.  
  387.  
  388.  
  389. ;----------------------------------
  390. FULLSCREEN1:
  391. F1=http://127.0.0.1:8080/?control=fullscreen
  392. AA:=UrlDownloadToVar(F1)
  393. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
  394. return
  395.  
  396.  
  397.  
  398.  
  399. ;----------------------------------
  400. SKIPFWD1:
  401. guicontrolget,fwd1
  402.  
  403. F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%
  404. AA:=UrlDownloadToVar(F1)
  405. ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%, %F1%
  406. return
  407.  
  408.  
  409.  
  410. ;----------------------------------
  411. SKIPBACK:
  412. guicontrolget,back1
  413.  
  414. F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%
  415. AA:=UrlDownloadToVar(F1)
  416. ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%, %F1%
  417. return
  418.  
  419.  
  420.  
  421.  
  422. ;----------------------------------
  423. JUMPTO:
  424. ;gui,2:submit,nohide
  425. guicontrolget,jump
  426. X1=
  427. X2=
  428. X=
  429. stringsplit,X,jump,`:
  430. if x2<>
  431. X:=(X1*60)+X2
  432. else
  433. X:=JUMP
  434.  
  435. F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%
  436. AA:=UrlDownloadToVar(F1)
  437. ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%, %F1%
  438. return
  439.  
  440.  
  441. ;----------------------------------
  442. VOLUMEDOWN:
  443. F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24
  444. AA:=UrlDownloadToVar(F1)
  445. ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24, %F1%
  446. return
  447.  
  448.  
  449.  
  450. ;----------------------------------
  451. VOLUMEUP:
  452. F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24
  453. AA:=UrlDownloadToVar(F1)
  454. ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24, %F1%
  455. return
  456.  
  457.  
  458. ;----------------------------------
  459. FULLSCREEN:
  460. F1=http://127.0.0.1:8080/?control=fullscreen
  461. AA:=UrlDownloadToVar(F1)
  462. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
  463. return
  464.  
  465.  
  466. ;----------------------------------
  467. CLOSE1:
  468. F1=http://127.0.0.1:8080/?control=shutdown
  469. AA:=UrlDownloadToVar(F1)
  470. ;UrlDownloadToFile, http://127.0.0.1:8080/?control=shutdown, %F1%
  471. gosub,WHENSTOP
  472. return
  473. ;=====================================================================================================
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480. ;-----------------
  481. Filllist:
  482. ShowAll:
  483. Gui,2:submit,nohide
  484. ;Gui,2:default
  485. Gui,2:ListView,A1
  486.  
  487. IX=0
  488. GuiControl,2:Text,I3,
  489. LV_Delete()
  490.  
  491. Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
  492.  
  493. LV_Delete()
  494. Loop, %tmr%\*.*, 0, 1
  495. {
  496. SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
  497. If Ext In %extx%
  498. {
  499. IX++
  500. CX=
  501. C=
  502. D=
  503. O=
  504. P:=0
  505. Q:=0
  506. R:=0
  507. S:=0
  508. T=
  509. O=%A_LoopFileName%
  510. P=%A_LoopFileSize%
  511. Q=%A_LoopFileTimeCreated%
  512. R=%A_LoopFileTimeAccessed%
  513. S=%A_LoopFileTimeModified%
  514. T=%A_LoopFileFullPath%
  515.  
  516. StringSplit,CX, T,`\
  517. C:=(CX0-1) ; path oneflashback
  518. D=% CX%C% ; name from path position -1
  519. LV_Add("",O,D,P,Q,R,S,T)
  520. }
  521. }
  522. LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
  523. Splashimage,off
  524. GuiControl,2:Text,I3,%IX%
  525. return
  526. ;---------------------------------------------------------------------
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537. searchx:
  538. Gui,2:submit,nohide
  539. Gui,2:ListView,A1
  540. LV_Delete()
  541. GuiControl,2: -Redraw,A1
  542. Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
  543. IX=0
  544. GuiControl,2:Text,I3,%IX%
  545. Loop, %tmr%\*.*, 0, 1
  546. {
  547. SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
  548. If Ext In %extx%
  549. {
  550. CX=
  551. C=
  552. D=
  553. O=
  554. P:=0
  555. Q:=0
  556. R:=0
  557. S:=0
  558. T=
  559. O=%A_LoopFileName%
  560. P=%A_LoopFileSize%
  561. Q=%A_LoopFileTimeCreated%
  562. R=%A_LoopFileTimeAccessed%
  563. S=%A_LoopFileTimeModified%
  564. T=%A_LoopFileFullPath%
  565. SplitPath,A_LoopFileFullPath,name, dir, ext, name_no_ext, drive
  566.  
  567. StringSplit,CX, T,`\
  568. C:=(CX0-1) ; path oneflashback
  569. D=% CX%C% ; name from path position -1
  570.  
  571. if T contains %srchstr%
  572. {
  573. IX++
  574. LV_Add("",O,D,P,Q,R,S,T)
  575. }
  576. }
  577. }
  578. LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
  579. Splashimage,off
  580. GuiControl,2: +Redraw,A1
  581. GuiControl,2:Text,I3,%IX%
  582. return
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596. ;---------------- LISTVIEW ----------------------------
  597. A2:
  598. Gui,2:default
  599. Gui,2:ListView,A1
  600. Gui,2:submit,nohide
  601.  
  602. RN:=LV_GetNext("C") ;2 selected checked
  603. RF:=LV_GetNext("F") ;2 selected focused
  604. GC:=LV_GetCount() ;4 total
  605.  
  606.  
  607.  
  608. if A_GuiEvent = Normal
  609. {
  610. MouseGetPos,x,y
  611. {
  612. if x<%T1A%
  613. {
  614. LV_GetText(C7,A_EventInfo,7)
  615. GuiControl,2:Text,I2,%RF%
  616. GuiControl,2:Text,FPH,%C7%
  617. ID := WinExist( "ahk_pid" PID1 )
  618.  
  619. if (ID<>0x0)
  620. {
  621. WinClose, ahk_id %ID%
  622. process,close,%PID1%
  623. WinWaitClose, ahk_id %ID%
  624. }
  625.  
  626. SplitPath,C7, name, dir, ext, name_no_ext, drive
  627. If Ext In %extx%
  628. {
  629. run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
  630. gosub,enable1 ;--
  631. }
  632. return
  633. }
  634.  
  635. if x<%T2A%
  636. {
  637. LV_GetText(C7,A_EventInfo,7)
  638. GuiControl,2:Text,I2,%RF%
  639. GuiControl,2:Text,FPH,%C7%
  640. SplitPath,C7,name, dir, ext, name_no_ext, drive
  641. run,%dir%
  642. return
  643. }
  644.  
  645. if x<%T3A%
  646. {
  647. LV_GetText(C7,A_EventInfo,7)
  648. GuiControl,2:Text,I2,%RF%
  649. GuiControl,2:Text,FPH,%C7%
  650. return
  651. }
  652.  
  653. if x<%T4A%
  654. {
  655. LV_GetText(C7,A_EventInfo,7)
  656. GuiControl,2:Text,I2,%RF%
  657. GuiControl,2:Text,FPH,%C7%
  658. return
  659. }
  660.  
  661. if x<%T5A%
  662. {
  663. LV_GetText(C7,A_EventInfo,7)
  664. GuiControl,2:Text,I2,%RF%
  665. GuiControl,2:Text,FPH,%C7%
  666. return
  667. }
  668.  
  669. if x<%T6A%
  670. {
  671. LV_GetText(C7,A_EventInfo,7)
  672. GuiControl,2:Text,I2,%RF%
  673. GuiControl,2:Text,FPH,%C7%
  674. return
  675. }
  676.  
  677. if x<%T7A%
  678. {
  679. LV_GetText(C7,A_EventInfo,7)
  680. GuiControl,2:Text,I2,%RF%
  681. GuiControl,2:Text,FPH,%C7%
  682. ;run,%mplc% "%c7%"
  683. run,%c7%
  684. return
  685. }
  686. }
  687. }
  688.  
  689.  
  690.  
  691. if A_GuiEvent = Rightclick
  692. {
  693. LV_GetText(C7,A_EventInfo,7)
  694. GuiControl,2:Text,I2,%RF%
  695. GuiControl,2:Text,FPH,%C7%
  696. gosub,enable2
  697. return
  698. }
  699. return
  700. ;============================= end listview ==========
  701.  
  702.  
  703.  
  704.  
  705. ;----- once click ------------------------------------
  706. ENABLE1:
  707. GuiControl,2:Enable,Fullscreen1
  708. GuiControl,2:Enable,Pause1
  709. GuiControl,2:Enable,Skipback1
  710. GuiControl,2:Enable,Skipfwd1
  711. GuiControl,2:Enable,Jumpto
  712. GuiControl,2:Enable,Quit1
  713. GuiControl,2:Enable,VDown
  714. GuiControl,2:Enable,Vup
  715. return
  716.  
  717. DISABLE1:
  718. GuiControl,2:Disable,Fullscreen1
  719. GuiControl,2:Disable,Pause1
  720. GuiControl,2:Disable,Skipback1
  721. GuiControl,2:Disable,Skipfwd1
  722. GuiControl,2:Disable,Jumpto
  723. GuiControl,2:Disable,Quit1
  724. GuiControl,2:Disable,VDown
  725. GuiControl,2:Disable,Vup
  726. return
  727.  
  728.  
  729.  
  730.  
  731. ;------ mark with RightClick -----------
  732. ;------ allow / block all -----------
  733. ENABLE2:
  734. GuiControl,2:Enable,Play2
  735. GuiControl,2:Enable,Starttime2
  736. GuiControl,2:Enable,Stoptime2
  737. GuiControl,2:Enable,StartStoptime2
  738. GuiControl,2:Enable,StartStopRepeat2
  739. GuiControl,2:Enable,Runtime2
  740. GuiControl,2:Enable,Repeat2
  741. return
  742.  
  743.  
  744.  
  745.  
  746. WHENPLAY:
  747. GuiControl,2:Enable,Fullscreen1
  748. GuiControl,2:Enable,Pause1
  749. GuiControl,2:Enable,Skipback1
  750. GuiControl,2:Enable,Skipfwd1
  751. GuiControl,2:Enable,Jumpto
  752. GuiControl,2:Enable,Quit1
  753. GuiControl,2:Enable,VDown
  754. GuiControl,2:Enable,Vup
  755. ;return
  756. DISABLE2:
  757. GuiControl,2:Disable,Play2
  758. GuiControl,2:Disable,Starttime2
  759. GuiControl,2:Disable,Stoptime2
  760. GuiControl,2:Disable,StartStoptime2
  761. GuiControl,2:Disable,StartStopRepeat2
  762. GuiControl,2:Disable,Runtime2
  763. GuiControl,2:Disable,Repeat2
  764. return
  765.  
  766.  
  767.  
  768.  
  769. WHENSTOP:
  770. GuiControl,2:disable,Fullscreen1
  771. GuiControl,2:disable,Pause1
  772. GuiControl,2:disable,Skipback1
  773. GuiControl,2:disable,Skipfwd1
  774. GuiControl,2:disable,Jumpto
  775. GuiControl,2:disable,Quit1
  776. GuiControl,2:disable,VDown
  777. GuiControl,2:disable,Vup
  778. ;return
  779. GuiControl,2:Enable,Play2
  780. GuiControl,2:Enable,Starttime2
  781. GuiControl,2:Enable,Stoptime2
  782. GuiControl,2:Enable,StartStoptime2
  783. GuiControl,2:Enable,StartStopRepeat2
  784. GuiControl,2:Enable,Runtime2
  785. GuiControl,2:Enable,Repeat2
  786. return
  787. ;============================= END SCRIPT ===================================
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794. ;================== Function UrlDownloadToVar OLFEN ==============================
  795. ;http://www.autohotkey.com/forum/viewtopic.php?t=10466
  796.  
  797. ;msgbox % UrlDownloadToVar("http://www.autohotkey.com/download/CurrentVersion.txt")
  798.  
  799. UrlDownloadToVar(URL, Proxy="", ProxyBypass="") {
  800. AutoTrim, Off
  801. hModule := DllCall("LoadLibrary", "str", "wininet.dll")
  802.  
  803. If (Proxy != "")
  804. AccessType=3
  805. Else
  806. AccessType=1
  807. ;INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
  808. ;INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
  809. ;INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
  810. ;INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS
  811.  
  812. io_hInternet := DllCall("wininet\InternetOpenA"
  813. , "str", "" ;lpszAgent
  814. , "uint", AccessType
  815. , "str", Proxy
  816. , "str", ProxyBypass
  817. , "uint", 0) ;dwFlags
  818.  
  819. iou := DllCall("wininet\InternetOpenUrlA"
  820. , "uint", io_hInternet
  821. , "str", url
  822. , "str", "" ;lpszHeaders
  823. , "uint", 0 ;dwHeadersLength
  824. , "uint", 0x80000000 ;dwFlags: INTERNET_FLAG_RELOAD = 0x80000000 // retrieve the original item
  825. , "uint", 0) ;dwContext
  826.  
  827. If (ErrorLevel != 0 or iou = 0) {
  828. DllCall("FreeLibrary", "uint", hModule)
  829. return 0
  830. }
  831.  
  832. VarSetCapacity(buffer, 512, 0)
  833. VarSetCapacity(NumberOfBytesRead, 4, 0)
  834. Loop
  835. {
  836. irf := DllCall("wininet\InternetReadFile", "uint", iou, "uint", &buffer, "uint", 512, "uint", &NumberOfBytesRead)
  837. NOBR = 0
  838. Loop 4 ; Build the integer by adding up its bytes. - ExtractInteger
  839. NOBR += *(&NumberOfBytesRead + A_Index-1) << 8*(A_Index-1)
  840. IfEqual, NOBR, 0, break
  841. ;BytesReadTotal += NOBR
  842. DllCall("lstrcpy", "str", buffer, "uint", &buffer)
  843. res = %res%%buffer%
  844. }
  845. StringTrimRight, res, res, 2
  846.  
  847. DllCall("wininet\InternetCloseHandle", "uint", iou)
  848. DllCall("wininet\InternetCloseHandle", "uint", io_hInternet)
  849. DllCall("FreeLibrary", "uint", hModule)
  850. AutoTrim, on
  851. return, res
  852. }
  853. ;================== END Function UrlDownloadToVar OLFEN ==============================
  854. ;=-=-=-=-=-=- END Script VideoPlay ActiveX-=-=-=-=-=-=-=-=-
  855. #S::Suspend
  856. #P::Pause
  857. #R::Reload
  858. ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement