2017-02-17, 02:41
What the title says, basically. What's the best way, if there is a way, to fill a list control with the currently playing album while on the home screen?
<content>
<item>
<label>$INFO[MusicPlayer.Offset(1).Artist]: $INFO[MusicPlayer.Offset(1).Title]</label>
<property name="Number">1.</property>
<onclick>Playlist.PlayOffset(1)</onclick>
<visible>!String.IsEmpty(MusicPlayer.Offset(1).Title)</visible>
</item>
<item>
<label>$INFO[MusicPlayer.Offset(2).Artist]: $INFO[MusicPlayer.Offset(2).Title]</label>
<property name="Number">2.</property>
<onclick>Playlist.PlayOffset(2)</onclick>
<visible>!String.IsEmpty(MusicPlayer.Offset(2).Title)</visible>
</item>
...
...
</content>
(2017-02-17, 12:49)Mike_Doc Wrote: I do the same Gade but isn't that for the 'Next:' list rather than a full album list which djh is after?
<item>
<label>$INFO[MusicPlayer.offset(-1).Title]</label>
<label2>$INFO[MusicPlayer.offset(-1).Duration]</label2>
<property name="TrackNumber">$INFO[MusicPlayer.offset(-1).PlaylistPosition]</property>
<onclick>Playlist.PlayOffset(-1)</onclick>
<visible>MusicPlayer.offset(-1).Exists</visible>
</item>
<item>
<label>$INFO[MusicPlayer.offset(0).Title]</label>
<label2>$INFO[MusicPlayer.offset(0).Duration]</label2>
<property name="TrackNumber">$INFO[MusicPlayer.offset(0).PlaylistPosition]</property>
<property name="IsPlaying">1</property>
<onclick>Playlist.PlayOffset(0)</onclick>
<visible>MusicPlayer.offset(0).Exists</visible>
</item>
<item>
<label>$INFO[MusicPlayer.offset(1).Title]</label>
<label2>$INFO[MusicPlayer.offset(1).Duration]</label2>
<property name="TrackNumber">$INFO[MusicPlayer.offset(1).PlaylistPosition]</property>
<onclick>Playlist.PlayOffset(1)</onclick>
<visible>MusicPlayer.offset(1).Exists</visible>
</item>
<visible>!String.IsEmpty(MusicPlayer.Offset(1).Title) + String.IsEqual(MusicPlayer.Album,MusicPlayer.Offset(1).Album)</visible>
<visible>!String.IsEmpty(MusicPlayer.Offset(2).Title) + String.IsEqual(MusicPlayer.Album,MusicPlayer.Offset(2).Album)</visible>
<visible>!String.IsEmpty(MusicPlayer.Offset(-2).Title) + String.IsEqual(MusicPlayer.Album,MusicPlayer.Offset(-2).Album)</visible>
<item>
<label>$INFO[MusicPlayer.Offset(2).Artist]: $INFO[MusicPlayer.Offset(2).Title]</label>
<label2>$LOCALIZE[558]: $INFO[MusicPlayer.Album]</label2>
<onclick>Playlist.PlayOffset(2)</onclick>
<visible>!String.IsEmpty(MusicPlayer.Offset(2).Title) + String.IsEqual(MusicPlayer.Album,MusicPlayer.Offset(2).Album)</visible>
</item>
(2017-02-17, 15:25)djh_ Wrote: Wouldn't MusicPlayer.Position() be a better infolabel to use if you were trying to display the album tracklist?
<content target="music">playlistmusic://</content>
(2017-02-17, 15:43)jurialmunkey Wrote:(2017-02-17, 15:25)djh_ Wrote: Wouldn't MusicPlayer.Position() be a better infolabel to use if you were trying to display the album tracklist?
Yeah if you just wanted to display it. I wanted something clickable where you could switch to a different track in the playlist and the only command I could find to do that was Playlist.PlayOffset so needed the offset instead.
<control type="panel" id="777">
<top>0</top>
<width>540</width>
<height>500</height>
<onleft>149</onleft>
<onright>149</onright>
<orientation>vertical</orientation>
<content sortby="track" sortorder="ascending">$INFO[Player.FolderPath]</content>
<itemlayout height="32" width="540">
<control type="label">
<left>10</left>
<height>30</height>
<width>540</width>
<aligny>center</aligny>
<label>$INFO[ListItem.Label]</label>
<font>Font_button</font>
<visible>String.Contains(ListItem.Label,.mp3)</visible>
</control>
</itemlayout>
<focusedlayout height="32" width="540">
<control type="image">
<left>10</left>
<top>0</top>
<width>542</width>
<height>32</height>
<texture>settings_button_focus.png</texture>
<visible>String.Contains(ListItem.Label,.mp3)+Control.HasFocus(777)</visible>
</control>
<control type="label">
<left>10</left>
<height>30</height>
<width>540</width>
<aligny>center</aligny>
<label>$INFO[ListItem.Label]</label>
<font>Font_button</font>
<visible>String.Contains(ListItem.Label,.mp3)</visible>
</control>
</focusedlayout>
</control>
(2017-02-17, 15:47)jurialmunkey Wrote: Or can't believe I didn't think of this before. Just use a list control filled with dynamic content
Code:<content target="music">playlistmusic://</content>
EDIT: Although it seems like if you click the list it will play the song but clear the playlist (i.e. the playlist becomes only that song). Knew there must've been a reason I hadn't done this before. Although its a quick way to display the now playing tracklist....