当前位置: 首页>>代码示例>>Python>>正文


Python Settings.isVideoFile方法代码示例

本文整理汇总了Python中settings.Settings.isVideoFile方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isVideoFile方法的具体用法?Python Settings.isVideoFile怎么用?Python Settings.isVideoFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在settings.Settings的用法示例。


在下文中一共展示了Settings.isVideoFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _getThemesToUpload

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isVideoFile [as 别名]
    def _getThemesToUpload(self, id, themes):
        themeList = []
        for theme in themes:
            maxFileSize = 104857600
            if Settings.isVideoFile(theme):
                # Check if all videos are disabled
                if not self.isVideoEnabled:
                    continue
            else:
                # Check if all audio are disabled
                if not self.isAudioEnabled:
                    continue

                # Audio files have a smaller limit
                maxFileSize = 20971520

            # Check to make sure the theme file is not too large, anything over 100 megabytes
            # is too large for a theme
            stat = xbmcvfs.Stat(theme)
            themeFileSize = stat.st_size()
            if themeFileSize > maxFileSize:
                log("UploadThemes: Theme %s too large %s" % (theme, themeFileSize))
                continue
            if themeFileSize < 19460:
                log("UploadThemes: Theme %s too small %s" % (theme, themeFileSize))
                continue

            # If we reach here it is not in either exclude list
            themeList.append(theme)
        return themeList
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:32,代码来源:upload.py

示例2: updateVideoRefreshRate

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isVideoFile [as 别名]
    def updateVideoRefreshRate(self, themePlayList):
        # Check if the setting is enabled to switch the refresh rate
        if not Settings.blockRefreshRateChange():
            self.original_refreshrate = 0
            return

        log("ThemePlayer: Checking for update of refresh rate")

        try:
            # Check if we have any videos in the PlayList
            hasVideoFiles = True
            i = 0
            while i < themePlayList.size():
                if Settings.isVideoFile(themePlayList[i].getfilename()):
                    hasVideoFiles = True
                    break
                i = i + 1

            if hasVideoFiles:
                # Save off the existing refresh setting
                jsonresponse = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Settings.GetSettingValue",  "params": { "setting": "videoplayer.adjustrefreshrate" }, "id": 1}')
                data = simplejson.loads(jsonresponse)
                if 'result' in data:
                    if 'value' in data['result']:
                        self.original_refreshrate = data['result']['value']
                        # Check if the refresh rate is currently set
                        log("ThemePlayer: Video refresh rate currently set to %d" % self.original_refreshrate)

                # Check if the refresh rate is currently set, if it is, then we need
                if self.original_refreshrate != 0:
                    # Disable the refresh rate setting
                    log("ThemePlayer: Disabling refresh rate")
                    xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Settings.SetSettingValue",  "params": { "setting": "videoplayer.adjustrefreshrate", "value": 0 }, "id": 1}')
        except:
            log("ThemePlayer: Failed to process video refresh")
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:37,代码来源:themePlayer.py

示例3: _filterForVideoThemesRule

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isVideoFile [as 别名]
    def _filterForVideoThemesRule(self):
        # Check if we just leave the list as it is
        if not Settings.isVideoThemesFirst() and not Settings.isVideoThemesOnlyIfOneExists():
            return False

        # Go through each file seeing if it ends with one of the expected
        # video formats that we support
        containsVideoFile = False
        for aThemeFile in self.themeFiles:
            if Settings.isVideoFile(aThemeFile):
                containsVideoFile = True
                break

        # Check if there are no video files, so nothing to do
        if not containsVideoFile:
            return False

        # Now strip out anything that is not a video file
        videoThemes = []
        audioThemes = []
        for aThemeFile in self.themeFiles:
            if Settings.isVideoFile(aThemeFile):
                videoThemes.append(aThemeFile)
            else:
                audioThemes.append(aThemeFile)

        # Check if we need to only return video themes if one exists
        # and we don't want audio themes in this case
        if Settings.isVideoThemesOnlyIfOneExists():
            log("ThemeFiles: Removing non video themes", self.debug_logging_enabled)
            self.themeFiles = videoThemes
        elif Settings.isVideoThemesFirst():
            # If we want to shuffle the tracks, then do this before we join the
            # two arrays together
            if Settings.isShuffleThemes():
                random.shuffle(videoThemes)
                random.shuffle(audioThemes)
            self.themeFiles = videoThemes + audioThemes
            return True

        return False
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:43,代码来源:themeFinder.py

示例4: _getThemesToUpload

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isVideoFile [as 别名]
    def _getThemesToUpload(self, target, id, themes):
        themeList = []
        for theme in themes:
            maxFileSize = 104857600
            if Settings.isVideoFile(theme):
                # Check if all videos are disabled
                if not self.isVideoEnabled:
                    continue

                # Check to see if this theme should be excluded
                if target == 'tvshows':
                    if id in self.tvShowVideoExcludes:
                        log("UploadThemes: TV Show %s in video exclude list, skipping" % id)
                        continue
                elif target == 'movies':
                    if id in self.movieVideoExcludes:
                        log("UploadThemes: Movie %s in video exclude list, skipping" % id)
                        continue
            else:
                # Check if all videos are disabled
                if not self.isVideoEnabled:
                    continue

                # Audio files have a smaller limit
                maxFileSize = 20971520
                # Check to see if this theme should be excluded
                if target == 'tvshows':
                    if id in self.tvShowAudioExcludes:
                        log("UploadThemes: TV Show %s in audio exclude list, skipping" % id)
                        continue
                elif target == 'movies':
                    if id in self.movieAudioExcludes:
                        log("UploadThemes: Movie %s in audio exclude list, skipping" % id)
                        continue

            # Check to make sure the theme file is not too large, anything over 100 meg
            # is too large for a theme
            stat = xbmcvfs.Stat(theme)
            themeFileSize = stat.st_size()
            if themeFileSize > maxFileSize:
                log("UploadThemes: Theme %s too large %s" % (theme, themeFileSize))
                continue
            if themeFileSize < 19460:
                log("UploadThemes: Theme %s too small %s" % (theme, themeFileSize))
                continue

            # If we reach here it is not in either exclude list
            themeList.append(theme)
        return themeList
开发者ID:SchapplM,项目名称:script.tvtunes,代码行数:51,代码来源:upload.py

示例5: checkEnding

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isVideoFile [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)
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:43,代码来源:themePlayer.py


注:本文中的settings.Settings.isVideoFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。