Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions components/video/OSD.bs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ sub init()
m.videoInfo = m.top.findNode("videoInfo")
m.itemTitle = m.top.findNode("itemTitle")
m.videoPlayPause = m.top.findNode("videoPlayPause")
m.videoRemainingTime = m.top.findNode("videoRemainingTime")
m.videoEndingTime = m.top.findNode("videoEndingTime")
m.belowLeft = m.top.findNode("belowLeft")
m.aboveRight = m.top.findNode("aboveRight")
m.belowRight = m.top.findNode("belowRight")
m.aboveLeft = m.top.findNode("aboveLeft")
m.progressBar = m.top.findNode("progressBar")
m.progressBarBackground = m.top.findNode("progressBarBackground")
m.progressIndicator = m.top.findNode("progressIndicator")
Expand All @@ -34,7 +36,6 @@ sub init()
m.top.observeField("hasFocus", "onFocusChanged")
m.top.observeField("progressPercentage", "onProgressPercentageChanged")
m.top.observeField("playbackState", "onPlaybackStateChanged")
m.top.observeField("videoEndingTime", "setVideoEndingTime")

m.top.observeField("itemTitleText", "onItemTitleTextChanged")
m.top.observeField("itemSubtitleText", "onItemSubtitleTextChanged")
Expand Down Expand Up @@ -90,44 +91,48 @@ function formatOSDTimeSlot(slotKey as string) as string
if slotMode = "remaining" then return "-" + secondsToHuman(m.top.remainingPositionTime, true)
if slotMode = "endsAt" then return "Ends at " + m.top.videoEndingTime
if slotMode = "time" then return m.top.videoEndingTime
totalTime = m.top.positionTime + m.top.remainingPositionTime
if slotMode = "totalTime" then return secondsToHuman(totalTime, true)
return ""
end function

sub updateOSDTime()
aboveRight = formatOSDTimeSlot("playback.timeAboveRight")
if aboveRight <> ""
m.aboveRight.text = aboveRight
end if
belowRight = formatOSDTimeSlot("playback.timeBelowRight")
if belowRight <> ""
m.belowRight.text = belowRight
end if
aboveLeft = formatOSDTimeSlot("playback.timeAboveLeft")
if aboveLeft <> ""
m.aboveLeft.text = aboveLeft
end if
belowLeft = formatOSDTimeSlot("playback.timeBelowLeft")
if aboveRight <> ""
m.belowLeft.text = belowLeft
end if
end sub

' onProgressPercentageChanged: Handler for changes to m.top.progressPercentage param
'
sub onProgressPercentageChanged()
totalTime = m.top.positionTime + m.top.remainingPositionTime
m.progressBar.width = m.progressBarBackground.width * m.top.progressPercentage

aboveLeft = formatOSDTimeSlot("playback.timeAboveLeft")
aboveRight = formatOSDTimeSlot("playback.timeAboveRight")
if aboveLeft <> "" or aboveRight <> ""
m.videoRemainingTime.text = (aboveLeft <> "" ? aboveLeft : "") + (aboveRight <> "" ? " / " + aboveRight : "")
else
m.videoRemainingTime.text = secondsToHuman(m.top.positionTime, true) + " / " + secondsToHuman(totalTime, true)
end if
updateOSDTime()

' Update circle indicator position (centered on progress, offset by circle radius)
indicatorX = 103 + (m.progressBarBackground.width * m.top.progressPercentage) - 10
m.progressIndicator.translation = [indicatorX, 812]
end sub

sub setVideoEndingTime()
belowRight = formatOSDTimeSlot("playback.timeBelowRight")
if belowRight <> ""
m.videoEndingTime.text = belowRight
else
m.videoEndingTime.text = "Ends at " + m.top.videoEndingTime
end if
end sub

sub updateSeekPreview(totalTime as float)
newPosition = totalTime * m.seekPercentage
m.progressBar.width = m.progressBarBackground.width * m.seekPercentage
updateOSDTime()

indicatorX = 103 + (m.progressBarBackground.width * m.seekPercentage) - 10
m.progressIndicator.translation = [indicatorX, 812]
m.videoRemainingTime.text = secondsToHuman(newPosition, true) + " / " + secondsToHuman(totalTime, true)
m.top.action = "seek," + newPosition.ToStr()
end sub

Expand Down
8 changes: 5 additions & 3 deletions components/video/OSD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
</Group>
<Poster id="progressIndicator" uri="pkg:/images/icons/circle.png" width="20" height="20" translation="[103,812]" loadDisplayMode="scaleToFit" />

<Text id="videoEndingTime" font="font:SmallSystemFont" color="0xffffffFF" horizAlign="right" width="300" translation="[1517,780]" />
<Text id="videoRemainingTime" font="font:MediumSystemFont" color="0xffffffFF" horizAlign="left" width="300" translation="[103,855]" />
<Text id="aboveRight" font="font:SmallSystemFont" color="0xffffffFF" horizAlign="right" width="300" translation="[1517,780]" />
<Text id="belowLeft" font="font:MediumSystemFont" color="0xffffffFF" horizAlign="left" width="300" translation="[103,855]" />
<Text id="belowRight" font="font:MediumSystemFont" color="0xffffffFF" horizAlign="right" width="300" translation="[1517,855]" />
<Text id="aboveLeft" font="font:MediumSystemFont" color="0xffffffFF" horizAlign="left" width="300" translation="[103,780]" />

<!-- Secondary controls (same row as transport, positioned dynamically) -->
<LayoutGroup id="secondaryControls" itemSpacings="[20]" layoutDirection="horiz" horizAlignment="left" translation="[843,920]">
Expand Down Expand Up @@ -101,4 +103,4 @@
<field id="hasFocus" type="boolean" alwaysNotify="true" />
<field id="focusTarget" type="string" value="seekbar" />
</interface>
</component>
</component>
60 changes: 18 additions & 42 deletions settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1975,87 +1975,63 @@
]
},
{
"title": "Media Bar Playback Time Above Left",
"title": "Progress Bar Time Above Left",
"description": "Select information to display above the progress bar on the left side",
"settingName": "playback.timeAboveLeft",
"type": "radio",
"default": "elapsed",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
]
},
{
"title": "Media Bar Playback Time Above Center",
"description": "Select information to display above the progress bar in the center",
"settingName": "playback.timeAboveCenter",
"type": "radio",
"default": "none",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
]
},
{
"title": "Media Bar Playback Time Above Right",
"description": "Select information to display above the progress bar on the right side",
"settingName": "playback.timeAboveRight",
"type": "radio",
"default": "remaining",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
{ "title": "Ends At Time", "id": "endsAt" },
{ "title": "Total Duration", "id": "totalTime" }
]
},
{
"title": "Media Bar Playback Time Below Left",
"title": "Progress Bar Time Below Left",
"description": "Select information to display below the progress bar on the left side",
"settingName": "playback.timeBelowLeft",
"type": "radio",
"default": "none",
"default": "elapsed",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
{ "title": "Ends At Time", "id": "endsAt" },
{ "title": "Total Duration", "id": "totalTime" }
]
},
{
"title": "Media Bar Playback Time Below Center",
"description": "Select information to display below the progress bar in the center",
"settingName": "playback.timeBelowCenter",
"title": "Progress Bar Time Above Right",
"description": "Select information to display above the progress bar on the right side",
"settingName": "playback.timeAboveRight",
"type": "radio",
"default": "none",
"default": "endsAt",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
{ "title": "Ends At Time", "id": "endsAt" },
{ "title": "Total Duration", "id": "totalTime" }
]
},
{
"title": "Media Bar Playback Time Below Right",
"description": "Select information to display below the progress bar on the right side",
"title": "Progress Bar Time Below Right",
"description": "Select information to display below the progress bar after the below left option",
"settingName": "playback.timeBelowRight",
"type": "radio",
"default": "endsAt",
"default": "totalTime",
"options": [
{ "title": "None", "id": "none" },
{ "title": "Current Time", "id": "time" },
{ "title": "Elapsed Time", "id": "elapsed" },
{ "title": "Remaining Time", "id": "remaining" },
{ "title": "Ends At Time", "id": "endsAt" }
{ "title": "Ends At Time", "id": "endsAt" },
{ "title": "Total Duration", "id": "totalTime" }
]
}
]
Expand Down
2 changes: 0 additions & 2 deletions source/utils/settingsSync.bs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ namespace settingsSync
{ pluginKey: "mergeRadarrSonarrCalendars", rokuKey: "calendar.merge", type: "bool" },

{ pluginKey: "playbackTimeAboveLeft", rokuKey: "playback.timeAboveLeft", type: "direct" },
{ pluginKey: "playbackTimeAboveCenter", rokuKey: "playback.timeAboveCenter", type: "direct" },
{ pluginKey: "playbackTimeAboveRight", rokuKey: "playback.timeAboveRight", type: "direct" },
{ pluginKey: "playbackTimeBelowLeft", rokuKey: "playback.timeBelowLeft", type: "direct" },
{ pluginKey: "playbackTimeBelowCenter", rokuKey: "playback.timeBelowCenter", type: "direct" },
{ pluginKey: "playbackTimeBelowRight", rokuKey: "playback.timeBelowRight", type: "direct" },
{ pluginKey: "musicPlaybackTimeDisplay", rokuKey: "playback.musicTimeDisplay", type: "direct" },

Expand Down