majstang Posted March 24, 2017 Share Posted March 24, 2017 (edited) Hello! I use this script to switch audio renderers just by clicking the title bar of the TSPlayer control window. When trying to make it completely failsafe by selecting a tab directly in TSPlayer programatically using a SendMessage: SendMessage, 0x1330, 2,, TPageControl1, ahk_class TfrmPlayer ; 0x1330 is TCM_SETCURFOCUS. Selects DirectShow TAB. I get surprising results when using the EVR Custom Renderer. TPanel1 video window goes black and if trying to switch audio renderers again by script, usually ends with a separate ActiveMovie Window pops up where video is working, while the TPanel1 control is still blackend. If using the EVR Enhanced Video Renderer the issue could not be reproduced. Why does the EVR Custom Renderer go nuts when sending 0x1330 to a TPageControl1? This seem to me like there is a bug. Code looks like this: WinShow, ahk_class TfrmPlayer WinActivate, ahk_class TfrmPlayer SendMessage, 0x1330, 2,, TPageControl1, ahk_class TfrmPlayer ; 0x1330 is TCM_SETCURFOCUS. Selects DirectShow TAB ;Control, TabRight, 2, TPageControl1, ahk_class TfrmPlayer ; Are forced to use this non-failsafe tab selecting method instead ControlGet, Renderer, Choice, , TComboBox1, ahk_class TfrmPlayer ControlGet, Renderer_List, List, , TComboBox1, ahk_class TfrmPlayer Loop, Parse, Renderer_List, `n { If (InStr(A_LoopField, "DirectSound: 1 - SAMSUNG (AMD High Definition Audio Device)")) Samsung_1 := A_Index If (InStr(A_LoopField, "DirectSound: Realtek Digital Output(Optical) (Realtek High Definition Audio)")) Optical := A_Index } Sleep, 100 If (Renderer = "DirectSound: 1 - SAMSUNG (AMD High Definition Audio Device)") Control, Choose, % Optical, TComboBox1, ahk_class TfrmPlayer If (Renderer = "DirectSound: Realtek Digital Output(Optical) (Realtek High Definition Audio)") Control, Choose, % Samsung_1, TComboBox1, ahk_class TfrmPlayer If !(Renderer = "DirectSound: 1 - SAMSUNG (AMD High Definition Audio Device)") && !(Renderer = "DirectSound: Realtek Digital Output(Optical) (Realtek High Definition Audio)") Control, Choose, % Samsung_1, TComboBox1, ahk_class TfrmPlayer SendMessage, 0x1330, 0,, TPageControl1, ahk_class TfrmPlayer ; Selects Player TAB ;Control, TabLeft, 2, TPageControl1, ahk_class TfrmPlayer ; Are forced to use this non-failsafe tab selecting method instead WinActivate, ahk_class TfrmVideo Edited March 25, 2017 by majstang Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.