summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua/audio-hotplug-test.lua
blob: f27b793151e26f2b7e1cd3f59681a5801f315937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
local utils = require("mp.utils")

mp.observe_property("audio-device-list", "native", function(name, val)
    print("Audio device list changed:")
    for index, e in ipairs(val) do
        print("  - '" .. e.name .. "' (" .. e.description .. ")")
    end
end)

mp.observe_property("audio-out-detected-device", "native", function(name, val)
    print("Detected audio device changed:")
    print("  - '" .. val)
end)