本文整理汇总了Python中settings.Settings.getTrackLengthLimit方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.getTrackLengthLimit方法的具体用法?Python Settings.getTrackLengthLimit怎么用?Python Settings.getTrackLengthLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.getTrackLengthLimit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkEnding
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getTrackLengthLimit [as 别名]
def checkEnding(self):
if self.isPlayingAudio() and (self.startTime > 0):
# Get the current time
currTime = int(time.time())
# Time in minutes to play for
durationLimit = Settings.getPlayDurationLimit()
if durationLimit > 0:
expectedEndTime = self.startTime + (60 * durationLimit)
if currTime > expectedEndTime:
self.endPlaying(slowFade=True)
return
# Check for the case where only a given amount of time of the track will be played
# Only skip forward if there is a track left to play - otherwise just keep
# playing the last track
if (self.playlistSize > 1) and (self.remainingTracks != 0):
trackLimit = Settings.getTrackLengthLimit()
if trackLimit > 0:
if currTime > self.trackEndTime:
log("Player: Skipping to next track after %s" % self.getPlayingFile())
self.playnext()
if self.remainingTracks != -1:
self.remainingTracks = self.remainingTracks - 1
self._setNextSkipTrackTime(currTime)
示例2: _setNextSkipTrackTime
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getTrackLengthLimit [as 别名]
def _setNextSkipTrackTime(self, currentTime):
trackLimit = Settings.getTrackLengthLimit()
if trackLimit < 1:
self.trackEndTime = -1
return
self.trackEndTime = currentTime + trackLimit
trackLength = int(self.getTotalTime())
log("Player: track length = %d" % trackLength)
if trackLimit > trackLength and (Settings.isLoop() or self.remainingTracks > 0):
self.remainingTracks = self.remainingTracks - 1
self.trackEndTime = self.trackEndTime + trackLength
示例3: _setNextSkipTrackTime
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getTrackLengthLimit [as 别名]
def _setNextSkipTrackTime(self, currentTime):
trackLimit = Settings.getTrackLengthLimit()
if trackLimit < 1:
self.trackEndTime = -1
return
self.trackEndTime = currentTime + trackLimit
# Allow for the case where the track has just been stopped, in which
# case the call to get the total time will fail as there is no track
# to get the length of
try:
trackLength = int(self.getTotalTime())
log("ThemePlayer: track length = %d" % trackLength)
if trackLimit > trackLength and (Settings.isLoop() or self.remainingTracks > 0):
self.remainingTracks = self.remainingTracks - 1
self.trackEndTime = self.trackEndTime + trackLength
except:
log("ThemePlayer: Failed to get track total time as not playing")
self.trackEndTime = -1
示例4: checkEnding
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getTrackLengthLimit [as 别名]
def checkEnding(self):
# Check for the case where the user is playing a video and an audio theme in the
# same playlist and wants to repeat the audio theme after the video finishes
try:
if (not self.repeatOneSet) and self.isPlayingAudio() and Settings.isRepeatSingleAudioAfterVideo():
# Check to see if the first item was a video
if len(self.playListItems) > 1:
if Settings.isVideoFile(self.playListItems[0]):
# So we know that we did play a video, now we are
# playing an audio file, so set repeat on the current item
log("ThemePlayer: Setting single track to repeat %s" % self.playListItems[1])
xbmc.executebuiltin("PlayerControl(RepeatOne)")
self.repeatOneSet = True
except:
log("ThemePlayer: Failed to check audio repeat after video")
if self.isPlaying() and (self.startTime > 0):
# Get the current time
currTime = int(time.time())
# Time in minutes to play for
durationLimit = Settings.getPlayDurationLimit()
if durationLimit > 0:
expectedEndTime = self.startTime + (60 * durationLimit)
if currTime > expectedEndTime:
self.endPlaying(slowFade=True)
return
# Check for the case where only a given amount of time of the track will be played
# Only skip forward if there is a track left to play - otherwise just keep
# playing the last track
if (self.playlistSize > 1) and (self.remainingTracks != 0):
trackLimit = Settings.getTrackLengthLimit()
if trackLimit > 0:
if currTime > self.trackEndTime:
log("ThemePlayer: Skipping to next track after %s" % self.getPlayingFile())
self.playnext()
if self.remainingTracks != -1:
self.remainingTracks = self.remainingTracks - 1
self._setNextSkipTrackTime(currTime)