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


Python Song.updateSongDatabase方法代码示例

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


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

示例1: __init__

# 需要导入模块: import Song [as 别名]
# 或者: from Song import updateSongDatabase [as 别名]
    def __init__(self, engine, libraryName=None, songName=None):
        Scene.__init__(self, engine)

        if self.engine.world.sceneName == "SongChoosingScene":  # MFH - dual / triple loading cycle fix
            Log.warn("Extra SongChoosingScene was instantiated, but detected and shut down.  Cause unknown.")
            raise SuppressScene  # stump
        else:
            self.engine.world.sceneName = "SongChoosingScene"

        if self.engine.config.get("debug", "use_new_song_database"):
            Song.updateSongDatabase(self.engine)

        self.wizardStarted = False
        self.libraryName = libraryName
        self.songName = songName
        if not self.libraryName:
            self.libraryName = self.engine.config.get("setlist", "selected_library")
            if not self.libraryName:
                self.libraryName = Song.DEFAULT_LIBRARY
        if not self.songName:
            self.songName = self.engine.config.get("setlist", "selected_song")
        self.gameMode = self.engine.world.gameMode
        self.careerMode = self.gameMode == CAREER
        self.practiceMode = self.gameMode == PRACTICE
        self.gameMode2p = self.engine.world.multiMode
        self.autoPreview = not self.engine.config.get("audio", "disable_preview")
        self.sortOrder = self.engine.config.get("game", "sort_order")
        self.tut = self.engine.world.tutorial
        self.playerList = self.players

        self.gameStarted = False

        self.gamePlayers = len(self.playerList)
        self.parts = [None for i in self.playerList]
        self.diffs = [None for i in self.playerList]

        self.time = 0
        self.lastTime = 0
        self.mode = 0
        self.moreInfo = False
        self.moreInfoTime = 0
        self.miniLobbyTime = 0
        self.selected = 0
        self.camera = Camera()
        self.cameraOffset = 0.0
        self.song = None
        self.songLoader = None
        self.loaded = False
        text = _("Initializing Setlist...")
        if self.engine.cmdPlay == 2:
            text = _("Checking Command-Line Settings...")
        elif len(self.engine.world.songQueue) > 0:
            text = _("Checking Setlist Settings...")
        elif len(self.engine.world.songQueue) == 0:
            self.engine.world.playingQueue = False
        self.splash = Dialogs.showLoadingSplashScreen(self.engine, text)
        self.items = []
        self.cmdPlay = False
        self.queued = True

        self.loadStartTime = time.time()

        if self.tut == True:
            self.library = self.engine.tutorialFolder
        else:
            self.library = os.path.join(self.engine.config.get("setlist", "base_library"), self.libraryName)
            if not os.path.isdir(self.engine.resource.fileName(self.library)):
                self.library = self.engine.resource.fileName(
                    os.path.join(self.engine.config.get("setlist", "base_library"), Song.DEFAULT_LIBRARY)
                )

        self.searchText = ""

        # user configurables and input management
        self.listingMode = 0  # with libraries or List All
        self.preloadSongLabels = False
        self.showCareerTiers = 1 + (self.careerMode and 1 or 0)  # 0-Never; 1-Career Only; 2-Always
        self.scrolling = 0
        self.scrollDelay = self.engine.config.get("game", "scroll_delay")
        self.scrollRate = self.engine.config.get("game", "scroll_rate")
        self.scrollTime = 0
        self.scroller = [lambda: None, self.scrollUp, self.scrollDown]
        self.scoreDifficulty = Song.difficulties[self.engine.config.get("game", "songlist_difficulty")]
        self.scorePart = Song.parts[self.engine.config.get("game", "songlist_instrument")]
        self.sortOrder = self.engine.config.get("game", "sort_order")
        self.queueFormat = self.engine.config.get("game", "queue_format")
        self.queueOrder = self.engine.config.get("game", "queue_order")
        self.queueParts = self.engine.config.get("game", "queue_parts")
        self.queueDiffs = self.engine.config.get("game", "queue_diff")
        self.nilShowNextScore = self.engine.config.get("songlist", "nil_show_next_score")

        # theme information
        self.themename = self.engine.data.themeLabel
        self.theme = self.engine.data.theme

        # theme configurables
        self.setlistStyle = self.engine.theme.setlist.setlistStyle  # 0 = Normal; 1 = List; 2 = Circular
        self.headerSkip = self.engine.theme.setlist.headerSkip  # items taken up by header (non-static only)
        self.footerSkip = self.engine.theme.setlist.footerSkip  # items taken up by footer (non-static only)
        self.itemSize = self.engine.theme.setlist.itemSize  # delta (X, Y) (0..1) for each item (non-static only)
#.........这里部分代码省略.........
开发者ID:paulhayes,项目名称:fofix,代码行数:103,代码来源:SongChoosingScene.py


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