Fix ShaderGlass issue in source_synchronizer.lua

It was impossible to capture ShaderGlass windows and retain the OG sound source. This commit fixes that. First select the OG game source. Once the sync fires up, change your game source to point to ShaderGlass window
This commit is contained in:
4aiman 2024-06-22 23:14:32 +03:00 • committed by GitHub
commit d41a11c4ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,10 @@ function timer_callback()
-- also read the slave props, no need to update anything if there's no need to update anything ;) -- also read the slave props, no need to update anything if there's no need to update anything ;)
local slave_window = obs.obs_data_get_string(slave_props, 'window') local slave_window = obs.obs_data_get_string(slave_props, 'window')
if slave_window ~= master_window then --print("slave " .. (slave_window or "-").. "; master " .. (master_window) or "-")
print(string)
if (slave_window ~= master_window) and not string.match(master_window,"ShaderGlass.exe") then
-- copy/paste the window property from the master to the slave -- copy/paste the window property from the master to the slave
obs.obs_data_set_string(slave_props, 'window', master_window) obs.obs_data_set_string(slave_props, 'window', master_window)
-- the copied source won't update unless... -- the copied source won't update unless...
@ -167,3 +170,5 @@ function script_load(settings)
print("Source Synchronizer script loaded") print("Source Synchronizer script loaded")
activate(true) activate(true)
end end