jf-roku/docs/api/components_music_ArtistView.brs.html

525 lines
22 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>jellyfin-roku api docs Source: components/music/ArtistView.brs</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.dark.css">
<link type="text/css" rel="stylesheet" href="styles/site.darkly.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">jellyfin-roku api docs</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
<ul class="dropdown-menu ">
2023-10-27 12:27:26 +00:00
<li><a href="module-AlbumData.html">AlbumData</a></li><li><a href="module-AlbumGrid.html">AlbumGrid</a></li><li><a href="module-AlbumTrackList.html">AlbumTrackList</a></li><li><a href="module-AlbumView.html">AlbumView</a></li><li><a href="module-Alpha.html">Alpha</a></li><li><a href="module-ArtistView.html">ArtistView</a></li><li><a href="module-AudioPlayer.html">AudioPlayer</a></li><li><a href="module-AudioPlayerView.html">AudioPlayerView</a></li><li><a href="module-AudioTrackListItem.html">AudioTrackListItem</a></li><li><a href="module-ButtonGroupHoriz.html">ButtonGroupHoriz</a></li><li><a href="module-ChannelData.html">ChannelData</a></li><li><a href="module-CollectionData.html">CollectionData</a></li><li><a href="module-ConfigData.html">ConfigData</a></li><li><a href="module-ConfigItem.html">ConfigItem</a></li><li><a href="module-ConfigList.html">ConfigList</a></li><li><a href="module-ExtrasItem.html">ExtrasItem</a></li><li><a href="module-ExtrasRowList.html">ExtrasRowList</a></li><li><a href="module-FavoriteItemsTask.html">FavoriteItemsTask</a></li><li><a href="module-FolderData.html">FolderData</a></li><li><a href="module-GetFiltersTask.html">GetFiltersTask</a></li><li><a href="module-GetNextEpisodeTask.html">GetNextEpisodeTask</a></li><li><a href="module-GetPlaybackInfoTask.html">GetPlaybackInfoTask</a></li><li><a href="module-GetShuffleEpisodesTask.html">GetShuffleEpisodesTask</a></li><li><a href="module-GridItem.html">GridItem</a></li><li><a href="module-GridItemSmall.html">GridItemSmall</a></li><li><a href="module-Home.html">Home</a></li><li><a href="module-HomeData.html">HomeData</a></li><li><a href="module-HomeItem.html">HomeItem</a></li><li><a href="module-HomeRows.html">HomeRows</a></li><li><a href="module-IconButton.html">IconButton</a></li><li><a href="module-Image.html">Image</a></li><li><a href="module-ImageData.html">ImageData</a></li><li><a href="module-ItemGrid.html">ItemGrid</a></li><li><a href="module-ItemGridOptions.html">ItemGridOptions</a></li><li><a href="module-Items.html">Items</a></li><li><a href="module-JFButton.html">JFButton</a></li><li><a href="module-JFButtons.html">JFButtons</a></li><li><a href="module-JFGroup.html">JFGroup</a></li><li><a href="module-JFMessageDialog.html">JFMessageDialog</a></li><li><a href="module-JFOverhang.html">JFOverhang</a></li><li><a href="module-JFScene.html">JFScene</a></li><li><a href="module-JFScreen.html">JFScreen</a></li><li><a href="module-JFServer.html">JFServer</a></li><li><a href="module-JFVideo.html">JFVideo</a></li><li><a href="module-ListPoster.html">ListPoster</a></li><li><a href="module-LoadChannelsTask.html">LoadChannelsTask</a></li><li><a href="module-LoadItemsTask.html">LoadItemsTask</a></li><li><a href="module-LoadItemsTask2.html">LoadItemsTask2</a></li><li><a href="module-LoadPhotoTask.html">LoadPhotoTask</a></li><li><a href="module-LoadProgramDetailsTask.html">LoadProgramDetailsTask</a></li><li><a href="module-LoadScreenSaverTimeoutTask.html">LoadScreenSaverTimeoutTask</a></li><li><a href="module-LoadSheduleTask.html">LoadSheduleTask</a></li><li><a href="module-LoadVideoContentTask.html">LoadVideoContentTask</a></li><li><a href="module-LoginScene.html">LoginScene</a></li><li><a href="module-Main.html">Main</a></li><li><a href="module-MovieData.html">MovieData</a></li><li><a href="module-MovieDetails.html">MovieDetails</a></li><li><a href="module-MovieLibraryView.html">MovieLibraryView</a></li><li><a href="module-MovieOptions.html">MovieOptions</a></li><li><a href="module-MusicAlbumData.html">MusicAlbumData</a></li><li><a href="module-MusicAlbumSongListData.html">MusicAlbumSongListData</a></li><li><a href="module-MusicArtistData.html">MusicArtistData</a></li><li><a href="module-MusicArtistGridItem.html">MusicArtistGridItem</a></li><li><a href="module-MusicLibraryView.html">MusicLibraryView</a></li><li><a href="module-MusicSongData.html">MusicSongData</a></li><li><a href="module-OptionNode.html">OptionNode</a></li><li><a href="module-OptionsButton.html">OptionsButton</a></li><li><a href="module-OptionsData.html">OptionsData</a></li><li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-12">
<div id="main">
<h1 class="page-title">Source: components/music/ArtistView.brs</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">import "pkg:/source/utils/misc.brs"
2023-10-06 03:18:36 +00:00
sub init()
m.top.optionsAvailable = false
setupMainNode()
setupButtons()
m.remoteButtonsActive = true
m.albumHeader = m.top.findNode("albumHeader")
m.albumHeader.text = tr("Albums")
m.appearsOnHeader = m.top.findNode("appearsOnHeader")
m.appearsOnHeader.text = tr("AppearsOn")
m.appearsOn = m.top.findNode("appearsOn")
m.appearsOn.observeField("escape", "onAppearsOnEscape")
m.appearsOn.observeField("MusicArtistAlbumData", "onAppearsOnData")
m.albums = m.top.findNode("albums")
m.albums.observeField("escape", "onAlbumsEscape")
m.albums.observeField("MusicArtistAlbumData", "onAlbumsData")
m.pageLoadAnimation = m.top.findNode("pageLoad")
m.pageLoadAnimation.control = "start"
m.sectionNavigation = m.top.findNode("sectionNavigation")
m.sectionNavigation.observeField("escape", "onSectionNavigationEscape")
m.sectionNavigation.observeField("selected", "onSectionNavigationSelected")
m.sectionScroller = m.top.findNode("sectionScroller")
m.sectionScroller.observeField("displayedIndex", "onSectionScrollerChange")
m.overhang = m.top.getScene().findNode("overhang")
' Load background image
m.LoadBackdropImageTask = CreateObject("roSGNode", "LoadItemsTask")
m.LoadBackdropImageTask.itemsToLoad = "backdropImage"
m.backDrop = m.top.findNode("backdrop")
m.artistImage = m.top.findNode("artistImage")
m.dscr = m.top.findNode("overview")
m.dscr.observeField("isTextEllipsized", "onEllipsisChanged")
createDialogPallete()
end sub
sub onAlbumsData()
' We have no album data
if m.albums.MusicArtistAlbumData.TotalRecordCount = 0
m.sectionScroller.removeChild(m.top.findNode("albumsSlide"))
m.sectionNavigation.removeChild(m.top.findNode("albumsLink"))
m.top.findNode("appearsOnSlide").callFunc("scrollUpToOnDeck")
end if
end sub
sub onAppearsOnData()
' We have no appears on data
if m.appearsOn.MusicArtistAlbumData.TotalRecordCount = 0
m.sectionScroller.removeChild(m.top.findNode("appearsOnSlide"))
m.sectionNavigation.removeChild(m.top.findNode("appearsOnLink"))
end if
end sub
sub onSectionScrollerChange()
m.overhang.isVisible = (m.sectionScroller.displayedIndex = 0)
end sub
sub OnScreenShown()
m.sectionScroller.focus = true
if m.sectionScroller.displayedIndex = 0
m.previouslySelectedButtonIndex = m.top.selectedButtonIndex
m.top.selectedButtonIndex = 0
m.buttonGrp.setFocus(true)
else
m.overhang.opacity = "0"
m.overhang.isVisible = false
m.overhang.opacity = "1"
end if
end sub
sub OnScreenHidden()
if not m.overhang.isVisible
m.overhang.disableMoveAnimation = true
m.overhang.isVisible = true
m.overhang.disableMoveAnimation = false
m.overhang.opacity = "1"
end if
end sub
sub onAlbumsEscape()
if m.albums.escape = "up"
m.sectionNavigation.selected = m.sectionScroller.displayedIndex - 1
else if m.albums.escape = "left"
m.sectionNavigation.setFocus(true)
else if m.albums.escape = "down"
if m.sectionScroller.displayedIndex + 1 &lt; m.sectionNavigation.getChildCount()
m.sectionNavigation.selected = m.sectionScroller.displayedIndex + 1
end if
end if
end sub
sub onAppearsOnEscape()
if m.appearsOn.escape = "up"
m.sectionNavigation.selected = m.sectionScroller.displayedIndex - 1
else if m.appearsOn.escape = "left"
m.sectionNavigation.setFocus(true)
end if
end sub
' Setup playback buttons, default to Play button selected
sub setupButtons()
m.buttonGrp = m.top.findNode("buttons")
m.buttonCount = m.buttonGrp.getChildCount()
m.playButton = m.top.findNode("play")
m.previouslySelectedButtonIndex = -1
m.top.observeField("selectedButtonIndex", "onButtonSelectedChange")
m.top.selectedButtonIndex = 0
end sub
' Event handler when user selected a different playback button
sub onButtonSelectedChange()
' Change previously selected button back to default image
if m.previouslySelectedButtonIndex > -1
previousSelectedButton = m.buttonGrp.getChild(m.previouslySelectedButtonIndex)
previousSelectedButton.focus = false
end if
' Change selected button image to selected image
selectedButton = m.buttonGrp.getChild(m.top.selectedButtonIndex)
selectedButton.focus = true
end sub
sub setupMainNode()
m.main = m.top.findNode("toplevel")
m.main.translation = [120, 175]
end sub
' Event fired when page data is loaded
sub pageContentChanged()
item = m.top.pageContent
' Use metadata to load backdrop image
m.LoadBackdropImageTask.itemId = item.json.id
m.LoadBackdropImageTask.observeField("content", "onBackdropImageLoaded")
m.LoadBackdropImageTask.control = "RUN"
' Populate scene data
setScreenTitle(item.json)
setPosterImage(item.posterURL)
end sub
sub setScreenTitle(json)
if isValid(json)
m.top.overhangTitle = json.name
end if
end sub
sub setPosterImage(posterURL)
if not isValid(posterURL) or posterURL = ""
posterURL = "pkg:/images/missingArtist.png"
end if
m.artistImage.uri = posterURL
end sub
sub onBackdropImageLoaded()
data = m.LoadBackdropImageTask.content[0]
m.LoadBackdropImageTask.unobserveField("content")
if isValid(data) and data &lt;> ""
setBackdropImage(data)
end if
end sub
' Add backdrop image to screen
sub setBackdropImage(data)
if isValid(data)
if m.backDrop.uri &lt;> data
m.backDrop.uri = data
end if
end if
end sub
' Event fired when page data is loaded
sub artistOverviewChanged()
overviewContent = m.top.artistOverview
if isValid(overviewContent)
setFieldTextValue("overview", overviewContent)
end if
end sub
sub onEllipsisChanged()
if m.dscr.isTextEllipsized
dscrShowFocus()
end if
end sub
sub onSectionNavigationEscape()
if m.sectionNavigation.escape = "right"
m.sectionNavigation.setFocus(false)
m.remoteButtonsActive = false
m.sectionScroller.focus = true
end if
end sub
sub onSectionNavigationSelected()
m.sectionScroller.displayedIndex = m.sectionNavigation.selected
end sub
sub dscrShowFocus()
if m.dscr.isTextEllipsized
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
end if
end sub
sub createFullDscrDlg()
dlg = CreateObject("roSGNode", "OverviewDialog")
dlg.Title = tr("Press 'Back' to Close")
dlg.width = 1290
dlg.palette = m.dlgPalette
dlg.overview = [m.dscr.text]
m.fullDscrDlg = dlg
m.top.getScene().dialog = dlg
border = createObject("roSGNode", "Poster")
border.uri = "pkg:/images/hd_focul_9.png"
border.blendColor = "#c9c9c9ff"
border.width = dlg.width + 6
border.height = dlg.height + 6
border.translation = [dlg.translation[0] - 3, dlg.translation[1] - 3]
border.visible = true
end sub
sub createDialogPallete()
m.dlgPalette = createObject("roSGNode", "RSGPalette")
m.dlgPalette.colors = {
DialogBackgroundColor: "0x262828FF",
DialogItemColor: "0x00EF00FF",
DialogTextColor: "0xb0b0b0FF",
DialogFocusColor: "0xcececeFF",
DialogFocusItemColor: "0x202020FF",
DialogSecondaryTextColor: "0xf8f8f8ff",
DialogSecondaryItemColor: "0xcc7ecc4D",
DialogInputFieldColor: "0x80FF8080",
DialogKeyboardColor: "0x80FF804D",
DialogFootprintColor: "0x80FF804D"
}
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if m.buttonGrp.isInFocusChain()
if key = "OK"
if press
selectedButton = m.buttonGrp.getChild(m.top.selectedButtonIndex)
selectedButton.selected = not selectedButton.selected
return true
end if
end if
if key = "left"
if m.top.selectedButtonIndex > 0
m.previouslySelectedButtonIndex = m.top.selectedButtonIndex
m.top.selectedButtonIndex = m.top.selectedButtonIndex - 1
return true
end if
if press
selectedButton = m.buttonGrp.getChild(m.top.selectedButtonIndex)
selectedButton.focus = false
m.sectionNavigation.setFocus(true)
return true
end if
return false
end if
if key = "right"
if m.top.pageContent.count() = 1 then return false
if m.buttonGrp.getChild(m.top.selectedButtonIndex).escape = "right"
m.buttonGrp.getChild(m.top.selectedButtonIndex).escape = ""
m.previouslySelectedButtonIndex = m.top.selectedButtonIndex
if m.top.selectedButtonIndex &lt; m.buttonCount - 1
m.top.selectedButtonIndex = m.top.selectedButtonIndex + 1
end if
return true
end if
end if
if key = "down"
if m.sectionNavigation.getChildCount() > 1
selectedButton = m.buttonGrp.getChild(m.top.selectedButtonIndex)
selectedButton.focus = false
m.top.selectedButtonIndex = 0
m.sectionNavigation.selected = m.sectionScroller.displayedIndex + 1
end if
end if
end if
if not press then return false
if key = "options"
if m.dscr.isTextEllipsized
createFullDscrDlg()
return true
end if
end if
return false
end function
</pre>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="jsdoc-message">Source code: <a href="https://github.com/jellyfin/jellyfin-roku">https://github.com/jellyfin/jellyfin-roku</a></span><span class="jsdoc-message">Jellyfin Roku Development Forum: <a href="https://forum.jellyfin.org/f-roku-development">https://forum.jellyfin.org/f-roku-development</a></span>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a>
2023-10-28 01:54:11 +00:00
on Oct 28th 2023
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>