diff --git a/src/scripts/linking/filter-forward-format.lua b/src/scripts/linking/filter-forward-format.lua index 63f2f81d..de0271b6 100644 --- a/src/scripts/linking/filter-forward-format.lua +++ b/src/scripts/linking/filter-forward-format.lua @@ -10,8 +10,8 @@ -- -- FIXME: this script can be further improved -local putils = require ("policy-utils") -local config = require ("policy-config") +local putils = require ("linking-utils") +local config = require ("linking-config") log = Log.open_topic ("s-linking") function findAssociatedLinkGroupNode (si) diff --git a/src/scripts/linking/find-best-target.lua b/src/scripts/linking/find-best-target.lua index 12ff709e..cf80287c 100644 --- a/src/scripts/linking/find-best-target.lua +++ b/src/scripts/linking/find-best-target.lua @@ -6,7 +6,7 @@ -- -- Traverse through all the possible targets to pick up target node. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/linking/find-default-target.lua b/src/scripts/linking/find-default-target.lua index 929218fe..1ad372ce 100644 --- a/src/scripts/linking/find-default-target.lua +++ b/src/scripts/linking/find-default-target.lua @@ -6,7 +6,7 @@ -- -- Check if default nodes can be picked up as target node. -local putils = require ("policy-utils") +local putils = require ("linking-utils") log = Log.open_topic ("s-linking") SimpleEventHook { diff --git a/src/scripts/linking/find-defined-target.lua b/src/scripts/linking/find-defined-target.lua index 7002ac7f..cec07a90 100644 --- a/src/scripts/linking/find-defined-target.lua +++ b/src/scripts/linking/find-defined-target.lua @@ -9,9 +9,9 @@ -- 1. "node.target"/"target.object" in the node properties -- 2. "target.node"/"target.object" in the default metadata -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") -local config = require ("policy-config") +local config = require ("linking-config") log = Log.open_topic ("s-linking") SimpleEventHook { diff --git a/src/scripts/linking/find-filter-target.lua b/src/scripts/linking/find-filter-target.lua index c7041f71..49c16940 100644 --- a/src/scripts/linking/find-filter-target.lua +++ b/src/scripts/linking/find-filter-target.lua @@ -6,7 +6,7 @@ -- -- Check if the target node is a filter target. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") local futils = require ("filter-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/linking/find-user-target.lua.example b/src/scripts/linking/find-user-target.lua.example index bc171daf..472ac268 100644 --- a/src/scripts/linking/find-user-target.lua.example +++ b/src/scripts/linking/find-user-target.lua.example @@ -6,7 +6,7 @@ -- -- example of a user injectible hook to link a node to a custom target -local putils = require ("policy-utils") +local putils = require ("linking-utils") log = Log.open_topic ("s-linking") SimpleEventHook { diff --git a/src/scripts/linking/find-virtual-target.lua b/src/scripts/linking/find-virtual-target.lua index c2ba5382..b50f5923 100644 --- a/src/scripts/linking/find-virtual-target.lua +++ b/src/scripts/linking/find-virtual-target.lua @@ -6,7 +6,7 @@ -- -- Select the virtual target based on roles -local putils = require ("policy-utils") +local putils = require ("linking-utils") log = Log.open_topic ("s-linking") local defaults = {} diff --git a/src/scripts/linking/get-filter-from-target.lua b/src/scripts/linking/get-filter-from-target.lua index f462a6e7..fc38cd76 100644 --- a/src/scripts/linking/get-filter-from-target.lua +++ b/src/scripts/linking/get-filter-from-target.lua @@ -6,7 +6,7 @@ -- -- Check if the target node is a filter target. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") local futils = require ("filter-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/linking/link-target.lua b/src/scripts/linking/link-target.lua index 0774e84f..d0e5d0e5 100644 --- a/src/scripts/linking/link-target.lua +++ b/src/scripts/linking/link-target.lua @@ -7,7 +7,7 @@ -- Links a session item to the target that has been previously selected. -- This is meant to be the last hook in the select-target chain. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/linking/move-follow.lua b/src/scripts/linking/move-follow.lua index b49bbb3f..105ea796 100644 --- a/src/scripts/linking/move-follow.lua +++ b/src/scripts/linking/move-follow.lua @@ -8,7 +8,7 @@ -- install hooks that will schedule a rescan of the graph when needed log = Log.open_topic ("s-linking") -local config = require ("policy-config") +local config = require ("linking-config") local handles = {} function handleFollowSetting (enable) diff --git a/src/scripts/linking/prepare-link.lua b/src/scripts/linking/prepare-link.lua index 3538ded4..831353fe 100644 --- a/src/scripts/linking/prepare-link.lua +++ b/src/scripts/linking/prepare-link.lua @@ -8,7 +8,7 @@ -- indicate it is not available for linking. If no target is available, send -- down an error to the corresponding client. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/linking/rescan-virtual-links.lua b/src/scripts/linking/rescan-virtual-links.lua index 0af7196e..b49bfded 100644 --- a/src/scripts/linking/rescan-virtual-links.lua +++ b/src/scripts/linking/rescan-virtual-links.lua @@ -5,7 +5,7 @@ -- -- SPDX-License-Identifier: MIT -local putils = require ("policy-utils") +local putils = require ("linking-utils") log = Log.open_topic ("s-linking") local defaults = {} @@ -14,7 +14,7 @@ defaults.roles = Json.Object {} local config = {} config.duck_level = Conf.get_value_float ("wireplumber.settings", - "policy.default.duck-level", defaults.duck_level) + "linking.default.duck-level", defaults.duck_level) config.roles = Conf.get_section ( "virtual-item-roles", defaults.roles):parse () diff --git a/src/scripts/linking/rescan.lua b/src/scripts/linking/rescan.lua index 35a60aee..504c21d4 100644 --- a/src/scripts/linking/rescan.lua +++ b/src/scripts/linking/rescan.lua @@ -10,7 +10,7 @@ -- Cleanup links when the linkables they are associated with are removed. -- Also, cleanup flags attached to linkables. -local putils = require ("policy-utils") +local putils = require ("linking-utils") local cutils = require ("common-utils") local futils = require ("filter-utils") log = Log.open_topic ("s-linking") diff --git a/src/scripts/node/create-item.lua b/src/scripts/node/create-item.lua index 120c86ff..20a0d355 100644 --- a/src/scripts/node/create-item.lua +++ b/src/scripts/node/create-item.lua @@ -8,7 +8,7 @@ -- create-item.lua script takes pipewire nodes and creates session items (a.k.a -- linkable) objects out of them. -config = require ("policy-config") +config = require ("linking-config") log = Log.open_topic ("s-node") items = {} diff --git a/src/scripts/policy-bluetooth.lua b/src/scripts/policy-bluetooth.lua index 05727749..8682e21a 100644 --- a/src/scripts/policy-bluetooth.lua +++ b/src/scripts/policy-bluetooth.lua @@ -24,7 +24,7 @@ -- When a stream goes away if the list with which we track the streams above -- is empty, then we revert back to the old profile. --- settings file: policy.conf +-- settings file: linking.conf local cutils = require ("common-utils") @@ -35,11 +35,11 @@ defaults.app_settings = Json.Array {} local config = {} config.use_persistent_storage = Conf.get_value_boolean ("wireplumber.settings", - "policy.bluetooth.use-persistent-storage", defaults.use_persistent_storage) + "linking.bluetooth.use-persistent-storage", defaults.use_persistent_storage) config.use_headset_profile = Conf.get_value_boolean ("wireplumber.settings", - "policy.bluetooth.media-role.use-headset-profile", defaults.use_headset_profile) + "linking.bluetooth.media-role.use-headset-profile", defaults.use_headset_profile) config.apps_setting = Conf.get_value ("wireplumber.settings", - "policy.bluetooth.media-role.applications", defaults.app_settings): parse () + "linking.bluetooth.media-role.applications", defaults.app_settings): parse () state = nil headset_profiles = nil @@ -47,7 +47,7 @@ headset_profiles = nil function handlePersistantSetting (enable) if enable and state == nil then -- the state storage - state = config.use_persistent_storage and State ("policy-bluetooth") or nil + state = config.use_persistent_storage and State ("linking-bluetooth") or nil headset_profiles = state and state:load () or {} else state = nil @@ -56,14 +56,14 @@ function handlePersistantSetting (enable) end local function settingsChangedCallback (_, setting, json) - if setting == "policy.bluetooth.use-persistent-storage" and + if setting == "linking.bluetooth.use-persistent-storage" and json:is_boolean () then config.use_persistent_storage = json:parse () handlePersistantSetting (config.use_persistent_storage) - elseif setting == "policy.bluetooth.media-role.use-headset-profile" and + elseif setting == "linking.bluetooth.media-role.use-headset-profile" and json:is_boolean () then config.use_headset_profile = json:parse () - elseif setting == "policy.bluetooth.media-role.applications" + elseif setting == "linking.bluetooth.media-role.applications" and json:is_array () then local new_apps_setting = json:parse () if #new_apps_setting > 0 then @@ -73,7 +73,7 @@ local function settingsChangedCallback (_, setting, json) end end -Settings.subscribe ("policy.bluetooth*", settingsChangedCallback) +Settings.subscribe ("linking.bluetooth*", settingsChangedCallback) handlePersistantSetting (config.use_persistent_storage) @@ -381,7 +381,7 @@ local function handleAllStreams () end SimpleEventHook { - name = "input-stream-removed@policy-bluetooth", + name = "input-stream-removed@linking-bluetooth", interests = { EventInterest { Constraint { "event.type", "=", "node-removed" }, @@ -397,7 +397,7 @@ SimpleEventHook { }:register () SimpleEventHook { - name = "input-stream-changed@policy-bluetooth", + name = "input-stream-changed@linking-bluetooth", interests = { EventInterest { Constraint { "event.type", "=", "node-state-changed" }, @@ -418,7 +418,7 @@ SimpleEventHook { }:register () SimpleEventHook { - name = "bluez-device-added@policy-bluetooth", + name = "bluez-device-added@linking-bluetooth", interests = { EventInterest { Constraint { "event.type", "=", "device-added" }, @@ -436,7 +436,7 @@ SimpleEventHook { }:register () SimpleEventHook { - name = "metadata-changed@policy-bluetooth", + name = "metadata-changed@linking-bluetooth", interests = { EventInterest { Constraint { "event.type", "=", "metadata-changed" },