本文整理汇总了Python中settings.Settings.isLyricsInfoLayout方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isLyricsInfoLayout方法的具体用法?Python Settings.isLyricsInfoLayout怎么用?Python Settings.isLyricsInfoLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.isLyricsInfoLayout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateDisplay
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isLyricsInfoLayout [as 别名]
def updateDisplay(self, eventDetails=None):
SonosControllerWindow.updateDisplay(self, eventDetails)
# Now we have updated the track currently playing read the details out and
# set the windows properties for ArtistSlideshow
# Only update if the track has changed
if self.currentTrack not in [None, '']:
# Check if we want to show lyrics for the track, although not part of the
# artist slideshow feature (it is part of script.cu.lrclyrics) we treat
# this in a similar manner, first set the values
lyrics = None
if Settings.isLyricsInfoLayout():
lyrics = Lyrics(self.currentTrack, self.getControl(SonosArtistSlideshow.LYRICS), self.lyricListLinesCount)
lyrics.setLyricRequest()
# Artist Slideshow will set these properties for us
xbmcgui.Window(self.windowId).setProperty('CURRENTARTIST', self.currentTrack['artist'])
xbmcgui.Window(self.windowId).setProperty('CURRENTTITLE', self.currentTrack['title'])
xbmcgui.Window(self.windowId).setProperty('CURRENTALBUM', self.currentTrack['album'])
# Check if lyrics are enabled, and set the test if they are
if lyrics is not None:
self.currentTrack = lyrics.populateLyrics()
lyrics.refresh()
del lyrics
示例2: show
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isLyricsInfoLayout [as 别名]
def show(self):
log("SonosArtistSlideshow: About to show window")
# First show the window
SonosControllerWindow.show(self)
# Work out how many lines there are on the screen to show lyrics
if Settings.isLyricsInfoLayout():
lyricControl = self.getControl(SonosArtistSlideshow.LYRICS)
if lyricControl is not None:
listitem = xbmcgui.ListItem()
while xbmc.getInfoLabel('Container(%s).NumPages' % SonosArtistSlideshow.LYRICS) != '2':
lyricControl.addItem(listitem)
xbmc.sleep(10)
self.lyricListLinesCount = lyricControl.size() - 1
lyricControl.reset()
self.windowId = xbmcgui.getCurrentWindowId()
log("SonosArtistSlideshow: After show window %s" % self.windowId)
# Set the sonos icon
if not Settings.hideSonosLogo():
xbmcgui.Window(self.windowId).setProperty('SonosAddonIcon', __icon__)
# Set option to make the artist slideshow full screen
if Settings.fullScreenArtistSlideshow():
xbmcgui.Window(self.windowId).setProperty('SonosAddonSlideshowFullscreen', "true")
# Now make sure that Artist Slideshow is running
self.athread = threading.Thread(target=self.runArtistSlideshow)
self.athread.setDaemon(True)
self.athread.start()
log("SonosArtistSlideshow: ArtistSlideShow thread started")
示例3: refresh
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isLyricsInfoLayout [as 别名]
def refresh(self):
# Check if there is anything to do for lyrics
if not Settings.isLyricsInfoLayout() or (self.listControl is None):
return
if not self.hasLyrics():
return
timeLines = self.track['lyrics']
cur_time = self.track['position_seconds']
nums = self.listControl.size()
pos = self.listControl.getSelectedPosition()
# Make sure that we don't exceed the index
if pos >= len(timeLines):
log("Lyrics: Current Position exceeds number of entries")
return
# Check if we need to roll the lyrics backwards
if (cur_time < timeLines[pos][0]):
while ((pos > 0) and (timeLines[pos - 1][0] > cur_time)):
pos = pos - 1
else:
# Going forwards
while ((pos < nums - 1) and (timeLines[pos + 1][0] < cur_time)):
pos = pos + 1
# Now we have the correct position, but we want that to sit in the
# middle of the dialog, so add on the offset
if (pos + self.lyricListOffset > nums - 1):
# As it's near the end - set the focus to the last one
self.listControl.selectItem(nums - 1)
else:
self.listControl.selectItem(pos + self.lyricListOffset)
self.listControl.selectItem(pos)
示例4: setLyricRequest
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isLyricsInfoLayout [as 别名]
def setLyricRequest(self):
# If we are showing a screen that needs lyrics and we do not have any at the moment
# then set the properties so that CU LRC looks for them
if Settings.isLyricsInfoLayout() and not self.hasLyrics():
log("Lyrics: Setting culrc.artist(%s) culrc.track(%s)" % (self.track['artist'], self.track['title']))
xbmcgui.Window(10000).setProperty('culrc.manual', 'true')
xbmcgui.Window(10000).setProperty('culrc.artist', self.track['artist'])
xbmcgui.Window(10000).setProperty('culrc.track', self.track['title'])
示例5: populateLyrics
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isLyricsInfoLayout [as 别名]
def populateLyrics(self):
# Check if lyrics are enabled, and set the test if they are
if Settings.isLyricsInfoLayout() and not self.hasLyrics():
lyricTxt = xbmcgui.Window(10000).getProperty('culrc.lyrics')
if lyricTxt not in [None, '']:
log("Lyrics: Lyrics for artist(%s) track(%s) \n%s" % (self.track['artist'], self.track['title'], lyricTxt))
# Now persist the lyrics into the currentTrack and clear the current settings
self.track['lyrics'] = self._parserLyrics(lyricTxt, self.track['duration_seconds'])
# Clear the lyrics that were stored so that the lyrics addon does not keep looking
self.clearLyricRequest()
# Now update the screen
self._populateListView(self.track['lyrics'])
else:
# Disable the lyric display
self._screenLyricsVisible(False)
return self.track