本文整理汇总了Python中gui.Gui.setStatus方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.setStatus方法的具体用法?Python Gui.setStatus怎么用?Python Gui.setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Gui
的用法示例。
在下文中一共展示了Gui.setStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import setStatus [as 别名]
def main():
gui = Gui()
player = Player()
global currentMode
global currentChoice
global maxChoice
global chosenArtist
global chosenAlbum
global letsDo
oldArtistChoice = 0
def alarm_signal_handler(ssignal, stack):
""" Shows song name playing """
global old_song
song = what_song_playing()
if not song == old_song:
old_song = song
try:
gui.setStatus('{:} [{:}]'.format(song['title'],
song['artist'])[:32])
except:
pass
def setMode(mode):
global currentMode
if not currentMode == 'playing':
if mode == 'playing':
print('starting timer')
signal.setitimer(signal.ITIMER_REAL, 1, 5) # set timer
else:
signal.setitimer(signal.ITIMER_REAL, 0) # cancel timer
currentMode = mode
gui.setMode(currentMode)
def getMode():
return currentMode
def nextsong():
player.MPDnext()
def pause():
player.MPDpause()
def play():
player.MPDplay()
def prevsong():
player.MPDprev()
def showArtists(what):
global currentChoice
global maxChoice
if what=='curr':
msg = player.currLetter()
elif what=='next':
msg = player.nextLetter()
elif what=='prev':
msg = player.prevLetter()
currentChoice = 0
maxChoice = len(msg)
gui.clearListBox()
gui.feedToListbox(msg)
gui.selectListBoxLine(currentChoice)
def showAlbums():
global currentChoice
global maxChoice
global chosenArtist
idx, chosenArtist = gui.getListBoxSelectedLine()
msg = player.MPDscanArtistsAlbums(chosenArtist)
currentChoice = 0
maxChoice = len(msg)
gui.clearListBox()
gui.feedToListbox(msg)
gui.selectListBoxLine(currentChoice)
def status():
return player.MPDstatus()
def volumeUp():
player.VolUp()
def volumeDn():
player.VolDn()
def what_song_playing():
return player.MPDwhat_song_playing()
#.........这里部分代码省略.........