當前位置: 首頁>>代碼示例>>Python>>正文


Python Playlist.getfilename方法代碼示例

本文整理匯總了Python中Playlist.Playlist.getfilename方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.getfilename方法的具體用法?Python Playlist.getfilename怎麽用?Python Playlist.getfilename使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist.Playlist的用法示例。


在下文中一共展示了Playlist.getfilename方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import getfilename [as 別名]

#.........這裏部分代碼省略.........


    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))


    def getCurrentDescription(self):
        return self.getItemDescription(self.playlistPosition)


    def getItemDescription(self, index):
        return self.Playlist.getdescription(self.fixPlaylistIndex(index))


    def getCurrentEpisodeTitle(self):
        return self.getItemEpisodeTitle(self.playlistPosition)


    def getItemEpisodeTitle(self, index):
        return self.Playlist.getepisodetitle(self.fixPlaylistIndex(index))


    def getCurrentTitle(self):
        return self.getItemTitle(self.playlistPosition)


    def getItemTitle(self, index):
        return self.Playlist.getTitle(self.fixPlaylistIndex(index))


    def getCurrentFilename(self):
        return self.getItemFilename(self.playlistPosition)


    def getItemFilename(self, index):
        return self.Playlist.getfilename(self.fixPlaylistIndex(index))


    def fixPlaylistIndex(self, index):
        if self.Playlist.size() == 0:
            return index

        while index >= self.Playlist.size():
            index -= self.Playlist.size()

        while index < 0:
            index += self.Playlist.size()

        return index


    def addShowPosition(self, addition):
        self.setShowPosition(self.playlistPosition + addition)
開發者ID:DrSpaceMonkey,項目名稱:script.pseudotv.live,代碼行數:104,代碼來源:Channel.py

示例2: __init__

# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import getfilename [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.mode = 0

    def log(self, msg):
        log("Channel: " + msg)

    def setPlaylist(self, filename):
        return self.Playlist.load(filename)

    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 getCurrentDescription(self):
        return self.getItemDescription(self.playlistPosition)

    def getItemDescription(self, index):
        return self.Playlist.getdescription(self.fixPlaylistIndex(index))

    def getCurrentEpisodeTitle(self):
        return self.getItemEpisodeTitle(self.playlistPosition)

    def getItemEpisodeTitle(self, index):
        return self.Playlist.getepisodetitle(self.fixPlaylistIndex(index))

    def getCurrentTitle(self):
        return self.getItemTitle(self.playlistPosition)

    def getItemTitle(self, index):
        return self.Playlist.getTitle(self.fixPlaylistIndex(index))

    def getCurrentFilename(self):
        return self.getItemFilename(self.playlistPosition)

    def getItemFilename(self, index):
        return self.Playlist.getfilename(self.fixPlaylistIndex(index))

    def fixPlaylistIndex(self, index):
        if self.Playlist.size() == 0:
            return index

        while index >= self.Playlist.size():
            index -= self.Playlist.size()

        while index < 0:
            index += self.Playlist.size()

        return index

    def addShowPosition(self, addition):
        self.setShowPosition(self.playlistPosition + addition)
開發者ID:kyotocafe,項目名稱:XBMC-PseudoTV,代碼行數:81,代碼來源:Channel.py


注:本文中的Playlist.Playlist.getfilename方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。