some examples for videolan vlc.exe
Code: Select all
#NoEnv
SendMode, Input
SetWorkingDir, %A_ScriptDir%
SetTitleMatchMode 2
SetBatchLines, -1
VLC =%A_programfiles%\VideoLAN\VLC\vlc.exe
;C2 =C:\test.mp3
C2 =C:\test.mp4
SetFormat, float, 04
begintime=00:00:30
endtime =00:00:45
gosub,timecalc
;-------------
;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-stop --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 =--repeat --fullscreen --start-time=%begin% --stop-time=%end%
run,%VLC% %input% "%C2%",,,pid2
return
esc::
{
process, exist,%pid2%
if errorlevel=0
return
else
{
process,close,%pid2%
exitapp
}
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
;===============================================
a RANDOM music player
Code: Select all
;- https://autohotkey.com/board/topic/51861-tinyshuffle-smallest-mp3-player-on-earth/
#warn
#Noenv
#singleinstance, force ;- force the app to reload if reopened
setworkingdir,%a_scriptdir%
mp3root=D:\M_MEDIA\M_MUSIC ;- your music files here
IfNotExist,%mp3root%
exitapp ;- If the dir doesn't exist, exit the app
played=
Filelist0=0
Menu,Tray, NoStandard ;- Remove the standard items from the menu
Menu,Tray,add,skip,#s ;- Add a item to skip a song
Menu,Tray,add,exit,#esc ;- Add exit item
Menu,Tray, icon, shell32.dll, 138 ;- give the tray a icon
Menu,Tray,Default,skip ;- set the menu's default item if leftclick
Menu,Tray,Click,1 ;- Single-click to activate the tray menu's default menu item.
Loop %mp3root%\*.*,, 1 ;- Loop all files in the folder
If A_LoopFileExt in mp3,wma ;- If it is a supported filetype
{
FileList0++ ;- Add one to the count of files
FileList%FileList0%:=A_LoopFileFullPath ;- Store the path of the file
}
menu, tray, tip, Tiny Shuffler - %FileList0% items
loop {
Random, rand, 1, %FileList0% ;- Get a random nr with a max of the nr of items in the fillelist
if rand not in %played% ;- If we did not played the song before (needs a comma delimited list)
{
TrayTip , Tiny Shuffler - %FileList0% items,% filelist%rand%,3 ;- Show the filename of the new song
Soundplay,% filelist%rand%, wait ;- Play the song and wait until it finishes
played.=played ? "," rand : rand ;- Add the songnr to the played ones (create the comma delimited list)
Loop, parse, played, `, ;- Loop to see if we played all (Loop the comma delimited list)
IfEqual,A_Index,%FileList0%,SetEnv,played, ;- If we played all, reset to play all again
}
}
return ;- End of the main section
;--------------------------------------------------------------
#s:: Soundplay,skip ;- win+s Give a fiction name to clear the playing item so the Loop continues
#esc:: exitapp ;- win+esc Exit the app
;==============================================================