Skip to content

Commit

Permalink
Fix audio hotkey filter creation
Browse files Browse the repository at this point in the history
  • Loading branch information
upgradeQ committed Jan 27, 2021
1 parent 0a4d292 commit 0fd7203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions filter_hotkeys_audio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ info.create = function(settings,source)
local filter = {}
filter.context = source
filter.created_hotkeys = false
filter.hk = {}
filter.hotkeys = {}
return filter
end

info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since filter was created
info.reg_htk = function(filter,settings) -- registered in video_tick
local parent = obs.obs_filter_get_parent(filter.context)
local source_name = obs.obs_source_get_name(parent)
filter.target = parent
filter.hotkeys = {}
local proceed = false
if parent and source_name then proceed = true end
if not proceed then return elseif filter.created_hotkeys then return end
Expand Down Expand Up @@ -69,7 +70,6 @@ info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since
end
obs.source_list_release(result)

filter.hk = {}
for k,v in pairs(filter.hotkeys) do
filter.hk[k] = obs.OBS_INVALID_HOTKEY_ID
end
Expand Down Expand Up @@ -98,7 +98,7 @@ info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since
end
end

info.video_render = function(filter,seconds)
info.video_tick = function(filter,seconds)
info.reg_htk(filter,nil)
end

Expand Down
8 changes: 4 additions & 4 deletions filter_hotkeys_video.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ info.create = function(settings,source)
local filter = {}
filter.context = source
filter.created_hotkeys = false
filter.hotkeys = {}
filter.hk = {}
return filter
end

info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since filter was created
info.reg_htk = function(filter,settings) -- registered in video_render
local parent = obs.obs_filter_get_parent(filter.context)
local source_name = obs.obs_source_get_name(parent)
filter.target = parent
filter.hotkeys = {}
local proceed = false
if parent and source_name then proceed = true end
if not proceed then return elseif filter.created_hotkeys then return end
Expand Down Expand Up @@ -69,7 +70,6 @@ info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since
end
obs.source_list_release(result)

filter.hk = {}
for k,v in pairs(filter.hotkeys) do
filter.hk[k] = obs.OBS_INVALID_HOTKEY_ID
end
Expand Down Expand Up @@ -98,7 +98,7 @@ info.reg_htk = function(filter,settings) -- register hotkeys after 100 ms since
end
end

info.video_render = function(filter,seconds)
info.video_render = function(filter,_effect)
info.reg_htk(filter,nil)
end

Expand Down

0 comments on commit 0fd7203

Please sign in to comment.