Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Videolan vlc.exe example


  • Please log in to reply
4 replies to this topic
garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

plays video / audio

1- start video while click on column A or rightclick to mark then start
use buttons below to skip etc ....

Example: ( mark row with rightclick )
start-time = 0:40
stop-time = 1:10
repeat = 2
The button "Start/Stop/repeat" plays marked video-file from 0:40 until 1:10 twice

MODIFIED= 20111120
;-- bron= specter333 http://www.autohotkey.com/forum/topic69150.html


;-------- http://www.autohotkey.com/forum/topic69260.html


/* ----------- a videolan example to play video or audio ---------------------------

script uses vlc.exe http://www.videolan.org/
1- start video while click on column A or rightclick to mark then start
use buttons below to skip etc ....

Example: ( mark row with rightclick )
start-time = 0:40
stop-time = 1:10
repeat = 2
The button "Start/Stop/repeat" plays marked video-file from 0:40 until 1:10 twice

*/ ----------------------------------------------------------------------------------







TMR=C:\M_VIDEO ;-- << path from your video files
vlc=%A_programfiles%\VideoLAN\VLC\vlc.exe ;-- << path from vlc.exe
;F1=%A_scriptdir%\videolanvlc.txt
EXTX=flv,vob,mp4,mpg,wmv,avi ;-- << only videos




HK1=Esc
Hotkey,%hk1%,mute1,ON
HK2=space
Hotkey,%hk2%,pause1,ON


;------------------------------------------------------------------------------

Gui,2:default
Gui,2: Font, default, Lucida Console
Gui,2:Color,Black

sendmode,input
setworkingdir,%A_scriptdir%
DetectHiddenWindows, On
SetTitleMatchMode, 2

SW=%A_screenwidth%
SH=%A_screenheight%
GSW:=(SW*99)/100 ;-- GUI width
GSH:=(SH*94)/100 ;-- GUI height
LSW:=(SW*98)/100 ;-- LV width
LSH:=(SH*77)/100 ;-- LV height

T1:=(SW*23 )/100 ;NAME
T2:=(SW*15 )/100 ;PATH
T3:=(SW*9 )/100 ;SIZE
T4:=(SW*14 )/100 ;C
T5:=(SW*14 )/100 ;A
T6:=(SW*14 )/100 ;M
T7:=(SW*8 )/100 ;FULLPATH

T1A:=T1
T2A:=T1+T2
T3A:=T1+T2+T3
T4A:=T1+T2+T3+T4
T5A:=T1+T2+T3+T4+T5
T6A:=T1+T2+T3+T4+T5+T6
T7A:=T1+T2+T3+T4+T5+T6+T7

Gui,2:Add,ListView,grid backgroundTeal cWhite x0 y0 w%LSW% h%LSH% +hscroll altsubmit vA1 gA2, Name|FOLDER|Size|Created|LastAccess|Modified|FullPath
LV_ModifyCol(1,T1)
LV_ModifyCol(2,T2)
LV_ModifyCol(3,T3)
LV_ModifyCol(4,T4)
LV_ModifyCol(5,T5)
LV_ModifyCol(6,T6)
LV_ModifyCol(7,T7)

LV_ModifyCol(3,"Integer")
LV_ModifyCol(4,"digit")
LV_ModifyCol(5,"digit")
LV_ModifyCol(6,"digit")


Y1 :=(SH*78)/100
Y2 :=(SH*81)/100
Y3 :=(SH*84)/100
Y4 :=(SH*87)/100
Y5 :=(SH*90)/100


WDTH1:=(SW*90 )/100
X1:=(SW*92 )/100
X2:=(SW*94 )/100

Gui,2:Font,,FixedSys
Gui,2:Add,Edit, right x%x1% y%Y2% w70 h20 vI2 ; I2 focussed
Gui,2:Add,Edit, right x%x1% y%Y4% w70 h20 vI3 ; I3 total
Gui,2:Add,Edit, readonly x5 y%Y2% w%wdth1% h20 cWhite vFPH ; path


Gui,2:add,button, x10 y%y3% w100 gFULLSCREEN vFULLSCREEN1 ,FULLSCREEN

Gui,2:add,button, x10 y%y4% w100 gPlay1 vPlay2 ,PLAY
Gui,2:add,button, x130 y%y4% w100 gPAUSE1 vPAUSE1 ,PAUSE/PLAY
Gui,2:add,button, x10 y%y5% w100 gSTATUS1 vStatus1 ,STATUS

Gui,2:Add,Edit, x240 y%Y3% w60 h20 vBack1 ,30
Gui,2:add,button, x240 y%y4% w60 gSKIPBACK vSKIPBACK1 ,<<<<

Gui,2:Add,Edit, x310 y%Y3% w60 h20 vFWD1 ,30
Gui,2:add,button, x310 y%y4% w60 gSKIPFWD1 vSKIPFWD1 ,>>>>

Gui,2:Add,Edit, x380 y%Y3% w70 h20 vJUMP ,1:30
Gui,2:add,button, x380 y%y4% w70 gJUMPTO vJUMPTO ,JUMP-TO

Gui,2:Add,Edit, x460 y%Y3% w90 h20 vStartTimex ,0:40
Gui,2:add,button, x460 y%y4% w90 gStarttime1 vStarttime2 ,Start-Time

Gui,2:Add,Edit, x560 y%Y3% w90 h20 vStopTimex ,1:10
Gui,2:add,button, x560 y%y4% w90 gStoptime1 vStoptime2 ,Stop-Time
Gui,2:add,button, x460 y%y5% w190 gStartStoptime1 vStartStoptime2 ,Start/Stop-Time

Gui,2:Add,Edit, x660 y%Y3% w90 h20 vRuntimex ,20
Gui,2:add,button, x660 y%y4% w90 gRuntime1 vRuntime2 ,Run-Time

Gui,2:Add,Edit, x760 y%Y3% w40 h20 vRepeatx ,2
Gui,2:add,button, x760 y%y4% w70 gRepeat1 vRepeat2 ,Repeat
Gui,2:add,button, x660 y%y5% w170 gStartStopRepeat1 vStartStoprepeat2 ,Start/Stop/Repeat


Gui,2:add,button, x860 y%y4% w90 gQUIT1 vQUIT1 ,STOP

Gui,2:add,button, x970 y%y4% w90 gVOLUMEDOWN vVDOWN ,<<VOLUME
Gui,2:add,button, x1070 y%y4% w90 gVOLUMEUP vVUP ,VOLUME>>


Gui,2:Add,Edit, x10 y%Y1% w200 h20 vSRCHSTR ; search
Gui,2:add,button, x220 y%y1% w80 gSearchx ,<search
Gui,2:add,button, x320 y%y1% w120 gShowall ,Show-ALL


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
gosub,disable1
gosub,disable2
gosub,filllist
GuiControl,2:Focus,SRCHSTR

return
;---------------------------------------------------------------------

2Guiclose:
exitapp
;----------------------------------





MUTE1:
soundset,+1,master,mute
return




;----------------------------------
starttime1:
;gui,2:submit,nohide
guicontrolget,starttimex
X1=
X2=
X=
stringsplit,X,starttimex,`:
if x2<>
X:=(X1*60)+X2
else
X:=starttimex
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http --start-time=%x% "%c7%",,,PID1
gosub,whenstop
;run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
return



;----------------------------------
stopTIME1:
;gui,2:submit,nohide
guicontrolget,stoptimex
X1=
X2=
X=
stringsplit,X,stoptimex,`:
if x2<>
X:=(X1*60)+X2
else
X:=stoptimex
runwait,%vlc% --intf qt --extraintf http --stop-time=%x% "%c7%",,,PID1
gosub,whenstop
return


;----------------------------------
StartstopTIME1:
;gui,2:submit,nohide
guicontrolget,starttimex
guicontrolget,stoptimex

X1=
X2=
X=
y1=
y2=
y=

stringsplit,x,starttimex,`:
if x2<>
x:=(x1*60)+X2
else
x:=starttimex

stringsplit,Y,stoptimex,`:
if y2<>
y:=(y1*60)+y2
else
y:=stoptimex
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% "%c7%",,,PID1
gosub,whenstop
return



;----------------------------------
StartStopRepeat1:
;gui,2:submit,nohide
guicontrolget,starttimex
guicontrolget,stoptimex
guicontrolget,repeatx

X1=
X2=
X=
y1=
y2=
y=
z=
stringsplit,x,starttimex,`:
if x2<>
x:=(x1*60)+X2
else
x:=starttimex

stringsplit,Y,stoptimex,`:
if y2<>
y:=(y1*60)+y2
else
y:=stoptimex

z:=(repeatx-1)
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% --input-repeat=%z% "%c7%",,,PID1
gosub,whenstop
return




;----------------------------------
runtime1:
;gui,2:submit,nohide
guicontrolget,runtimex

X1=
X2=
X=
stringsplit,X,runtimex,`:
if x2<>
X:=(X1*60)+X2
else
X:=runtimex
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http --run-time=%x% "%c7%",,,PID1
gosub,whenstop
return




;----------------------------------
repeat1:
;gui,2:submit,nohide
guicontrolget,repeatx

x=
X:=(repeatx-1)
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http --input-repeat=%x% "%c7%",,,PID1
gosub,whenstop
return




;----------------------------------
PLAY1:
gui,2:submit,nohide
gosub,WHENPLAY
runwait,%vlc% --intf qt --extraintf http "%c7%",,,PID1
gosub,WHENSTOP
return





;----------------------------------
STATUS1:
F1=http://127.0.0.1:8080/requests/status.xml
AA:=UrlDownloadToVar(F1)
msgbox,%aa%
;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
return





;----------------------------------
PAUSE1:
;Hotkey,%hk1%,mute1,OFF
F1=http://127.0.0.1:8080/?control=pause
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
return



;----------------------------------
STOP1:
gosub,WHENSTOP
F1=http://127.0.0.1:8080/?control=stop
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/?control=stop, %F1%
return




;----------------------------------
QUIT1:
ID := WinExist( "ahk_pid" PID1 )
if (ID<>0x0)
{
WinClose, ahk_id %ID%
;process,exist,pid1
Process,close,%Pid1%
WinWaitClose, ahk_id %ID%
gosub,disable1
}
gosub,WHENSTOP
return




;----------------------------------
FULLSCREEN1:
F1=http://127.0.0.1:8080/?control=fullscreen
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
return




;----------------------------------
SKIPFWD1:
guicontrolget,fwd1

F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%, %F1%
return



;----------------------------------
SKIPBACK:
guicontrolget,back1

F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%, %F1%
return




;----------------------------------
JUMPTO:
;gui,2:submit,nohide
guicontrolget,jump
X1=
X2=
X=
stringsplit,X,jump,`:
if x2<>
X:=(X1*60)+X2
else
X:=JUMP

F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%, %F1%
return


;----------------------------------
VOLUMEDOWN:
F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24, %F1%
return



;----------------------------------
VOLUMEUP:
F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24, %F1%
return


;----------------------------------
FULLSCREEN:
F1=http://127.0.0.1:8080/?control=fullscreen
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
return


;----------------------------------
CLOSE1:
F1=http://127.0.0.1:8080/?control=shutdown
AA:=UrlDownloadToVar(F1)
;UrlDownloadToFile, http://127.0.0.1:8080/?control=shutdown, %F1%
gosub,WHENSTOP
return
;=====================================================================================================






;-----------------
Filllist:
ShowAll:
Gui,2:submit,nohide
;Gui,2:default
Gui,2:ListView,A1

IX=0
GuiControl,2:Text,I3,
LV_Delete()

Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH

LV_Delete()
Loop, %tmr%\*.*, 0, 1
{
SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
If Ext In %extx%
{
IX++
CX=
C=
D=
O=
P:=0
Q:=0
R:=0
S:=0
T=
O=%A_LoopFileName%
P=%A_LoopFileSize%
Q=%A_LoopFileTimeCreated%
R=%A_LoopFileTimeAccessed%
S=%A_LoopFileTimeModified%
T=%A_LoopFileFullPath%

StringSplit,CX, T,`\
C:=(CX0-1) ; path oneflashback
D=% CX%C% ; name from path position -1
LV_Add("",O,D,P,Q,R,S,T)
}
}
LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
Splashimage,off
GuiControl,2:Text,I3,%IX%
return
;---------------------------------------------------------------------










searchx:
Gui,2:submit,nohide
Gui,2:ListView,A1
LV_Delete()
GuiControl,2: -Redraw,A1
Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
IX=0
GuiControl,2:Text,I3,%IX%
Loop, %tmr%\*.*, 0, 1
{
SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
If Ext In %extx%
{
CX=
C=
D=
O=
P:=0
Q:=0
R:=0
S:=0
T=
O=%A_LoopFileName%
P=%A_LoopFileSize%
Q=%A_LoopFileTimeCreated%
R=%A_LoopFileTimeAccessed%
S=%A_LoopFileTimeModified%
T=%A_LoopFileFullPath%
SplitPath,A_LoopFileFullPath,name, dir, ext, name_no_ext, drive

StringSplit,CX, T,`\
C:=(CX0-1) ; path oneflashback
D=% CX%C% ; name from path position -1

if T contains %srchstr%
{
IX++
LV_Add("",O,D,P,Q,R,S,T)
}
}
}
LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
Splashimage,off
GuiControl,2: +Redraw,A1
GuiControl,2:Text,I3,%IX%
return













;---------------- LISTVIEW ----------------------------
A2:
Gui,2:default
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
{
MouseGetPos,x,y
{
if x<%T1A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
ID := WinExist( "ahk_pid" PID1 )

if (ID<>0x0)
{
WinClose, ahk_id %ID%
process,close,%PID1%
WinWaitClose, ahk_id %ID%
}

SplitPath,C7, name, dir, ext, name_no_ext, drive
If Ext In %extx%
{
run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
gosub,enable1 ;--
}
return
}

if x<%T2A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
SplitPath,C7,name, dir, ext, name_no_ext, drive
run,%dir%
return
}

if x<%T3A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
return
}

if x<%T4A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
return
}

if x<%T5A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
return
}

if x<%T6A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
return
}

if x<%T7A%
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
;run,%mplc% "%c7%"
run,%c7%
return
}
}
}



if A_GuiEvent = Rightclick
{
LV_GetText(C7,A_EventInfo,7)
GuiControl,2:Text,I2,%RF%
GuiControl,2:Text,FPH,%C7%
gosub,enable2
return
}
return
;============================= end listview ==========




;----- once click ------------------------------------
ENABLE1:
GuiControl,2:Enable,Fullscreen1
GuiControl,2:Enable,Pause1
GuiControl,2:Enable,Skipback1
GuiControl,2:Enable,Skipfwd1
GuiControl,2:Enable,Jumpto
GuiControl,2:Enable,Quit1
GuiControl,2:Enable,VDown
GuiControl,2:Enable,Vup
return

DISABLE1:
GuiControl,2:Disable,Fullscreen1
GuiControl,2:Disable,Pause1
GuiControl,2:Disable,Skipback1
GuiControl,2:Disable,Skipfwd1
GuiControl,2:Disable,Jumpto
GuiControl,2:Disable,Quit1
GuiControl,2:Disable,VDown
GuiControl,2:Disable,Vup
return




;------ mark with RightClick -----------
;------ allow / block all -----------
ENABLE2:
GuiControl,2:Enable,Play2
GuiControl,2:Enable,Starttime2
GuiControl,2:Enable,Stoptime2
GuiControl,2:Enable,StartStoptime2
GuiControl,2:Enable,StartStopRepeat2
GuiControl,2:Enable,Runtime2
GuiControl,2:Enable,Repeat2
return




WHENPLAY:
GuiControl,2:Enable,Fullscreen1
GuiControl,2:Enable,Pause1
GuiControl,2:Enable,Skipback1
GuiControl,2:Enable,Skipfwd1
GuiControl,2:Enable,Jumpto
GuiControl,2:Enable,Quit1
GuiControl,2:Enable,VDown
GuiControl,2:Enable,Vup
;return
DISABLE2:
GuiControl,2:Disable,Play2
GuiControl,2:Disable,Starttime2
GuiControl,2:Disable,Stoptime2
GuiControl,2:Disable,StartStoptime2
GuiControl,2:Disable,StartStopRepeat2
GuiControl,2:Disable,Runtime2
GuiControl,2:Disable,Repeat2
return




WHENSTOP:
GuiControl,2:disable,Fullscreen1
GuiControl,2:disable,Pause1
GuiControl,2:disable,Skipback1
GuiControl,2:disable,Skipfwd1
GuiControl,2:disable,Jumpto
GuiControl,2:disable,Quit1
GuiControl,2:disable,VDown
GuiControl,2:disable,Vup
;return
GuiControl,2:Enable,Play2
GuiControl,2:Enable,Starttime2
GuiControl,2:Enable,Stoptime2
GuiControl,2:Enable,StartStoptime2
GuiControl,2:Enable,StartStopRepeat2
GuiControl,2:Enable,Runtime2
GuiControl,2:Enable,Repeat2
return
;============================= END SCRIPT ===================================






;================== Function UrlDownloadToVar OLFEN ==============================
;http://www.autohotkey.com/forum/viewtopic.php?t=10466

;msgbox % UrlDownloadToVar("http://www.autohotkey.com/download/CurrentVersion.txt")

UrlDownloadToVar(URL, Proxy="", ProxyBypass="") {
AutoTrim, Off
hModule := DllCall("LoadLibrary", "str", "wininet.dll")

If (Proxy != "")
AccessType=3
Else
AccessType=1
;INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
;INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
;INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
;INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS

io_hInternet := DllCall("wininet\InternetOpenA"
, "str", "" ;lpszAgent
, "uint", AccessType
, "str", Proxy
, "str", ProxyBypass
, "uint", 0) ;dwFlags

iou := DllCall("wininet\InternetOpenUrlA"
, "uint", io_hInternet
, "str", url
, "str", "" ;lpszHeaders
, "uint", 0 ;dwHeadersLength
, "uint", 0x80000000 ;dwFlags: INTERNET_FLAG_RELOAD = 0x80000000 // retrieve the original item
, "uint", 0) ;dwContext

If (ErrorLevel != 0 or iou = 0) {
DllCall("FreeLibrary", "uint", hModule)
return 0
}

VarSetCapacity(buffer, 512, 0)
VarSetCapacity(NumberOfBytesRead, 4, 0)
Loop
{
irf := DllCall("wininet\InternetReadFile", "uint", iou, "uint", &buffer, "uint", 512, "uint", &NumberOfBytesRead)
NOBR = 0
Loop 4 ; Build the integer by adding up its bytes. - ExtractInteger
NOBR += *(&NumberOfBytesRead + A_Index-1) << 8*(A_Index-1)
IfEqual, NOBR, 0, break
;BytesReadTotal += NOBR
DllCall("lstrcpy", "str", buffer, "uint", &buffer)
res = %res%%buffer%
}
StringTrimRight, res, res, 2

DllCall("wininet\InternetCloseHandle", "uint", iou)
DllCall("wininet\InternetCloseHandle", "uint", io_hInternet)
DllCall("FreeLibrary", "uint", hModule)
AutoTrim, on
return, res
}
;================== END Function UrlDownloadToVar OLFEN ==============================




Play and / or record television stream
MODIFIED = 20120603
URL1=http://80.249.172.27/dunatv
;URL1=http://www.cctv-4.com/2007/asx/cctv-4_live.asx

;--- this example play/record television with vlc.exe ----
;--- url always changes , see for actual streaming adress -


;--------------------------------------------------------------
#NoEnv
SetBatchlines -1
SendMode Input
setworkingdir, %a_scriptdir%

REC =c:\_RECORDED1
run,%COMSPEC% /C if not exist \%REC%\NUL MD %REC%,,hide

Gui,2:Color,black
Gui,2:Font, S10 CDefault , Lucida Console
TelevisionINI=%A_scriptdir%\TelevisionINI.ini

ifnotexist,%TelevisionINI%
{
IniWrite,c:\_RECORDED1 , %TelevisionINI% ,RecordPath , KEY1
IniWrite,%A_programfiles%\VideoLAN\VLC\vlc.exe , %TelevisionINI% ,VLCPath , KEY1
}


;-------------- TOOLS ---------------------------
Menu,S2,add,Select once path where Record Video ,MH11
Menu,S2,add,Select once path vlc.exe ,MH12
Menu,S2,add,Download vlc.exe if not exist ,MH13

;menu, myMenuBar, Add, Settings ,:S1
menu, myMenuBar, Add, Tools ,:S2

gui,2:menu,MyMenuBar
;----------------------------------------------------


Gui,2:Add,Button, x10 y10 h25 w100 gPLAY1 ,Watch
Gui,2:Add,Button, x130 y10 h25 w100 gRecord1 ,Record
Gui,2:Add,Button, x10 y50 h25 w220 gRecord2 ,Record and Watch
Gui,2:Add,Button, x250 y10 h25 w150 gFolder1 ,FOLDER-RECORDED
Gui,2:Add,Button, x250 y50 h25 w150 gProgram1 ,Program


IniRead, Rec , %TelevisionINI% ,RecordPath , KEY1
IniRead, VLCPath1 , %TelevisionINI% ,VLCPath , KEY1

Gui,2:Show, x0 y0 h100 w410 ,Television TV

ifexist,%VLCPath1%
return
else
msgbox, 262208,Check if vlc.exe exist,Vlc.exe didn't found`nClick on Tools to download vlc.exe or`nClick on Tools to select the correct path from vlc.exe
return
;-------------------------------------------------------------------

2Guiclose:
exitapp



MH11:
IniRead, Rec , %TelevisionINI% ,RecordPath , KEY1
msgbox, 262468, Where to record Video,The folder`n%REC%`nis selected to record TV Television`nWant you select a new Folder ?
ifmsgbox,no
return
FileSelectFolder,MF,
if MF=
return
IniWrite,%MF% , %TelevisionINI% ,RecordPath , KEY1
return


MH12:
FileSelectFile, SelectedFile, 3,%A_programfiles% , Open a file, ExeFile (*.exe)
if SelectedFile=
return
IniWrite,%Selectedfile% , %TelevisionINI% ,VLCPath , KEY1
return


MH13:
run,http://www.videolan.org/vlc/
return


Folder1:
Gui,2:submit,nohide
IniRead, Rec , %TelevisionINI% ,RecordPath , KEY1
run,%rec%
return


Play1:
Gui,2:submit,nohide
IniRead, VLCPath1 , %TelevisionINI% ,VLCPath , KEY1
run,%VLCPath1% %URL1%
return



record1:
Gui,2:submit,nohide
IniRead, Rec , %TelevisionINI% ,RecordPath , KEY1
IniRead, VLCPath1 , %TelevisionINI% ,VLCPath , KEY1
WHERE=%REC%\%A_now%_Television.mpg
BBBB= :sout=#transcode{vcodec=mp2v,vb=1024,scale=1,acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ps,dst="%where%"}}
run,%VLCPath1% %URL1% %BBBB%
return




record2:
Gui,2:submit,nohide
IniRead, Rec , %TelevisionINI% ,RecordPath , KEY1
IniRead, VLCPath1 , %TelevisionINI% ,VLCPath , KEY1
WHERE=%REC%\%A_now%_Television.mpg
BBBB= :sout=#transcode{vcodec=mp2v,vb=800,scale=1,acodec=mp3,ab=128,channels=2}:duplicate{dst=display,dst=std{access=file,mux=ps,dst="%where%"}}
run,%VLCPath1% %URL1% %BBBB%
return



Program1:
run,http://www.cctv-4.com
return

;===================================================================================================




Example with AHK_L ActiveX

YeLaiXiang_20111217a.png

MODIFIED=20120603
name1=VLC_Videolan %modified% [Hotkey Esc=Pause/Play]
;-- needs AHK_L and VLC.exe

/*
- Video or Music plays at last played time when start
- Intro x-seconds
- slow /fast / jump-to selected time / skip < - >
*/

;-- http://wiki.videolan.org/ActiveX_Controls
;-- http://wiki.videolan.org/VLC_command-line_help
;-- http://download.videolan.org/pub/videolan/vlc/ ;-- old versions
;========================================================

;-- source / bron user octal = http://www.autohotkey.com/forum/topic79698.html ---
;-- http://wiki.videolan.org/Documentation:WebPlugin
;-- http://www.videolan.org version="VideoLAN.VLCPlugin.2"

;-- Gui,2:Add,ActiveX, cBlack x230 y15 w980 h640 vVlcx, VideoLAN.VLCPlugin.2
;-- when you install VLC the activex control is installed
;-- http://www.autohotkey.com/forum/topic69260.html
;--
;--



;#SingleInstance, force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode 2
SetBatchLines, -1

SetFormat, float, 04
Gui,2:default
Gui,2: Font, default, Lucida Console
Gui,2:Color,Black

EXTX=flv,vob,mp4,mpg,wmv,avi ;-- << only videos
EXTM=mp3,wav,wma



;----------------------------

Menu,S0,add,SelectVideo ,MH0
Menu,S0,add,SelectMusic ,MH0
Menu,S0,add,OpenVideo ,MH0
Menu,S0,add,OpenMusic ,MH0


Menu,S1,add,VLC_WebPlugin ,MH1


Menu,S2,add,VLC_Version ,MH2
Menu,S2,add,AHK_Version ,MH2
Menu,S2,add,ThisScript ,MH2


;----------------------------
menu,myMenuBar,Add,Folder ,:S0
menu,myMenuBar,Add,Programs ,:S1
menu,myMenuBar,Add,Help ,:S2

;----------------------------
gui,2:menu,MyMenuBar
;----------------------------




;---- HotKey Escape for Pause/Play -------
HK1=Esc
Hotkey,%hk1%,pause1,ON





RSSINI=%a_scriptdir%\VLC_RSSINI.ini
ifnotexist,%rssini% ;-- first run
{
IniWrite, No music folder selected , %rssini% ,section0 , KEY
IniWrite, No video folder selected , %rssini% ,section1 , KEY
IniWrite, YES , %rssini% ,section2 , KEY
IniWrite, 0.2 , %rssini% ,section3 , KEY
IniWrite, 3.0 , %rssini% ,section4 , KEY
IniWrite, 30 , %rssini% ,section5 , KEY
IniWrite, 130 , %rssini% ,section6 , KEY
IniWrite, 140 , %rssini% ,section7 , KEY
IniWrite, Lastplayed , %rssini% ,section8 , KEY
IniWrite, 4:10 , %rssini% ,section9 , KEY
IniWrite, 2 , %rssini% ,section10 , KEY ;RF RowNumber
IniWrite, video , %rssini% ,section21 , KEY
}



IniRead, A0XX, %rssini% , section1 , Key ;-- folder selected c:\xy
IniRead, A1XX, %rssini% , section1 , Key ;-- folder selected c:\xy
IniRead, A2XX, %rssini% , section2 , Key ;-- continue yes or no yes/no
IniRead, A3XX, %rssini% , section3 , Key ;-- slowx 0.2
IniRead, A4XX, %rssini% , section4 , Key ;-- fastx 10.0
IniRead, A5XX, %rssini% , section5 , Key ;-- skip-back time 30 or 0:30
IniRead, A6XX, %rssini% , section6 , Key ;-- skip-forward time 130 or 2:10
IniRead, A7XX, %rssini% , section7 , Key ;-- goto x-time 130 or 2:10
IniRead, A8XX, %rssini% , section8 , Key ;-- lastplayed-file
IniRead, A9XX, %rssini% , section9 , Key ;-- lastplayed-file-time 4:10
IniRead, RF , %rssini% , section10 , Key ;-- RF RowNumber
IniRead, A21X, %rssini% , section21 , Key ;-- video or music



;----- Colorx Editx Buttonx Backgroundx Progress only need for colored buttons -------
Gui,2: Color, ControlColor, Black
edcol=white
btcol=black




Gui,2:Add,ActiveX, x230 y25 w980 h620 vVlcx, VideoLAN.VLCPlugin.2 ;-- cBlack

Gui,2:Font,S9 cwhite, Verdana ;-- draw a white border
XM:=225
YM:=16
WT:=990
HM:=636
Gui,2:add,GroupBox,x%XM% y%YM% w%WT% h%HM%
Gui,2: Font, s9, Lucida Console


T1=200
T2=0
Gui,2:Add,ListView,grid backgroundTeal cWhite x0 y25 w220 h640 +hscroll altsubmit vA1 gA2, Name|FullPath
LV_ModifyCol(1,T1)
LV_ModifyCol(2,T2)



Gui,2:add,text, x230 y2 w980 cWhite vSelectedx ;-- show selected folder-name

;-------------- select >> video music television --------------------------------------
Gui,2:Add,Progress, x10 y1 w65 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gVideo1,Video

Gui,2:Add,Progress, x80 y1 w65 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gMusic1,Music

Gui,2:Add,Progress, x155 y1 w65 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gTelevision1,TV
;---------------------------------------------------------------------------------------


Gui,2:Add,Edit, c%edcol% x10 y670 w200 h20 vSRCHSTR ; search

Gui,2:Add,Progress, x220 y670 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gSearchx,<Search

Gui,2:Add,Progress, x300 y670 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gShowall,Show-ALL



Gui,2:Add,Edit, c%edcol% right readonly x10 y700 w90 h20 vI4 ; Playing status
Gui,2:add,text, x110 y700 w140 cWhite vColumnFromx


Gui,2:Add,Progress, x10 y730 w90 h20 Disabled Background%btcol% +E0x1
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gPause1 vPause2,Pause/PLAY
Gui,2:Add,Progress, x110 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gStop1 vStop2 ,STOP





if A2XX=YES
Gui,2:Add,Checkbox, x1110 y670 cWhite vChkCont checked,Continuous
else
Gui,2:Add,Checkbox, x1110 y670 cWhite vChkCont ,Continuous






Gui,2:Add,Progress, x200 y730 w50 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gBackward vBackward2 ,<

Gui,2:Add,Progress, x260 y730 w50 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gForward vForward2 ,>



Gui,2:Add, Edit,c%edcol% right x320 y700 w50 h20 vIntervallx,15 ;-- Intro
Gui,2:Add, Progress, x320 y730 w50 h20 Disabled Background%btcol%
Gui,2:Add, Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gIntro,Intro

Gui,2:Add, Progress, x375 y730 w50 h20 Disabled Background%btcol%
Gui,2:Add, Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gIntrostop,IntrEnd


Gui,2:Add,Progress, x440 y730 w60 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gNormal1 vNormal2 ,Normal

;------------------------------------------------------

Gui,2:Add,Edit,c%edcol% right x510 y700 w70 h20 vSlowx,%a3xx% ;-- SlowForward
Gui,2:Add,Progress, x510 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gSlow1 vSlow2 ,Slow->

Gui,2:Add,Edit,c%edcol% right x590 y700 w70 h20 vFastx,%a4xx% ;-- FastForward
Gui,2:Add,Progress, x590 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gFast1 vFast2 ,Fast->>


Gui,2:Add,Edit,c%edcol% right x670 y700 w70 h20 vJumpB,%a5xx% ;-- Jump backward
Gui,2:Add,Progress, x670 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gGoto1B vGoto1B2 ,<Jump

Gui,2:Add,Edit,c%edcol% right x750 y700 w70 h20 vJumpF,%a6xx% ;-- Jump forward
Gui,2:Add,Progress, x750 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gGoto1F vGoto1F2 ,Jump>


Gui,2:Add,Edit,c%edcol% right x830 y700 w70 h20 vGotox,%a7xx% ;-- GotoX
Gui,2:Add,Progress, x830 y730 w70 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans center 0x200 gGoto1X vGoto1X2 ,GotoX



Gui,2:Add,Edit,c%edcol% center x910 y700 w270 h20 vLastplayedx1 readonly,%a8xx% ;-- LastPlayed-file
Gui,2:Add,Progress, x910 y730 w80 h20 Disabled Background%btcol%
Gui,2:Add,Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gPlayagain ,Again



;------------------------------------------------------




Gui, 2:Add, Progress, x1070 y730 w50 h20 Disabled Background%btcol%
Gui, 2:Add, Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gTEST1,Test1

Gui, 2:Add, Progress, x1140 y730 w50 h20 Disabled Background%btcol%
Gui, 2:Add, Text, xp yp wp hp cYellow BackgroundTrans Center 0x200 gTEST2,Test2





;--------- a real progressbar ---------------------
Gui,2:Add, Edit, x510 y670 w500 h20 readonly
Gui,2:Add, Progress, x510 y670 w500 h20 vPRBAR backgroundFF7200 range0-100


Gui,2:add,text, x400 y672 w35 cWhite right vProcentx
Gui,2:add,text, x445 y672 w64 cWhite vPlayedTimex
Gui,2:add,text, x1015 y672 w66 cWhite vLenghtx


Gui,2:add,text, x230 y655 w980 center cWhite vC1x ;-- show filename
Gui,2:Show, x50 y10 w1220 h760,%name1%

GuiControl,2:Focus,SRCHSTR
GuiControl,2:Disable,Pause2
GuiControl,2:Disable,Stop2
GuiControl,2:Text,I4,Stopped
Gosub,filllist
gosub,lastplayed1
;gosub,test1
return
;===========================================================================






television1:
gui,2:submit,nohide
settimer,aas1,off
settimer,intro1,off
url=http://videos.theonion.com/onion_video/auto/14309/sony-releases-new-stupid-piece-of-shit-that-doesnt-flv.mp4 ;-- works
gosub,gosubclearall
GuiControl,2:Text,c1x,%url%
options=""
vlcx.playlist.add(url,"", options)
vlcx.playlist.next()
return
;=================================================



;-------------- -----------------------------------------
test1:
gui,2:submit,nohide
settimer,aas1,off
settimer,intro1,off
gosub,gosubclearall

F0=C:\M_MUSIC\AMERICA_NORTH\USA\blue lake overture shenendoah.mp3
F1:= "file:///" RegExReplace(F0,"\\","/") ; this will replace all the "\" with "/" and add "file:///" at the front
ifexist,%f0%
{
vlcx.playlist.add(F1)
vlcx.playlist.next()
}
else
msgbox,File`n%fx%`nnot exist
;if genre=music
; run,%vlcxx% --qt-start-minimized --play-and-exit "%fx%" ,,,pid1
return
;--------------------------------------------------------------


;-------------- TEST2 -----------------------------------------
test2:
gui,2:submit,nohide
settimer,aas1,off
settimer,intro1,off
gosub,gosubclearall

F0=%a_scriptdir%\test1.jpg
F1:= "file:///" RegExReplace(F0,"\\","/") ; this will replace all the "\" with "/" and add "file:///" at the front ( from user Cephei1 )

;F1=%a_scriptdir%\test1.jpg
ifexist,%f0%
{
vlcx.video.logo.enable()
vlcx.video.logo.file(F1)
options=""
vlcx.playlist.add(F1,"", options)
vlcx.playlist.next()
}
else
msgbox,Picture`n%f1%`nnot exist
;if genre=music
; run,%vlcxx% --qt-start-minimized --play-and-exit "%fx%" ,,,pid1
return
;--------------------------------------------------------





video1:
genre=video
IniWrite,video , %RSSINI% ,section21 , KEY
gosub,filllist
return


music1:
genre=music
IniWrite,music , %RSSINI% ,section21 , KEY
gosub,filllist
return







;--------- plays last played video or music at correct time --------------
lastplayed1:
gui,2:submit,nohide
Gui,2:default
Gui,2:ListView,A1
GC:=LV_GetCount()

IniRead, A8XX, %rssini% , section8 , Key ;-- lastplayed-file
IniRead, A9XX, %rssini% , section9 , Key ;-- lastplayed-file-time 00:04:10 OR 04:10 OR 250
IniRead, RF , %rssini% , section10 , Key ;-- RF RowNumber

SplitPath,A8XX, name, dir, ext, name_no_ext, drive

if a9xx=
a9xx=00:00:01


;F1:="C:\M_MUSIC\AMERICA_NORTH\USA\blue lake overture shenendoah.mp3"
a8xx:= "file:///" RegExReplace(a8xx,"\\","/") ; this will replace all the "\" with "/" and add "file:///" at the front


;ifexist,%A8XX%
{
settimer,aas1,1000
options=""
vlcx.playlist.add(A8XX,"", options)
VLCx.playlist.next()
varxx=%a9xx%
gosub,gosubtimecalc
vlcx.input.time :=(total) ;-- < starts from here
lastplayedx2=%a8xx%
}
GuiControl,2: Enable,Pause2
GuiControl,2: Enable,Stop2
;GuiControl,2:Text,C1xfullpath,%a8xx%
GuiControl,2:Text,C1x,%name%
GuiControl,2:Text,ColumnFromx,Row= %rf% from %ix%
LV_Modify(RF, "+Select +Focus")
;LV_Modify(LV_GetCount(), "Vis") ; jump to last row
rfx:=(rf+30)
if (rfx>=gc)
rfx:=(gc)
LV_Modify(RFX, "Vis") ; visible jump to selected row
return


;----------------------------------------------------------------------





Playagain:
guicontrolget,lastplayedx1
lastplayedx1:= "file:///" RegExReplace(lastplayedx1,"\\","/")
options=""
vlcx.playlist.add(lastplayedx1,"", options)
VLCx.playlist.next()
return












;------------------------------------------------------
2GuiClose:
gui,2:submit,nohide
guicontrolget,chkcont
if chkcont = 1
IniWrite,YES , %rssini% ,section2 , KEY
else
IniWrite,NO , %rssini% ,section2 , KEY



guicontrolget,slowx
guicontrolget,fastx
guicontrolget,JumpB
guicontrolget,JumpF
guicontrolget,gotox
guicontrolget,playedtimex
guicontrolget,lastplayedx1

IniWrite, %slowx% , %rssini% ,section3 , KEY
IniWrite, %fastx% , %rssini% ,section4 , KEY
IniWrite, %jumpb% , %rssini% ,section5 , KEY
IniWrite, %jumpf% , %rssini% ,section6 , KEY
IniWrite, %gotox% , %rssini% ,section7 , KEY
IniWrite, %lastplayedx1%, %rssini% ,section8 , KEY
IniWrite, %playedtimex% , %rssini% ,section9 , KEY
IniWrite, %RF% , %rssini% ,section10 , KEY
ExitApp
;-------------------------------------------------------




Stop1:
gui,2:submit,nohide
gosub,savings
gosub,gosubclearall
vlcx.playlist.stop()
GuiControl,2:Text,I4,Stopped
settimer,aas1,off
settimer,intro1,off
return
;----------------------------------


savings:
gui,2:submit,nohide
guicontrolget,playedtimex
guicontrolget,lastplayedx1
if playedtimex=
playedtimex=00:00:01
IniWrite, %playedtimex% , %rssini% ,section9 , KEY
IniWrite, %lastplayedx1%, %rssini% ,section8 , KEY
IniWrite, %rf% , %rssini% ,section10 , KEY ;RF RowNumber

return
;------------------------------------------------------







gosubclearall:
GuiControl,2:Text,I4,
GuiControl,2:Text,selectedx,
GuiControl,2:Text,c1x,
GuiControl,2:Text,ColumnFromx,
GuiControl,2:Text,prbar,
Guicontrol,2:text,procentx
Guicontrol,2:text,playedtimex
Guicontrol,2:text,lenghtx
return









;-------------------- MENU -----------------------------
MH0:
if A_thisMenuItem=SelectVideo
gosub,selectvideo

if A_thisMenuItem=OpenVideo
gosub,openvideo

if A_thisMenuItem=SelectMusic
gosub,selectmusic

if A_thisMenuItem=OpenMusic
gosub,openmusic

return
;----------------------------------




MH1:
if A_thisMenuItem=VLC_WebPlugin
{
;vlcx.playlist.stop()
;vlcx.playlist.clear()
run,http://wiki.videolan.org/Documentation:WebPlugin
return
}

return
;-----------------------------------



MH2:
if A_thisMenuItem=VLC_Version
{
dc:=vlcx.versionInfo()
msgbox,%dc%
return
}

if A_thisMenuItem=ThisScript
{
run,http://www.autohotkey.com/forum/topic69260.html&highlight=videolan
return
}

if A_thisMenuItem=AHK_version
{
msgbox,Ahk_L-Version =%A_AHKVERSION%
return
}
return

;-----------------------------------





selectvideo:
gui,2:submit,nohide
MF=
FileSelectFolder,MF,,3
if MF=
return
GuiControl,2:text,selectedx,%mf%
IniWrite,%mf% , %RSSINI% ,section1 , KEY
IniWrite,video , %RSSINI% ,section21 , KEY
gosub,filllist
return
;-----------------------------------


Openvideo:
IniRead, A1XX, %rssini% , section1 , Key ;-- which folder
run,%A1XX%
return
;-----------------------------------------
;-----------------------------------------




selectmusic:
gui,2:submit,nohide
MF=
FileSelectFolder,MF,,3
if MF=
return
GuiControl,2:text,selectedx,%mf%
IniWrite,%mf% , %RSSINI% ,section0 , KEY
IniWrite,music , %RSSINI% ,section21 , KEY
gosub,filllist
return
;-----------------------------------



Openmusic:
IniRead, A0XX, %rssini% , section0 , Key ;-- which folder
run,%A0XX%
return

;=========================================================================












;--- jumpto time+plus-x backward ------------------
Goto1B:
acx:=vlcx.input.time
guicontrolget,jumpb
varxx=%jumpb%
gosub,gosubtimecalc
vlcx.input.time :=(-total+acx)
return
;-------------------------------





;--- jumpto time+plus-x forward ------------------
Goto1F:
acx:=vlcx.input.time
guicontrolget,jumpf
varxx=%jumpf%
gosub,gosubtimecalc
endtotal:=(total+acx)
if (endtotal>=bc)
endtotal:=(bc-15000)
vlcx.input.time :=(endtotal)
return
;------------------------------





;----------- goto time-x -------------
Goto1X:
gui,2:submit,nohide
guicontrolget,gotoX
varxx=%gotox%
total:=0
gosub,gosubtimecalc
endtotal:=(total)
if (endtotal>bc)
endtotal:=(bc-15000)
vlcx.input.time :=(endtotal)
return








;---------- speed --------------
Fast1:
guicontrolget,fastx
fastx+=0.0
vlcx.input.rate:=(fastx)
return


Slow1:
guicontrolget,slowx
vlcx.input.rate:=(slowx)
return



;------------------------------------
Back1: ;- not works
vlcx.input.rate:= -5.0
return



;-------- normal-speed ---------------
Normal1:
vlcx.input.rate:=1.0
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
;======================================






;=======================================
searchx:
gui,2:submit,nohide
if srchstr<>
gosub,searchx1
return
;---------- Fill Listview --------------------------------------
searchx1:
src=1
Filllist:
showall:
Gui,2:default
Gui,2:submit,nohide
Gui,2:ListView,A1
gosub,gosubclearall


IniRead,genre, %rssini% , section21 , Key ;--

if genre=music
{
IniRead, AXXX, %rssini% , section0 , Key ;-- which folder
extxx=%extm%
}

if genre=video
{
IniRead, AXXX, %rssini% , section1 , Key ;-- which folder
extxx=%extx%
}

stringmid,tmrx,axxx,2,2
if (tmrx != ":\")
{
whichfolder=No Folder Selected
GuiControl,2:text,selectedx,%whichfolder%
return
}
else
{
whichfolder=%axxx%
GuiControl,2:text,selectedx,%whichfolder%
}

Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
ix=0
LV_Delete()
Loop, %axxx%\*.*, 0, 1
{
SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
If Ext In %extxx%
{
if (src=1)
{
if A_LoopFileFullPath contains %srchstr%
{
IX++
LV_Add("",A_LoopFileName,A_LoopFileFullPath)
}
}
else
{
IX++
LV_Add("",A_LoopFileName,A_LoopFileFullPath)
}
}
}
LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
Splashimage,off
GC:=LV_GetCount()
src=0
GuiControl,2:Text,ColumnFromx,ROW= x from %ix%
GuiControl,2:Focus,SRCHSTR
return
;---------------------------------------------------------------------









;---------------- LISTVIEW ----------------------------
A2:
;Gui,2:default
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
{
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
GuiControl,2:Text,C1x,%c1%
}


if A_GuiEvent = Doubleclick
{
GuiControl,2: Enable,Pause2
GuiControl,2: Enable,Stop2
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
Lastplayedx2=%c2%

C2:= "file:///" RegExReplace(C2,"\\","/")
options=""
vlcx.playlist.add(C2,"", options)
;vlcx.playlist.play()
vlcx.playlist.next()

GuiControl,2:Text,c1x,%c1%
GuiControl,2:Text,ColumnFromx,ROW=%rf% from %ix%
GuiControl,2:Text,I4,Playing
GuiControl,2:Text,lastplayedx1,%lastplayedx2%
settimer,aas1,1000
}


if A_GuiEvent = Rightclick
{
LV_GetText(C1,RF,1)
GuiControl,2:Text,C1x,%c1%
}

return
;---------------------------------------------------










;================== FORWARD =======================
FORWARD:
gui,2:default
GuiControl,2:Enable,Pause2
GuiControl,2:Enable,Stop2
settimer,aas1,1000
settimer,intro1,off

if (RF=(GC))
{
RF:=(GC)
LV_GetText(C2,RF,2)
settimer,aas1,off
msgbox,,,PLAYed LAST-Video,4
return
}

LV_Modify(RF, "-Select -Focus")
RF:=(RF+1)
LV_Modify(RF, "+Select +Focus")
sleep,500
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
Lastplayedx2=%c2%


C2:= "file:///" RegExReplace(C2,"\\","/")
options=""
vlcx.playlist.add(C2,"", options)
VLCx.playlist.next()

GuiControl,2:Text,c1x,%c1%
GuiControl,2:Text,I4,Playing
GuiControl,2:Text,ColumnFromx,ROW=%rf% from %ix%
GuiControl,2:Text,lastplayedx1,%lastplayedx2%
gosub,savings
return
;===================================================







;================== BACKWARD =======================
BACKWARD:
gui,2:default
GuiControl,2:Enable,Pause2
GuiControl,2:Enable,Stop2
settimer,aas1,1000
settimer,intro1,off

if RF=1
{
LV_Modify(1, "+Select +Focus")
LV_GetText(C2,RF,2)
msgbox,,,PLAYS FIRST,2
return
}

LV_Modify(RF, "-Select -Focus")
RF:=(RF-1)
LV_Modify(RF, "+Select +Focus")
sleep,500
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
Lastplayedx2=%c2%

C2:= "file:///" RegExReplace(C2,"\\","/")
options=""
vlcx.playlist.add(C2,"", options)
VLCx.playlist.next()

GuiControl,2:Text,c1x,%c1%
GuiControl,2:Text,I4,Playing
GuiControl,2:Text,ColumnFromx,ROW=%rf% from %ix%
GuiControl,2:Text,lastplayedx1,%lastplayedx2%
gosub,savings
return
;===================================================








;================== INTRO =======================
intro:
gosub,stop1
guicontrolget,intervallx
interv:=(intervallx*1000)
settimer,intro1,%interv%
gosub,intro1
return

intro1:
gui,2:default
GuiControl,2:Enable,Pause2
GuiControl,2:Enable,Stop2
settimer,aas1,1000
if (RF=(GC))
{
RF:=(GC)
LV_GetText(C2,RF,2)
settimer,aas1,off
msgbox,,,PLAYed LAST-Video,4
return
}

LV_Modify(RF, "-Select -Focus")
RF:=(RF+1)
LV_Modify(RF, "+Select +Focus")
sleep,500
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
Lastplayedx2=%c2%


C2:= "file:///" RegExReplace(C2,"\\","/")
options=""
vlcx.playlist.add(C2,"", options)
VLCx.playlist.next()

GuiControl,2:Text,c1x,%c1%

GuiControl,2:Text,I4,Playing
GuiControl,2:Text,ColumnFromx,ROW=%rf% from %ix%
GuiControl,2:Text,lastplayedx1,%lastplayedx2%
return
;===================================================


introstop:
settimer,intro1,off
return









;-------------------------------------------------



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

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.playlist.isPlaying ;-1 otherwise 0
if (ay=0)
cy=Stopped
else
cy=Playing
*/

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=Stopping
if (ay=7)
cy=Error
if (ay=6)
{
cy=Ended
GuiControl,2:Text,I4,%cy%
guicontrolget,chkcont
if chkcont = 1
goto,forward
else
return
}
GuiControl,2:Text,I4,%cy%

RES1:=Round((100*AC)/BC)
GuiControl,2:,PRBAR, %res1%
GuiControl,2:Text,Procentx ,%res1%`%
GuiControl,2:Text,PlayedTimex,%acc%
GuiControl,2:Text,Lenghtx ,%bcx%
return
;---------------------------------






pause1:
gui,2:submit,nohide
vlcx.playlist.togglePause()
return
;-----------------------------------



;=========== END script activeX videolan vlc.exe ===================================


Gerakon
  • Members
  • 11 posts
  • Last active: Aug 08 2013 04:15 PM
  • Joined: 14 Sep 2010
This looks great. I looked through the code briefly. I've been thinking of creating a script with VLC for a while that would would let me play audio books in my car (and resume from a minute before the previous point that I left off). I've found at least minor problems with the ipod, sanza, palm and android audio products that make them at least a little inconvenient to use. I'm planning on building a computer into my dash without a monitor (I think it's illegal here in my state, and common sense to not have a fully functional computer where the driver can see it). I'll get a USB keypad or windows media remote for the controls.

Do you mind if I borrow some of your code? I'll post my script when it's finished.

I haven't ever written a library for AHK, but I've used a few of them. VLC seems like something that would make for a good cantidate for creating a library...... not really suggesting that you make one, Just thinking that it looks like you have a pretty good start on it. It's something that I have a bit of an interest in, so I may take a wack at it if someone doesn't do it before I have time.

Is there a method behind some of your variable names (T# and the single letter ones)? If so, could you explain, or maybe comment them in the code? It's a little hard for me to follow what some parts of your code are doing. This is probably more from my lack of experience than your code, but it would be helpful.


Thanks,
Gerakon

Gerakon
  • Members
  • 11 posts
  • Last active: Aug 08 2013 04:15 PM
  • Joined: 14 Sep 2010
And it looks like I should have scrolled down the list a little more in "Scripts and Functions"

Looks like specter333 beat me to it..... 3 days ago....
http://www.autohotke...topic69150.html

garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005
thank you Gerakon

script is not optimal, glad you make another script, maybe also specter333
vlc has thousand commands , here just some example


Is there a method behind some of your variable names (T# and the single letter ones)? If so, could you explain, or maybe comment them in the code?

some variables are useless , can just use numbers instead
sometimes I like it to use when need the same number/variable again

remarks because the variables ....
; .................
SW=%A_screenwidth%
SH=%A_screenheight%
GSW:=(SW*99)/100   ;-- GUI width
GSH:=(SH*94)/100   ;-- GUI height
LSW:=(SW*98 )/100   ;-- LV width
LSH:=(SH*77)/100   ;-- LV height

;------ column width depending screensize -------------
T1:=(SW*23 )/100   ;NAME          ;-- width column A
T2:=(SW*15 )/100   ;PATH
T3:=(SW*9  )/100   ;SIZE
T4:=(SW*14 )/100   ;C
T5:=(SW*14 )/100   ;A
T6:=(SW*14 )/100   ;M
T7:=(SW*8  )/100   ;FULLPATH

;--- these variables are used for listview columns  ---------
T1A:=T1
T2A:=T1+T2
T3A:=T1+T2+T3
T4A:=T1+T2+T3+T4
T5A:=T1+T2+T3+T4+T5
T6A:=T1+T2+T3+T4+T5+T6
T7A:=T1+T2+T3+T4+T5+T6+T7
;-------------------------------------------------------------

Gui,2:Add,ListView,grid backgroundteal cwhite x0 y0 w%LSW% h%LSH% +hscroll altsubmit logical vA1 gA2, Name|FOLDER|Size|Created|LastAccess|Modified|FullPath
LV_ModifyCol(1,T1)
LV_ModifyCol(2,T2)
LV_ModifyCol(3,T3)
LV_ModifyCol(4,T4)
LV_ModifyCol(5,T5)
LV_ModifyCol(6,T6)
LV_ModifyCol(7,T7)


.................

if A_GuiEvent = Normal
{
MouseGetPos,x,y
 {
if x<%T1A%                        ;--- click column A
   {
   LV_GetText(C7,A_EventInfo,7)
;.................


;-- the variables O P Q R S T are useless , can use A_LoopFilexxx  instead 

       O=%A_LoopFileName%
       P=%A_LoopFileSize%
       Q=%A_LoopFileTimeCreated%
       R=%A_LoopFileTimeAccessed%
       S=%A_LoopFileTimeModified%
       T=%A_LoopFileFullPath%

       StringSplit,CX, T,`\
       C:=(CX0-1)   ; path oneflashback
       D=% CX%C%    ; name from path position -1
       LV_Add("",O,D,P,Q,R,S,T)
;....................


keybored
  • Members
  • 351 posts
  • Last active: Apr 26 2013 09:08 AM
  • Joined: 18 Jun 2006
garry
Wow that's really cool. I will have to play around with that when I get more time.

For now it helped me figure out a much simpler problem. How to start vlc screen recording with the command line.

screen:// --screen-fps=12 --sout "#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:file{dst=C:\\VLCPortable\\FileOutput.mp4}" :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep