403Webshell
Server IP : 85.112.90.236  /  Your IP : 192.168.1.26
Web Server : Apache
System : Linux 85-112-90-236.cprapid.com 6.12.0-211.7.3.el10_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 12:46:58 EDT 2026 x86_64
User : ftechme ( 1002)
PHP Version : 8.2.32
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/wireplumber/scripts/device/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/wireplumber/scripts/device/apply-profile.lua
-- WirePlumber
--
-- Copyright © 2022 Collabora Ltd.
--
-- SPDX-License-Identifier: MIT

-- apply the selected profile to the device

cutils = require ("common-utils")
log = Log.open_topic ("s-device")

AsyncEventHook {
  name = "device/apply-profile",
  after = { "device/find-stored-profile", "device/find-preferred-profile", "device/find-best-profile" },
  interests = {
    EventInterest {
      Constraint { "event.type", "=", "select-profile" },
    },
  },
  steps = {
    start = {
      next = "none",
      execute = function (event, transition)
        local device = event:get_subject ()
        local profile = event:get_data ("selected-profile")
        local dev_name = device.properties ["device.name"] or ""

        if not profile then
          log:info (device, "No profile found to set on " .. dev_name)
          transition:advance ()
          return
        end

        for p in device:iterate_params ("Profile") do
          local active_profile = cutils.parseParam (p, "Profile")
          if active_profile.index == tonumber(profile.index) then
            log:info (device, "Profile " .. profile.name .. " is already set on " .. dev_name)
            transition:advance ()
            return
          end
        end

        local param = Pod.Object {
          "Spa:Pod:Object:Param:Profile", "Profile",
          index = tonumber(profile.index),
        }
        log:info (device, "Setting profile " .. profile.name .. " on " .. dev_name)
        device:set_param ("Profile", param)

        -- FIXME: add cancellability
        -- sync on the pipewire connection to ensure that the param
        -- has been configured on the remote device object
        Core.sync (function ()
          transition:advance ()
        end)
      end
    },
  }
}:register()

Youez - 2016 - github.com/yon3zu
LinuXploit