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


Python Song.loadSong方法代码示例

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


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

示例1: previewSong

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
    def previewSong(self):
        self.previewLoaded = True
        if isinstance(self.selectedItem, Song.SongInfo):
            song = self.selectedItem.songName  # TODO: SongDB
        else:
            return

        if self.careerMode and self.selectedItem.getLocked():  # TODO: SongDB
            if self.song:
                self.song.fadeout(1000)
            return
        if self.songLoader:
            try:
                self.songLoader.stop()
            except:
                self.songLoader = None

        self.songLoader = self.engine.resource.load(
            self,
            None,
            lambda: Song.loadSong(self.engine, song, playbackOnly=True, library=self.library),
            synch=True,
            onLoad=self.songLoaded,
            onCancel=self.songCanceled,
        )
开发者ID:paulhayes,项目名称:fofix,代码行数:27,代码来源:SongChoosingScene.py

示例2: createClient

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
  def createClient(self, libraryName, songName, players = None):
    self.libraryName     = libraryName
    self.songName        = songName
    self.stars           = [0 for i in players]
    self.accuracy        = [0 for i in players]
    self.counter         = 0
    self.showHighscores  = False
    self.highscoreIndex  = [None for i in players]
    self.taunt           = None
    self.uploadingScores = False
    self.nextScene       = None
    self.offset          = None
    self.pauseScroll     = None
    self.scorePart       = None
    self.scoreDifficulty = None
    self.playerList      = players

    self.spinnyDisabled   = self.engine.config.get("game", "disable_spinny")    

    items = [
      (_("Replay"),            self.replay),
      (_("Change Song"),       self.changeSong),
      (_("Quit to Main Menu"), self.quit),
    ]
    self.menu = Menu(self.engine, items, onCancel = self.quit, pos = (.2, .5))
      
    self.engine.resource.load(self, "song", lambda: Song.loadSong(self.engine, songName, library = self.libraryName, notesOnly = True, part = [player.part for player in self.playerList]), onLoad = self.songLoaded)
    self.engine.loadSvgDrawing(self, "background", "gameresults.svg")

    phrase = random.choice(Theme.resultsPhrase.split(","))
    if phrase == "None":
      phrase = _("Chilling...")
    Dialogs.showLoadingScreen(self.engine, lambda: self.song, text = phrase)
开发者ID:broccoliftw,项目名称:workingfofwindows8,代码行数:35,代码来源:GameResultsScene.py

示例3: createClient

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
  def createClient(self, libraryName, songName, players = 1): #players = None
    Log.debug("GameResultsSceneClient class init...")
    self.libraryName     = libraryName
    self.songName        = songName
    self.stars           = [0 for i in players]
    self.accuracy        = [0 for i in players]
    self.counter         = 0
    self.showHighscores  = False
    self.highscoreIndex  = [-1 for i in players]
    self.taunt           = None
    self.uploadingScores = False
    self.uploadResult    = None
    self.nextScene       = None
    self.offset          = None
    self.pauseScroll     = None
    self.scorePart       = None
    self.scoreDifficulty = None
    self.playerList      = players
    self.spinnyDisabled   = True#NO SPINNY!!!    

    #myfingershurt: reordering so default is Change Song.
    items = [
      (_("Continue"),       self.changeSong),
      (_("Replay"),            self.replay),
      (_("Quit"), self.quit),
    ]
    self.menu = Menu(self.engine, items, onCancel = self.quit, pos = (.2, .5))
      
    self.engine.resource.load(self, "song", lambda: Song.loadSong(self.engine, songName, library = self.libraryName, notesOnly = True, part = [player.part for player in self.playerList]), onLoad = self.songLoaded)

    #Get theme
    themename = self.engine.data.themeLabel
    #now theme determination logic is only in data.py:
    self.theme = self.engine.data.theme
      
    self.starScoring = self.engine.config.get("game", "star_scoring")#MFH
    self.Congratphrase = self.engine.config.get("game", "congrats")#blazingamer

    self.resultCheerLoop = self.engine.config.get("game", "result_cheer_loop")#MFH
    self.cheerLoopDelay = self.engine.config.get("game", "cheer_loop_delay")#MFH
    self.cheerLoopCounter = self.cheerLoopDelay   #MFH - starts out ready to cheer
      
    self.engine.loadImgDrawing(self, "background", os.path.join("themes",themename,"gameresults.png"))

    phrase = random.choice(Theme.resultsPhrase.split("_"))
    if phrase == "None":
      i = random.randint(0,5)
      if i == 0:
        phrase = _("Relax, it was an excellent show.")
      elif i == 1:
        phrase = _("Truly Amazing!")
      elif i == 2:
        phrase = _("Thanks for playing!")
      elif i == 3:
        phrase = _("One more song can't hurt, can it?")
      elif i == 4:
        phrase = _("What an amazing performance!")
      else:
        phrase = _("That's how it's done!")
    Dialogs.showLoadingScreen(self.engine, lambda: self.song, text = phrase)
开发者ID:Gamer125,项目名称:fofix,代码行数:62,代码来源:GameResultsScene.py

示例4: playSelectedSong

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
  def playSelectedSong(self):
    song = self.getSelectedSong()
    if not song:
      return
    
    if self.songLoader:
      self.songLoader.cancel()
      # Don't start a new song loader until the previous one is finished
      if self.songLoader.isAlive():
        self.songCountdown = 256
        return

    if self.song:
      self.song.fadeout(1000)

    self.songLoader = self.engine.resource.load(self, None, lambda: Song.loadSong(self.engine, song, playbackOnly = True, library = self.library),
                                                onLoad = self.songLoaded)
开发者ID:miracle2k,项目名称:fretsonfire,代码行数:19,代码来源:Dialogs.py

示例5: createClient

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
 def createClient(self, libraryName, songName):
   self.libraryName     = libraryName
   self.songName        = songName
   self.stars           = 0
   self.accuracy        = 0
   self.counter         = 0
   self.showHighscores  = False
   self.highscoreIndex  = None
   self.taunt           = None
   self.uploadingScores = False
   self.nextScene       = None
   
   items = [
     (_("Replay"),            self.replay),
     (_("Change Song"),       self.changeSong),
     (_("Quit to Main Menu"), self.quit),
   ]
   self.menu = Menu(self.engine, items, onCancel = self.quit, pos = (.2, .5))
     
   self.engine.resource.load(self, "song", lambda: Song.loadSong(self.engine, songName, library = self.libraryName, notesOnly = True), onLoad = self.songLoaded)
   self.engine.loadSvgDrawing(self, "background", "keyboard.svg")
   Dialogs.showLoadingScreen(self.engine, lambda: self.song, text = _("Chilling..."))
开发者ID:fretsonfire,项目名称:fof-python,代码行数:24,代码来源:GameResultsScene.py

示例6: __init__

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
    def __init__(self, engine, songName = None):
        self.engine      = engine
        self.time        = 0.0
        self.offset      = 1.0
        self.songLoader  = self.engine.resource.load(self, "song", lambda: Song.loadSong(self.engine, "defy", playbackOnly = True),
                                                     onLoad = self.songLoaded)
        self.engine.loadImgDrawing(self, "background1", "editor.png")
        self.engine.loadImgDrawing(self, "background2", "keyboard.png")
        self.engine.loadImgDrawing(self, "background3", "cassette.png")

        nf = self.engine.data.font
        bf = self.engine.data.bigFont
        ns = 0.002
        bs = 0.001
        hs = 0.003
        c1 = (1, 1, .5, 1)
        c2 = (1, .75, 0, 1)

        space = Text(nf, hs, c1, "center", " ")
        self.credits = [
            Text(nf, ns, c2, "center", _("Unreal Voodoo")),
            Text(nf, ns, c1, "center", _("presents")),
            Text(nf, bs, c2, "center", " "),
            Picture(self.engine, "logo.png", .25),
            Text(nf, bs, c2, "center", " "),
            Text(nf, bs, c2, "center", _("Version %s") % Version.version()),
            space,
            Text(nf, ns, c1, "left",   _("Game Design,")),
            Text(nf, ns, c1, "left",   _("Programming:")),
            Text(nf, ns, c2, "right",  "Sami Kyostila"),
            space,
            Text(nf, ns, c1, "left",   _("Music,")),
            Text(nf, ns, c1, "left",   _("Sound Effects:")),
            Text(nf, ns, c2, "right",  "Tommi Inkila"),
            space,
            Text(nf, ns, c1, "left",   _("Graphics:")),
            Text(nf, ns, c2, "right",  "Joonas Kerttula"),
            space,
            Text(nf, ns, c1, "left",   _("Introducing:")),
            Text(nf, ns, c2, "right",  "Mikko Korkiakoski"),
            Text(nf, ns, c2, "right",  _("as Jurgen, Your New God")),
            space,
            Text(nf, ns, c2, "right",  "Marjo Hakkinen"),
            Text(nf, ns, c2, "right",  _("as Groupie")),
            space,
            Text(nf, ns, c1, "left",   _("Song Credits:")),
            Text(nf, ns, c2, "right",  _("Bang Bang, Mystery Man")),
            Text(nf, bs, c2, "right",  _("music by Mary Jo and Tommi Inkila")),
            Text(nf, bs, c2, "right",  _("lyrics by Mary Jo")),
            space,
            Text(nf, ns, c2, "right",  _("Defy The Machine")),
            Text(nf, bs, c2, "right",  _("music by Tommi Inkila")),
            space,
            Text(nf, ns, c2, "right",  _("This Week I've Been")),
            Text(nf, ns, c2, "right",  _("Mostly Playing Guitar")),
            Text(nf, bs, c2, "right",  _("composed and performed by Tommi Inkila")),
            space,
            Text(nf, ns, c1, "left",   _("Testing:")),
            Text(nf, ns, c2, "right",  "Mikko Korkiakoski"),
            Text(nf, ns, c2, "right",  "Tomi Kyostila"),
            Text(nf, ns, c2, "right",  "Jani Vaarala"),
            Text(nf, ns, c2, "right",  "Juho Jamsa"),
            Text(nf, ns, c2, "right",  "Olli Jakola"),
            space,
            Text(nf, ns, c1, "left",   _("Mac OS X port:")),
            Text(nf, ns, c2, "right",  "Tero Pihlajakoski"),
            space,
            Text(nf, ns, c1, "left",   _("Special thanks to:")),
            Text(nf, ns, c2, "right",  "Tutorial inspired by adam02"),
            space,
            Text(nf, ns, c1, "left",   _("Made with:")),
            Text(nf, ns, c2, "right",  "Python"),
            Text(nf, bs, c2, "right",  "http://www.python.org"),
            space,
            Text(nf, ns, c2, "right",  "PyGame"),
            Text(nf, bs, c2, "right",  "http://www.pygame.org"),
            space,
            Text(nf, ns, c2, "right",  "PyOpenGL"),
            Text(nf, bs, c2, "right",  "http://pyopengl.sourceforge.net"),
            space,
            Text(nf, ns, c2, "right",  "Amanith Framework"),
            Text(nf, bs, c2, "right",  "http://www.amanith.org"),
            space,
            Text(nf, ns, c2, "right",  "Illusoft Collada module 1.4"),
            Text(nf, bs, c2, "right",  "http://colladablender.illusoft.com"),
            space,
            Text(nf, ns, c2, "right",  "MXM Python Midi Package 0.1.4"),
            Text(nf, bs, c2, "right",  "http://www.mxm.dk/products/public/pythonmidi"),
            space,
            space,
            Text(nf, bs, c1, "center", _("Source Code available under the GNU General Public License")),
            Text(nf, bs, c2, "center", "http://www.unrealvoodoo.org"),
            space,
            space,
            space,
            space,
            Text(nf, bs, c1, "center", _("Copyright 2006-2008 by Unreal Voodoo")),
        ]
开发者ID:fofix,项目名称:fof-reborn,代码行数:100,代码来源:Credits.py

示例7: createClient

# 需要导入模块: import Song [as 别名]
# 或者: from Song import loadSong [as 别名]
  def createClient(self, libraryName, songName, players = 1): #players = None

    self.logClassInits = self.engine.config.get("game", "log_class_inits")
    if self.logClassInits == 1:
      Log.debug("GameResultsSceneClient class init...")

    self.libraryName     = libraryName
    self.songName        = songName
    self.stars           = [0 for i in players]
    self.accuracy        = [0 for i in players]
    self.counter         = 0
    self.showHighscores  = False
    self.highscoreIndex  = [-1 for i in players]
    self.taunt           = None
    self.uploadingScores = [False for p in players]
    self.highScoreResult = [None for p in players]
    self.resultNum       = 0
    self.uploadResult    = None
    self.nextScene       = None
    self.offset          = None
    self.pauseScroll     = None
    self.scorePart       = None
    self.scoreDifficulty = None
    self.playerList      = players
    self.spinnyDisabled   = True#NO SPINNY!!!    

    self.scoreScrollStartOffset = .8    #MFH - where highscore scrolling starts

    #MFH - pretranslation
    self.tsSettings = _("settings")
    self.tsHopos = _("HOPOs")
    self.tsHitWindow = _("Hit Window")


    #myfingershurt: reordering so default is Change Song.
    items = [
      (_("Continue"),       self.changeSong),
      (_("Replay"),            self.replay),
      (_("Quit"), self.quit),
    ]
    self.menu = Menu(self.engine, items, onCancel = self.quit, pos = (.2, .5))
      
    self.engine.resource.load(self, "song", lambda: Song.loadSong(self.engine, songName, library = self.libraryName, notesOnly = True, part = [player.part for player in self.playerList]), onLoad = self.songLoaded)

    #Get theme
    themename = self.engine.data.themeLabel
    #now theme determination logic is only in data.py:
    self.theme = self.engine.data.theme
      
    self.starScoring = self.engine.config.get("game", "star_scoring")#MFH
    self.Congratphrase = self.engine.config.get("game", "congrats")#blazingamer

    self.resultCheerLoop = self.engine.config.get("game", "result_cheer_loop")#MFH

    #MFH theme.ini override:
    self.cheerLoopDelay = Theme.crowdLoopDelay
    if self.cheerLoopDelay == None:
      self.cheerLoopDelay = self.engine.config.get("game", "cheer_loop_delay")#MFH
    Log.debug("Cheer loop delay value used: %d" % self.cheerLoopDelay)

    self.cheerLoopCounter = self.cheerLoopDelay   #MFH - starts out ready to cheer
      
    #MFH
    self.hopoStyle        = self.engine.config.get("game", "hopo_style")
    if self.hopoStyle == 0:
      self.hopoStyle = _("None")
    elif self.hopoStyle == 1:
      self.hopoStyle = _("RF-Mod")
    elif self.hopoStyle == 2:
      self.hopoStyle = _("GH2 Strict")
    elif self.hopoStyle == 3:
      self.hopoStyle = _("GH2 Sloppy")
    elif self.hopoStyle == 4:
      self.hopoStyle = _("GH2")

    self.hopoFreq        = self.engine.config.get("coffee", "moreHopo")
    #MFH if song.ini HOPO frequency exists and is enabled, display that instead...
    self.songHopoFreq = self.engine.config.get("game", "song_hopo_freq")
    songHopoFreq = self.playerList[0].hopoFreq
    try:
      songHopoFreq = int(songHopoFreq)
    except Exception, e:
      songHopoFreq = None
开发者ID:Gamer125,项目名称:fofix,代码行数:85,代码来源:GameResultsScene.py


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