mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 07:42:17 +00:00
osc: add volume icons to osd font and use them
Glyphs taken and based on U+1F507 to U+1F50A from Symbola, which is available under public domain: http://users.teilar.gr/~g1951d/
This commit is contained in:
parent
a047e636ab
commit
05c8707a0b
@ -1837,11 +1837,12 @@ function osc_init()
|
|||||||
ne.content = function()
|
ne.content = function()
|
||||||
local volume = mp.get_property_number("volume", 0)
|
local volume = mp.get_property_number("volume", 0)
|
||||||
local mute = mp.get_property_native("mute")
|
local mute = mp.get_property_native("mute")
|
||||||
local volicon = {"🔈", "🔉", "🔊"}
|
local volicon = {"\238\132\139", "\238\132\140",
|
||||||
|
"\238\132\141", "\238\132\142"}
|
||||||
if volume == 0 or mute then
|
if volume == 0 or mute then
|
||||||
return "🔇"
|
return "\238\132\138"
|
||||||
else
|
else
|
||||||
return volicon[math.min(3,math.ceil(volume / (100/3)))]
|
return volicon[math.min(4,math.ceil(volume / (100/3)))]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ne.eventresponder["mouse_btn0_up"] =
|
ne.eventresponder["mouse_btn0_up"] =
|
||||||
|
BIN
sub/osd_font.otf
BIN
sub/osd_font.otf
Binary file not shown.
Loading…
Reference in New Issue
Block a user