diff --git a/components/video/OSD.bs b/components/video/OSD.bs index 7e61d0f58..f5fdecd00 100644 --- a/components/video/OSD.bs +++ b/components/video/OSD.bs @@ -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") @@ -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") @@ -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 diff --git a/components/video/OSD.xml b/components/video/OSD.xml index 7408ddf9c..2ba9d369e 100644 --- a/components/video/OSD.xml +++ b/components/video/OSD.xml @@ -30,8 +30,10 @@ - - + + + + @@ -101,4 +103,4 @@ - \ No newline at end of file + diff --git a/settings/settings.json b/settings/settings.json index 83f73a6ba..120b37b19 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -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" } ] } ] diff --git a/source/utils/settingsSync.bs b/source/utils/settingsSync.bs index 36b9541cb..19fe4693b 100644 --- a/source/utils/settingsSync.bs +++ b/source/utils/settingsSync.bs @@ -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" },