017a17e85a97da380b7a09126ab44db69e3108c8
11 section ==
"Properties:" {
25 # Volume: front-left: 45732 / 70% / -9.38 dB, front-right: 45732 / 70% / -9.38 dB
30 sub("^\t+Volume: +", "")
31 split($
0, vol_parts
, ", +")
32 sub("^front-left: +", "", vol_parts
[1])
33 sub("^front-right: +", "", vol_parts
[2])
34 split(vol_parts
[1], left_parts
, " +/ +")
35 split(vol_parts
[2], right_parts
, " +/ +")
36 vol_left
[sink
] = left_parts
[2]
37 vol_right
[sink
] = right_parts
[2]
43 device = properties
[sink
, "alsa.device"]
44 print("state" Kfs device
, state
[sink
])
45 print("mute" Kfs device
, mute
[sink
])
46 print("vol_left" Kfs device
, vol_left
[sink
])
47 print("vol_right" Kfs device
, vol_right
[sink
])
51 function read_property
() {
53 # Yes, the sequence (x-1+1) is redundant, but it keeps the variable names
54 # true to their meaning:
55 val_begin =
index($
0, "\"") + 1 # +1 to exclude first quote
56 val_end =
length($
0) - 1 # -1 to exclude last quote
57 val_len =
(val_end
- val_begin
) + 1 # +1 to include final character
58 val =
substr($
0, val_begin
, val_len
)
59 properties
[sink
, key
] = val
This page took 0.058928 seconds and 3 git commands to generate.