本文整理汇总了Python中engine.Engine.pause方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.pause方法的具体用法?Python Engine.pause怎么用?Python Engine.pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类engine.Engine
的用法示例。
在下文中一共展示了Engine.pause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Wolfgang
# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import pause [as 别名]
#.........这里部分代码省略.........
if album not in self.library[artist]:
column = 0
artist_iter = self.library_store.get_iter_first()
while (artist != \
self.library_store.get_value (artist_iter, column)) and \
(artist != None):
artist_iter = self.library_store.iter_next (artist_iter)
self.library[artist][album] = []
self.library_store.append(artist_iter, [album])
self.library[artist][album].append([title, uri, track])
"""
UI methods and callbacks
"""
def previous(self, unused_widget=None):
if self.queue_current_iter is None:
return False
prev_iter = self.queue_store.iter_previous(self.queue_current_iter)
if prev_iter is None:
return False
self.uri = self.queue_store.get_value(prev_iter, 2)
self.engine.stop()
self.play()
# remove the ♪ cursor
self.queue_store.set_value(self.queue_current_iter, 0, "")
self.queue_store.set_value(prev_iter, 0, "♪")
self.queue_current_iter = prev_iter
self.next_button.set_sensitive(True)
if not self.queue_store.iter_previous(self.queue_current_iter):
self.previous_button.set_sensitive(False)
def _play_pause(self, widget):
"""
Callback for the Play pushbutton
"""
if widget.props.active:
self.play()
else:
self.pause()
def next(self, unused_widget=None):
if self.queue_current_iter is None:
return False
next_iter = self.queue_store.iter_next(self.queue_current_iter)
if next_iter is None:
return False
self.uri = self.queue_store.get_value(next_iter, 2)
self.engine.stop()
self.play()
# remove the ♪ cursor
self.queue_store.set_value(self.queue_current_iter, 0, "")
self.queue_store.set_value(next_iter, 0, "♪")
self.queue_current_iter = next_iter
self.previous_button.set_sensitive(True)
if not self.queue_store.iter_next(self.queue_current_iter):
self.next_button.set_sensitive(False)
def _loop_toggled(self, widget):
"""
Callback for the Loop pushbutton
"""
if widget.props.active:
print "Activate portal device"
self.loop = True