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
314 changes: 225 additions & 89 deletions components/movies/MovieDetails.bs

Large diffs are not rendered by default.

16 changes: 2 additions & 14 deletions components/movies/MovieDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<LayoutGroup id="infoGroup" layoutDirection="horiz" horizAlignment="left" itemSpacings="[50]">
<LayoutGroup layoutDirection="vert" itemSpacings="[30]">
<Text id="overview" wrap="true" maxLines="8" width="1000" />
<Text id="overview" wrap="true" maxLines="7" width="1000" />
<Text
id="director"
font="font:SmallestSystemFont"
Expand All @@ -35,19 +35,7 @@
width="1000"
ellipsisText="..." />

<LayoutGroup layoutDirection="vert" itemSpacings="[0]">
<LayoutGroup layoutDirection="horiz" horizAlignment="left">
<Text id="rotationWarning" font="font:smallestboldSystemFont" vertAlign="top" color="#eeeeee" />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" horizAlignment="left">
<ScrollingText id="video_codec" vertAlign="bottom" height="39" maxwidth="990" font="font:SmallestSystemFont" color="#aaaaaa" />
<Text id="video_codec_count" font="font:smallestSystemFont" vertAlign="top" color="#aaaaaa" />
</LayoutGroup>
<LayoutGroup layoutDirection="horiz" horizAlignment="left">
<ScrollingText id="audio_codec" vertAlign="bottom" height="39" maxwidth="990" font="font:SmallestSystemFont" color="#aaaaaa" />
<Text id="audio_codec_count" font="font:smallestSystemFont" vertAlign="top" color="#aaaaaa" />
</LayoutGroup>
</LayoutGroup>
<MovieDetailsStreamSummary id="streamSummary" />
</LayoutGroup>

<MarkupList
Expand Down
50 changes: 50 additions & 0 deletions components/movies/MovieDetailsStreamSummary.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import "pkg:/source/utils/misc.bs"

sub init()
m.rotationWarningNode = m.top.findNode("rotationWarning")
m.videoRowNode = m.top.findNode("videoStreamSummaryRow")
m.audioRowNode = m.top.findNode("audioStreamSummaryRow")
m.subtitleRowNode = m.top.findNode("subtitleStreamSummaryRow")
end sub

sub onChangeRotationWarning()
if isValid(m.rotationWarningNode)
m.rotationWarningNode.text = m.top.rotationWarning
end if
end sub

sub onChangeSelectedVideoStreamTitle()
if isValid(m.videoRowNode)
m.videoRowNode.title = m.top.selectedVideoStreamTitle
end if
end sub

sub onChangeVideoStreamCount()
if isValid(m.videoRowNode)
m.videoRowNode.count = m.top.videoStreamCount
end if
end sub

sub onChangeSelectedAudioStreamTitle()
if isValid(m.audioRowNode)
m.audioRowNode.title = m.top.selectedAudioStreamTitle
end if
end sub

sub onChangeAudioStreamCount()
if isValid(m.audioRowNode)
m.audioRowNode.count = m.top.audioStreamCount
end if
end sub

sub onChangeSelectedSubtitleStreamTitle()
if isValid(m.subtitleRowNode)
m.subtitleRowNode.title = m.top.selectedSubtitleStreamTitle
end if
end sub

sub onChangeSubtitleStreamCount()
if isValid(m.subtitleRowNode)
m.subtitleRowNode.count = m.top.subtitleStreamCount
end if
end sub
22 changes: 22 additions & 0 deletions components/movies/MovieDetailsStreamSummary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="MovieDetailsStreamSummary" extends="Group">
<interface>
<field id="rotationWarning" type="string" onChange="onChangeRotationWarning" />
<field id="selectedVideoStreamTitle" type="string" onChange="onChangeSelectedVideoStreamTitle" />
<field id="videoStreamCount" type="integer" onChange="onChangeVideoStreamCount" />
<field id="selectedAudioStreamTitle" type="string" onChange="onChangeSelectedAudioStreamTitle" />
<field id="audioStreamCount" type="integer" onChange="onChangeAudioStreamCount" />
<field id="selectedSubtitleStreamTitle" type="string" onChange="onChangeSelectedSubtitleStreamTitle" />
<field id="subtitleStreamCount" type="integer" onChange="onChangeSubtitleStreamCount" />
</interface>
<children>
<LayoutGroup layoutDirection="vert" itemSpacings="[0]">
<LayoutGroup layoutDirection="horiz" horizAlignment="left">
<Text id="rotationWarning" font="font:smallestboldSystemFont" vertAlign="top" color="#eeeeee" />
</LayoutGroup>
<MovieDetailsStreamSummaryRow id="videoStreamSummaryRow" streamType="Video" />
<MovieDetailsStreamSummaryRow id="audioStreamSummaryRow" streamType="Audio" />
<MovieDetailsStreamSummaryRow id="subtitleStreamSummaryRow" streamType="Subtitles" />
</LayoutGroup>
</children>
</component>
21 changes: 21 additions & 0 deletions components/movies/MovieDetailsStreamSummaryRow.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "pkg:/source/utils/misc.bs"

sub init()
m.titleNode = m.top.findNode("title")
m.countNode = m.top.findNode("count")
end sub

sub onChangeTitle()
if isValid(m.titleNode)
streamTitle = m.top.title
m.titleNode.text = isValid(streamTitle) ? tr(m.top.streamType) + ": " + streamTitle : ""
end if
end sub

sub onChangeCount()
if isValid(m.countNode)
count = m.top.count
additionalCount = count - 1
m.countNode.text = additionalCount > 0 ? "+" + stri(additionalCount).trim() : ""
end if
end sub
14 changes: 14 additions & 0 deletions components/movies/MovieDetailsStreamSummaryRow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="MovieDetailsStreamSummaryRow" extends="Group">
<interface>
<field id="streamType" type="string" />
<field id="title" type="string" onChange="onChangeTitle" />
<field id="count" type="integer" onChange="onChangeCount" />
</interface>
<children>
<LayoutGroup id="container" layoutDirection="horiz" horizAlignment="left">
<ScrollingText id="title" vertAlign="bottom" height="39" maxwidth="990" font="font:SmallestSystemFont" color="#aaaaaa" />
<Text id="count" font="font:smallestSystemFont" vertAlign="top" color="#aaaaaa" />
</LayoutGroup>
</children>
</component>
1 change: 1 addition & 0 deletions components/movies/MovieOptions.bs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ sub optionsSet()
entry.StreamIndex = subtitle.StreamIndex
if isValid(subtitle.Selected) and subtitle.Selected
selectedSubtitleIndex = index
m.global.queueManager.callFunc("setPreferredSubtitleTrack", subtitle)
entry.selected = true
end if
index = index + 1
Expand Down
2 changes: 2 additions & 0 deletions source/enums/MediaStreamType.bs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enum MediaStreamType
VIDEO = "video"
AUDIO = "Audio"
SUBTITLE = "Subtitle"
end enum