Improve Object Names

This commit is contained in:
1hitsong 2022-07-18 20:42:22 -04:00
parent b97d7e2694
commit 78a9e4e1c4
10 changed files with 24 additions and 16 deletions

View File

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<<<<<<< unstable:components/music/MusicAlbumSongList.xml
<component name="MusicAlbumSongList" extends="MarkupList">
=======
<component name="AlbumRow" extends="RowList">
>>>>>>> Improve Object Names:components/music/AlbumRow.xml
<interface>
<field id="MusicArtistAlbumData" type="assocarray" onChange="getData" />
<field id="doneLoading" type="boolean" value="false"/>
</interface>
<script type="text/brightscript" uri="MusicAlbumSongList.brs" />
<script type="text/brightscript" uri="AlbumRow.brs" />
</component>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="MusicArtistAlbumRow" extends="RowList">
<component name="AlbumTrackList" extends="LabelList">
<interface>
<field id="MusicArtistAlbumData" type="assocarray" onChange="getData" />
</interface>
<script type="text/brightscript" uri="MusicArtistAlbumRow.brs" />
<script type="text/brightscript" uri="AlbumTrackList.brs" />
</component>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="MusicAlbumDetails" extends="JFScreen">
<component name="AlbumView" extends="JFScreen">
<children>
<LayoutGroup id="toplevel" layoutDirection="vert" itemSpacings="[-10]" >
<LayoutGroup id="main_group" layoutDirection="horiz" itemSpacings="[15]" >
@ -15,7 +15,11 @@
<LayoutGroup id="infoGroup" layoutDirection="vert" itemSpacings="[15]">
<Label id="overview" wrap="true" height="310" width="1250" ellipsisText=" ... (Press * to read more)" />
<Rectangle id='songListRect' translation="[-30, 0]" width="1260" height="510" color="0x202020ff">
<<<<<<< unstable:components/music/MusicAlbumDetails.xml
<MusicAlbumSongList itemComponentName="SongItem" id="songList" translation="[45, 25]" itemSize="[1170,60]" numRows="7" />
=======
<AlbumTrackList id="songList" translation="[45, 25]" itemSize="[1170,60]" numRows="7" />
>>>>>>> Improve Object Names:components/music/AlbumView.xml
</Rectangle>
</LayoutGroup>
</LayoutGroup>
@ -30,5 +34,5 @@
<field id="instantMixSelected" alias="instantMix.buttonSelected" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="MusicAlbumDetails.brs" />
<script type="text/brightscript" uri="AlbumView.brs" />
</component>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="MusicArtistDetails" extends="JFGroup">
<component name="ArtistView" extends="JFGroup">
<children>
<Poster id="backdrop" opacity=".4" loadDisplayMode="scaleToZoom" width="1920" height="1200" blendColor="#3f3f3f" />
<LayoutGroup id="toplevel" layoutDirection="vert" itemSpacings="[35]" >
@ -8,7 +8,7 @@
<Label id="overview" wrap="true" maxLines="9" width="1250" ellipsisText=" ... (Press * to read more)" />
</LayoutGroup>
<Rectangle id='albumRect' translation="[0, 0]" width="1720" height="325" color="0x00000066">
<MusicArtistAlbumRow id="albums" translation="[35, 10]" rowLabelColor="#999999" rowLabelFont="font:SmallestSystemFont" />
<AlbumRow id="albums" translation="[35, 10]" rowLabelColor="#999999" rowLabelFont="font:SmallestSystemFont" />
</Rectangle>
</LayoutGroup>
</children>
@ -18,5 +18,5 @@
<field id="musicAlbumSelected" alias="albums.rowItemSelected" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="MusicArtistDetails.brs" />
<script type="text/brightscript" uri="ArtistView.brs" />
</component>

View File

@ -159,9 +159,9 @@ sub Main (args as dynamic) as void
else if selectedItem.type = "Photo"
' Nothing to do here, handled in ItemGrid
else if selectedItem.type = "MusicArtist"
group = CreateMusicArtistDetailsGroup(selectedItem.json)
group = CreateArtistView(selectedItem.json)
else if selectedItem.type = "MusicAlbum"
group = CreateMusicAlbumDetailsGroup(selectedItem.json)
group = CreateAlbumView(selectedItem.json)
else if selectedItem.type = "Audio"
group = CreateAudioPlayerGroup([selectedItem.json])
else
@ -189,7 +189,7 @@ sub Main (args as dynamic) as void
' ptr is for [row, col] of selected item... but we only have 1 row
albums = msg.getRoSGNode()
node = albums.musicArtistAlbumData.items[ptr[1]]
group = CreateMusicAlbumDetailsGroup(node)
group = CreateAlbumView(node)
else if isNodeEvent(msg, "playSong")
' User has selected audio they want us to play
selectedIndex = msg.getData()

View File

@ -369,13 +369,13 @@ function CreateSeriesDetailsGroup(series)
end function
' Shows details on selected artist. Bio, image, and list of available albums
function CreateMusicArtistDetailsGroup(musicartist)
function CreateArtistView(musicartist)
musicData = MusicAlbumList(musicartist.id)
' User only has songs under artists
if musicData = invalid or musicData.Items.Count() = 0
' Just songs under artists...
group = CreateObject("roSGNode", "MusicAlbumDetails")
group = CreateObject("roSGNode", "AlbumView")
group.pageContent = ItemMetaData(musicartist.id)
group.albumData = MusicSongList(musicartist.id)
group.observeField("playSong", m.port)
@ -383,7 +383,7 @@ function CreateMusicArtistDetailsGroup(musicartist)
group.observeField("instantMixSelected", m.port)
else
' User has albums under artists
group = CreateObject("roSGNode", "MusicArtistDetails")
group = CreateObject("roSGNode", "ArtistView")
group.pageContent = ItemMetaData(musicartist.id)
group.musicArtistAlbumData = musicData
group.observeField("musicAlbumSelected", m.port)
@ -395,8 +395,8 @@ function CreateMusicArtistDetailsGroup(musicartist)
end function
' Shows details on selected album. Description text, image, and list of available songs
function CreateMusicAlbumDetailsGroup(album)
group = CreateObject("roSGNode", "MusicAlbumDetails")
function CreateAlbumView(album)
group = CreateObject("roSGNode", "AlbumView")
m.global.sceneManager.callFunc("pushScene", group)
group.pageContent = ItemMetaData(album.id)