本文整理匯總了Python中Playlist.Playlist.getgenre方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.getgenre方法的具體用法?Python Playlist.getgenre怎麽用?Python Playlist.getgenre使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.getgenre方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import getgenre [as 別名]
class Channel:
def __init__(self):
self.Playlist = Playlist()
self.name = ''
self.playlistPosition = 0
self.showTimeOffset = 0
self.lastAccessTime = 0
self.totalTimePlayed = 0
self.fileName = ''
self.isPaused = False
self.isValid = False
self.isRandom = False
self.mode = 0
self.ruleList = []
self.channelNumber = 0
self.isSetup = False
def log(self, msg, level = xbmc.LOGDEBUG):
log('Channel: ' + msg, level)
def setPlaylist(self, filename):
return self.Playlist.load(filename)
def loadRules(self, channel):
del self.ruleList[:]
listrules = RulesList()
self.channelNumber = channel
try:
rulecount = int(ADDON_SETTINGS.getSetting('Channel_' + str(channel) + '_rulecount'))
for i in range(rulecount):
ruleid = int(ADDON_SETTINGS.getSetting('Channel_' + str(channel) + '_rule_' + str(i + 1) + '_id'))
for rule in listrules.ruleList:
if rule.getId() == ruleid:
self.ruleList.append(rule.copy())
for x in range(rule.getOptionCount()):
self.ruleList[-1].optionValues[x] = ADDON_SETTINGS.getSetting('Channel_' + str(channel) + '_rule_' + str(i + 1) + '_opt_' + str(x + 1))
self.log("Added rule - " + self.ruleList[-1].getTitle())
break
except:
self.ruleList = []
def setPaused(self, paused):
self.isPaused = paused
def setShowTime(self, thetime):
self.showTimeOffset = thetime // 1
def setShowPosition(self, show):
show = int(show)
self.playlistPosition = self.fixPlaylistIndex(show)
def setAccessTime(self, thetime):
self.lastAccessTime = thetime // 1
def getCurrentDuration(self):
return self.getItemDuration(self.playlistPosition)
def getItemDuration(self, index):
return self.Playlist.getduration(self.fixPlaylistIndex(index))
def getTotalDuration(self):
return self.Playlist.totalDuration
def getCurrentLiveID(self):
return self.getItemLiveID(self.playlistPosition)
def getItemLiveID(self, index):
return self.Playlist.getLiveID(self.fixPlaylistIndex(index))
def getCurrenttimestamp(self):
return self.getItemtimestamp(self.playlistPosition)
def getItemtimestamp(self, index):
return self.Playlist.gettimestamp(self.fixPlaylistIndex(index))
def getCurrentgenre(self):
return self.getItemgenre(self.playlistPosition)
def getItemgenre(self, index):
return self.Playlist.getgenre(self.fixPlaylistIndex(index))
#.........這裏部分代碼省略.........