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
1863 1863
1864 ne.enabled = audio_track_count > 01864 ne.enabled = audio_track_count > 0
1865 ne.content = function ()1865 ne.content = function ()
1866 local aid = mp.get_property("aid")
1867 if aid == "no" or aid == "auto" then
1868 aid = "-"
1869 end
1870
1866 return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..1871 return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..
1867 (mp.get_property_native("aid") or "-") .. "/" .. audio_track_count)1872 aid .. "/" .. audio_track_count)
1868 end1873 end
1869 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.audio_track_mbtn_left_command)1874 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.audio_track_mbtn_left_command)
1870 ne.eventresponder["shift+mbtn_left_up"] = command_callback(1875 ne.eventresponder["shift+mbtn_left_up"] = command_callback(
@@ -1883,8 +1888,13 @@ local function osc_init() · 12 unmodified lines
1883 1888
1884 ne.enabled = sub_track_count > 01889 ne.enabled = sub_track_count > 0
1885 ne.content = function ()1890 ne.content = function ()
1891 local sid = mp.get_property("sid")
1892 if sid == "no" or sid == "auto" then
1893 sid = "-"
1894 end
1895
1886 return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..1896 return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..
1887 (mp.get_property_native("sid") or "-") .. "/" .. sub_track_count)1897 sid .. "/" .. sub_track_count)
1888 end1898 end
1889 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_left_command)1899 ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_left_command)
1890 ne.eventresponder["shift+mbtn_left_up"] = command_callback(user_opts.sub_track_mbtn_mid_command)1900 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