History

osc.lua: don't print auto before tracks are selected

While files are loading, track options have the value "auto". Print "-" in that case. Fixes 1a558bf5c2.

Guido Cella committed 2 years ago

Commit 897c04a1 parent 99e49791 file · +12 −2Browse files

Showing the changes to player/lua/osc.lua (1 of 1 file). Show all

Unified · Split

player/lua/osc.lua+12−2
@@ -1863,8 +1863,13 @@ local function osc_init() · 1862 unmodified lines
18631863
18641864 ne.enabled = audio_track_count > 0
18651865 ne.content = function ()
1866+ local aid = mp.get_property("aid")
1867+ if aid == "no" or aid == "auto" then
1868+ aid = "-"
1869+ end
1870+
18661871 return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..
1867− (mp.get_property_native("aid") or "-") .. "/" .. audio_track_count)
1872+ aid .. "/" .. audio_track_count)
18681873 end
18691874 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.audio_track_mbtn_left_command)
18701875 ne.eventresponder["shift+mbtn_left_up"] = command_callback(
@@ -1883,8 +1888,13 @@ local function osc_init() · 12 unmodified lines
18831888
18841889 ne.enabled = sub_track_count > 0
18851890 ne.content = function ()
1891+ local sid = mp.get_property("sid")
1892+ if sid == "no" or sid == "auto" then
1893+ sid = "-"
1894+ end
1895+
18861896 return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..
1887− (mp.get_property_native("sid") or "-") .. "/" .. sub_track_count)
1897+ sid .. "/" .. sub_track_count)
18881898 end
18891899 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_left_command)
18901900 ne.eventresponder["shift+mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_mid_command)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t