Code: Select all
@echo off
rem ##################################################################################
rem # Mosaic Zumba -> from Zumba I to Zumba IV #
rem # ---------------------------------------- #
rem # All the windows are started with the audio. #
rem # #
rem # All the hotkeys of VLC are usable for each subpicture, after select with a #
rem # mouse click. #
rem # #
rem # After launching of each subpicture, True is displayed in Mosaic VLC to #
rem # indicate a good start, in mute; else, False is displayed. #
rem # #
rem # To quit the mosaic, select Mosaic VLC and strike any key. #
rem # #
rem # WARNING: #
rem # Here, it is assumed that the creation time of the task corresponding to a #
rem # sub-window is less than one second; if he can be superior: #
rem # - increase the time in AudioToggle, $_.CPU -le 1; here, forced to 1.5; #
rem # - if he is random, add a loop to make sure the task is fully started #
rem # before searching for his Process id. #
rem # #
rem # Technical informations: #
rem # - a VLC subpicture is composed of two windows Windows 10: #
rem # - one main, hidden, identified by his Process id and his hWnd; #
rem # - one child, used for display, identified by his hWnd; #
rem # - the hotkeys of VLC must be adressed to the child window; #
rem # - after sending to a child window, the only direct method to retrieve the #
rem # focus here, is the use of Task view by the send of Alt+Tab; #
rem # - NULL is a file created in the current path to log debug informations. #
rem # #
rem # Malfunctions: #
rem # - thin black border around the videos; unknown cause; #
rem # - --width and --height don't function; BUG VLC; here, --zoom is used; #
rem # the inconvenients are : #
rem # - necessity to adjust --zoom to obtain the wished size of the subpicture; #
rem # - loss of video quality in fullscreen (strike of F), because upscaling on a #
rem # reduced video resolution cannot be well displayed in the subpicture. #
rem # #
rem ##################################################################################
Code: Select all
rem ##################################################################################
rem # FUNCTION AudioToggle -> to toggle the sound, using the hotkey M of VLC, for #
rem # ----------- one subpicture. #
rem # #
rem # Warnings: #
rem # - %, ", are significant characters for the command interpreter; for direct use,#
rem # they must be trebled; #
rem # - caret ^ is used at the end of a multiple lines command; its function is to #
rem # take the next character for his ASCII value, here New line; so, the caret #
rem # must be the last character of the line, and it's necessary to use Notepad or #
rem # equivalent to edit; #
rem # - to transmit online several return values from a PowerShell script to the #
rem # calling cmd, the only possible method is the using of Environment Variable; #
rem # the method used here ensures the good affectation in a cmd set statement. #
rem # #
rem ##################################################################################
:AudioToggle
set /a SubpictureOldInd+=1 &rem Increment the value of the variable by 1
set ProcessId=0 & set hWmain=0 & set hWchild=0 &rem Initialization of the variables for returned values
rem Line by line:
rem - get the Process id of the last subpicture started;
rem - waiting for the subpicture construction, and get the handle number of the MAIN window ($hWm);
rem - get the handle number of the CHILD window ($hWc);
rem - update the return value in the Environment Variable Vlc;
rem - set the focus to the CHILD window;
rem - the Sleep below is, only, to obtain a delay for listening the audio;
rem send the hotkey m to toggle audio, and retrieve immediately the focus for cmd.
powerShell $Pi=Get-Process 'vlc' ^| Where-Object{$_.CPU -le 1.5} ^| Select -expand ID; ^
Sleep 1; $hWm=(Get-Process -Id $Pi.ToString()).MainWindowHandle; ^
$FW=Add-Type -MemberDefinition %DllFwe% -Name Wfw -PassThru; $hWc=$FW::FindWindowEx($hWm,[IntPtr]::Zero,[IntPtr]::Zero,[String]::Empty); ^
[System.Environment]::SetEnvironmentVariable('Vlc', $Pi.ToString()+' '+$hWm.ToString()+' '+$hWc.ToString(), 'user'); ^
$SF=Add-Type -MemberDefinition %DllSfw% -Name Wsf -PassThru; $SF::SetForegroundWindow($hWc); ^
$WS=New-Object -ComObject wscript.shell; Sleep 4; $WS.SendKeys('m'); $WS.SendKeys('%%%{TAB}')
rem Get return value in Vlc; this syntax reg query is for a one line result of a command.
for /f "tokens=3-5" %%V in ('"reg query "HKCU\Environment" /v Vlc"') do (set ProcessId=%%V &set hWmain=%%W &set hWchild=%%X)
rem These variables are for future developments.
echo %Stars% Subpicture %SubpictureOldInd% ProcessId= %ProcessId% hWmain= %hWmain% hWchild= %hWchild% %Stars% >>NULL &rem debug
goto:eof
rem # End of the FUNCTION AudioToggle ################################################
Code: Select all
;===============================================================================
;========= VLC - media player AND VLC playlist *Hotkeys* ===========
;===============================================================================
; The following is no longer valid, because VLC is now run by the renamed
; VLC_vendor.exe. 20200514:
;;;#IfWinActive, Playlist ahk_exe vlc.exe ; VLC Playlist
#IfWinActive, Playlist ; VLC Playlist
!^s:: ; Alt + Ctrl + s - Resave VLC Playlist
run %ahk_exe% /restart "%ahk_macros%\SaveVLCPlaylist.ahk" "Prompt", %pgmfiles%\Autohotkey
return
#IfWinActive, VLC media player ; VLC media player
; The following is no longer valid, because VLC is now run by the renamed
; VLC_vendor.exe. 20200514:
;;;#IfWinActive, VLC media player ahk_exe vlc.exe ; VLC media player
!^s:: ; Alt + Ctrl + s - Resave VLC Playlist
run %ahk_exe% /restart "%ahk_macros%\SaveVLCPlaylist.ahk" "Prompt", %pgmfiles%\Autohotkey
return
; $ in the following allow the hotkey to send it's own value (without triggering
; the hotkey again!)
; Alt+Ctl+Right/Left are LONG jumps (forward and backward)
$!^Left:: Send, !^{Left} ; Alt + Ctrl + Left : Native function for VLC
$!^Right:: Send, !^{right} ; Alt + Ctrl + Right : Native function for VLC
F5:: Send, !^{left} ; jump back - long
F6:: Send, ^{left} ; jump back - medium
F7:: Send, !{left} ; jump back - short
F8:: Send, +{left} ; jump back - very short
F9:: Send, +{right} ; jump forward - very short
F10:: Send, !{right} ; jump forward - short
F11:: Send, ^{right} ; jump forward - medium
F12:: Send, !^{right} ; jump forward - long
Return to “VLC media player for Windows Troubleshooting”
Users browsing this forum: No registered users and 84 guests