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


Python Engine.pause方法代码示例

本文整理汇总了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
开发者ID:luisbg,项目名称:wolfgang,代码行数:70,代码来源:wolfgang.py


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