Skip to content

swap out bookmark updating for playStart updating #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sub onContentSet()
' contentSetLine is field to check if text is set to label
setLabelDataOrHide(m.line1, content.shortDescriptionLine1)
setLabelDataOrHide(m.line2, content.shortDescriptionLine2)
setDurationBarData(content.length, content.bookmarkposition, content.hideItemDurationBar <> true)
setDurationBarData(content.length, content.playStart, content.hideItemDurationBar <> true)
updateLabelsLayout()
end if
end sub
Expand Down Expand Up @@ -103,10 +103,10 @@ sub setLabelDataOrHide(label as Object, text as String)
end if
end sub

sub setDurationBarData(length as Integer,BookmarkPosition as Integer, showDurationBar as Boolean)
if showDurationBar and length > 0 and BookmarkPosition > 0 and bookmarkPosition < length
sub setDurationBarData(length as Integer, playStart as Integer, showDurationBar as Boolean)
if showDurationBar and length > 0 and playStart > 0 and playStart < length
m.durationBar.length = length
m.durationBar.BookmarkPosition = BookmarkPosition
m.durationBar.playStart = playStart
m.durationBar.visible = true
m.durationBar.scale = [1,1]
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Sub OnBackgroundColorChanged()
end Sub

'update progress on duration bar
Sub UpdateBookmark()
if m.top.length > 0 AND m.top.length > m.top.BookmarkPosition
progress = Int(m.top.BookmarkPosition / m.top.length * 100)
Sub UpdatePlayStart()
if m.top.length > 0 AND m.top.length > m.top.playStart
progress = Int(m.top.playStart / m.top.length * 100)
if progress > 100
progress = 100
else if progress < 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<!-- preffered color of progress on duration bar -->
<field id="progressColor" type="color" alias="progress.color" />
<!-- current playback position -->
<field id="length" type="int" onChange="UpdateBookmark" />
<field id="length" type="int" onChange="UpdatePlayStart" />
<!-- stored bookmark playback position -->
<field id="bookmarkPosition" type="int" onChange="UpdateBookmark" />
<field id="playStart" type="int" onChange="UpdatePlayStart" />
</interface>

<script type="text/brightscript" uri= "DurationBar.brs" />
Expand Down