History

osc.lua: rename buttons

Give buttons nicer names before exposing script-opts for their bindings. In particular, rename cy_audio and cy_sub to audio_track and sub_track because their left click binding no longer cycles.

Guido Cella committed 2 years ago

Commit e6db75b1 parent c24c9021 file · +32 −32Browse files

Unified · Split

player/lua/osc.lua+32−32
@@ -1221,12 +1221,12 @@ layouts["box"] = function () · 1220 unmodified lines
12211221 lo.style = osc_styles.vidtitle
12221222 lo.button.maxchars = user_opts.boxmaxchars
12231223
1224− lo = add_layout("pl_prev")
1224+ lo = add_layout("playlist_prev")
12251225 lo.geometry =
12261226 {x = (posX - pos_offsetX), y = titlerowY, an = 7, w = 12, h = 12}
12271227 lo.style = osc_styles.topButtons
12281228
1229− lo = add_layout("pl_next")
1229+ lo = add_layout("playlist_next")
12301230 lo.geometry =
12311231 {x = (posX + pos_offsetX), y = titlerowY, an = 9, w = 12, h = 12}
12321232 lo.style = osc_styles.topButtons
@@ -1238,37 +1238,37 @@ layouts["box"] = function () · 5 unmodified lines
12381238 local bigbtnrowY = posY - pos_offsetY + 35
12391239 local bigbtndist = 60
12401240
1241− lo = add_layout("playpause")
1241+ lo = add_layout("play_pause")
12421242 lo.geometry =
12431243 {x = posX, y = bigbtnrowY, an = 5, w = 40, h = 40}
12441244 lo.style = osc_styles.bigButtons
12451245
1246− lo = add_layout("skipback")
1246+ lo = add_layout("skip_backward")
12471247 lo.geometry =
12481248 {x = posX - bigbtndist, y = bigbtnrowY, an = 5, w = 40, h = 40}
12491249 lo.style = osc_styles.bigButtons
12501250
1251− lo = add_layout("skipfrwd")
1251+ lo = add_layout("skip_forward")
12521252 lo.geometry =
12531253 {x = posX + bigbtndist, y = bigbtnrowY, an = 5, w = 40, h = 40}
12541254 lo.style = osc_styles.bigButtons
12551255
1256− lo = add_layout("ch_prev")
1256+ lo = add_layout("chapter_prev")
12571257 lo.geometry =
12581258 {x = posX - (bigbtndist * 2), y = bigbtnrowY, an = 5, w = 40, h = 40}
12591259 lo.style = osc_styles.bigButtons
12601260
1261− lo = add_layout("ch_next")
1261+ lo = add_layout("chapter_next")
12621262 lo.geometry =
12631263 {x = posX + (bigbtndist * 2), y = bigbtnrowY, an = 5, w = 40, h = 40}
12641264 lo.style = osc_styles.bigButtons
12651265
1266− lo = add_layout("cy_audio")
1266+ lo = add_layout("audio_track")
12671267 lo.geometry =
12681268 {x = posX - pos_offsetX, y = bigbtnrowY, an = 1, w = 70, h = 18}
12691269 lo.style = osc_styles.smallButtonsL
12701270
1271− lo = add_layout("cy_sub")
1271+ lo = add_layout("sub_track")
12721272 lo.geometry =
12731273 {x = posX - pos_offsetX, y = bigbtnrowY, an = 7, w = 70, h = 18}
12741274 lo.style = osc_styles.smallButtonsL
@@ -1511,12 +1511,12 @@ local function bar_layout(direction) · 236 unmodified lines
15111511 -- Playlist prev/next
15121512 geo = { x = osc_geo.x + padX, y = line1,
15131513 an = 4, w = 18, h = 18 - padY }
1514− lo = add_layout("pl_prev")
1514+ lo = add_layout("playlist_prev")
15151515 lo.geometry = geo
15161516 lo.style = osc_styles.topButtonsBar
15171517
15181518 geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
1519− lo = add_layout("pl_next")
1519+ lo = add_layout("playlist_next")
15201520 lo.geometry = geo
15211521 lo.style = osc_styles.topButtonsBar
15221522
@@ -1544,17 +1544,17 @@ local function bar_layout(direction) · 21 unmodified lines
15441544 -- Playback control buttons
15451545 geo = { x = osc_geo.x + padX + padwc_l, y = line2, an = 4,
15461546 w = buttonW, h = 36 - padY*2}
1547− lo = add_layout("playpause")
1547+ lo = add_layout("play_pause")
15481548 lo.geometry = geo
15491549 lo.style = osc_styles.smallButtonsBar
15501550
15511551 geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
1552− lo = add_layout("ch_prev")
1552+ lo = add_layout("chapter_prev")
15531553 lo.geometry = geo
15541554 lo.style = osc_styles.smallButtonsBar
15551555
15561556 geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
1557− lo = add_layout("ch_next")
1557+ lo = add_layout("chapter_next")
15581558 lo.geometry = geo
15591559 lo.style = osc_styles.smallButtonsBar
15601560
@@ -1582,12 +1582,12 @@ local function bar_layout(direction) · 21 unmodified lines
15821582
15831583 -- Track selection buttons
15841584 geo = { x = geo.x - tsW - padX, y = geo.y, an = geo.an, w = tsW, h = geo.h }
1585− lo = add_layout("cy_sub")
1585+ lo = add_layout("sub_track")
15861586 lo.geometry = geo
15871587 lo.style = osc_styles.smallButtonsBar
15881588
15891589 geo = { x = geo.x - geo.w - padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
1590− lo = add_layout("cy_audio")
1590+ lo = add_layout("audio_track")
15911591 lo.geometry = geo
15921592 lo.style = osc_styles.smallButtonsBar
15931593
@@ -1715,7 +1715,7 @@ local function osc_init() · 121 unmodified lines
17151715 -- playlist buttons
17161716
17171717 -- prev
1718− ne = new_element("pl_prev", "button")
1718+ ne = new_element("playlist_prev", "button")
17191719
17201720 ne.content = "\238\132\144"
17211721 ne.enabled = (pl_pos > 1) or (loop ~= "no")
@@ -1732,7 +1732,7 @@ local function osc_init() · 10 unmodified lines
17321732 function () mp.command("show-text ${playlist} 3000") end
17331733
17341734 --next
1735− ne = new_element("pl_next", "button")
1735+ ne = new_element("playlist_next", "button")
17361736
17371737 ne.content = "\238\132\129"
17381738 ne.enabled = (have_pl and (pl_pos < pl_count)) or (loop ~= "no")
@@ -1751,8 +1751,8 @@ local function osc_init() · 12 unmodified lines
17511751
17521752 -- big buttons
17531753
1754− --playpause
1755− ne = new_element("playpause", "button")
1754+ --play_pause
1755+ ne = new_element("play_pause", "button")
17561756
17571757 ne.content = function ()
17581758 if mp.get_property("pause") == "yes" then
@@ -1768,8 +1768,8 @@ local function osc_init() · 9 unmodified lines
17681768 ne.eventresponder["mbtn_left_up"] =
17691769 function () mp.commandv("cycle", "pause") end
17701770
1771− --skipback
1772− ne = new_element("skipback", "button")
1771+ --skip_backward
1772+ ne = new_element("skip_backward", "button")
17731773
17741774 ne.softrepeat = true
17751775 ne.content = "\238\128\132"
@@ -1780,8 +1780,8 @@ local function osc_init() · 4 unmodified lines
17801780 ne.eventresponder["mbtn_right_down"] =
17811781 function () mp.commandv("seek", -30) end
17821782
1783− --skipfrwd
1784− ne = new_element("skipfrwd", "button")
1783+ --skip_forward
1784+ ne = new_element("skip_forward", "button")
17851785
17861786 ne.softrepeat = true
17871787 ne.content = "\238\128\133"
@@ -1792,8 +1792,8 @@ local function osc_init() · 4 unmodified lines
17921792 ne.eventresponder["mbtn_right_down"] =
17931793 function () mp.commandv("seek", 60) end
17941794
1795− --ch_prev
1796− ne = new_element("ch_prev", "button")
1795+ --chapter_prev
1796+ ne = new_element("chapter_prev", "button")
17971797
17981798 ne.enabled = have_ch
17991799 ne.content = "\238\132\132"
@@ -1810,8 +1810,8 @@ local function osc_init() · 10 unmodified lines
18101810 mp.command("script-binding select/select-chapter; script-message-to osc osc-hide")
18111811 end
18121812
1813− --ch_next
1814− ne = new_element("ch_next", "button")
1813+ --chapter_next
1814+ ne = new_element("chapter_next", "button")
18151815
18161816 ne.enabled = have_ch
18171817 ne.content = "\238\132\133"
@@ -1831,8 +1831,8 @@ local function osc_init() · 13 unmodified lines
18311831 --
18321832 update_tracklist()
18331833
1834− --cy_audio
1835− ne = new_element("cy_audio", "button")
1834+ --audio_track
1835+ ne = new_element("audio_track", "button")
18361836
18371837 ne.enabled = audio_track_count > 0
18381838 ne.content = function ()
@@ -1854,8 +1854,8 @@ local function osc_init() · 15 unmodified lines
18541854 function () mp.command("cycle audio down") end
18551855 end
18561856
1857− --cy_sub
1858− ne = new_element("cy_sub", "button")
1857+ --sub_track
1858+ ne = new_element("sub_track", "button")
18591859
18601860 ne.enabled = sub_track_count > 0
18611861 ne.content = function ()

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