✏️ 正在编辑: find-user-target.lua.example
路径:
/usr/share/wireplumber/scripts/linking/find-user-target.lua.example
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
-- WirePlumber -- -- Copyright © 2022 Collabora Ltd. -- -- SPDX-License-Identifier: MIT -- -- example of a user injectible hook to link a node to a custom target lutils = require ("linking-utils") log = Log.open_topic ("s-linking") SimpleEventHook { name = "linking/sample-find-user-target", before = "linking/find-defined-target", interests = { EventInterest { Constraint { "event.type", "=", "select-target" }, }, }, execute = function (event) local source, om, si, si_props, si_flags, target = lutils:unwrap_select_target_event (event) -- bypass the hook if the target is already picked up if target then return end log:info (si, "in find-user-target") -- implement logic here to find a suitable target -- store the found target on the event, -- the next hooks will take care of linking event:set_data ("target", target) end }:register ()
💾 保存文件
← 返回文件管理器