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


Python WidgetStateStore.get_repeat_off方法代码示例

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


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

示例1: toggle_repeat

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
 def toggle_repeat(self):
     if self.repeat == WidgetStateStore.get_repeat_playlist():
         self.set_repeat(WidgetStateStore.get_repeat_track())
     elif self.repeat == WidgetStateStore.get_repeat_track():
         self.set_repeat(WidgetStateStore.get_repeat_off())
     elif self.repeat == WidgetStateStore.get_repeat_off():
         self.set_repeat(WidgetStateStore.get_repeat_playlist())
     #handle unknown values
     else:
         self.set_repeat(WidgetStateStore.get_repeat_off())
开发者ID:geoffl,项目名称:miro,代码行数:12,代码来源:playback.py

示例2: should_resume

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
    def should_resume(self):
        if self.force_resume:
            return True

        if self.shuffle == True or self.repeat != WidgetStateStore.get_repeat_off():
            return False

        currently_playing = self.playlist.currently_playing
        return self.item_resume_policy(currently_playing)
开发者ID:foxi,项目名称:miro,代码行数:11,代码来源:playback.py

示例3: find_next_item

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
 def find_next_item(self, not_skipped_by_user=True):
     #if track repeat is on and the user doesn't skip, 
     #shuffle doesn't matter
     if ((self.repeat == WidgetStateStore.get_repeat_track()
          and not_skipped_by_user)):
         return self.currently_playing
     elif ((not self.shuffle and
          self.repeat == WidgetStateStore.get_repeat_playlist()
          and self.is_playing_last_item())):
         return self._find_playable(self.model.get_first_info())
     elif (self.shuffle and self.repeat == WidgetStateStore.get_repeat_off()
          or self.shuffle and self.repeat == WidgetStateStore.get_repeat_track()):
         next_item = self.next_shuffle_item()
         if next_item is None:
             self.shuffle_upcoming = self.generate_upcoming_shuffle_items()
             self.shuffle_history = []
             return None #stop playback 
         else:
             # Remove currently playing item from history if it
             # was removed from the playlist.
             if not self.shuffle_history:
                 logging.info('find_next_item: shuffle history empty: '
                              'case 1')
             else:
                 if self._is_playing_filtered_item():
                     self.shuffle_history.pop()
             self.shuffle_history.append(next_item.id)
             return next_item
     elif self.shuffle and WidgetStateStore.get_repeat_playlist():
         next_item = self.next_shuffle_item()
         if next_item is None:
             #populate with new items
             self.shuffle_upcoming = self.generate_upcoming_shuffle_items() 
             next_item = self.next_shuffle_item()
             if next_item is None:
                 #17492 - nothing playable in list
                 return None
         # Remove currently playing item from history if it
         # was removed from the playlist.
         if not self.shuffle_history:
             logging.info('find_next_item: shuffle history empty: case 2')
         else:
             if self._is_playing_filtered_item():
                 self.shuffle_history.pop()
         self.shuffle_history.append(next_item.id)
         return next_item
     else:
         if self._is_playing_filtered_item():
             return self.model.get_first_info()
         else:
             next_item = self.model.get_next_info(self.currently_playing.id)
             return self._find_playable(next_item)
开发者ID:geoffl,项目名称:miro,代码行数:54,代码来源:playback.py

示例4: __init__

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
 def __init__(self, item_tracker, start_id):
     signals.SignalEmitter.__init__(self, "position-changed", "playing-info-changed")
     self.item_tracker = item_tracker
     self.model = item_tracker.item_list.model
     self._tracker_callbacks = [
         item_tracker.connect("items-will-change", self._on_items_will_change),
         item_tracker.connect("items-changed", self._on_items_changed),
         item_tracker.connect("items-removed-from-source", self._on_items_removed_from_source),
     ]
     self.repeat = WidgetStateStore.get_repeat_off()
     self.shuffle = False
     self.shuffle_history = []
     self.currently_playing = None
     self.shuffle_upcoming = self.generate_upcoming_shuffle_items()
     self._pick_initial_item(start_id)
开发者ID:foxi,项目名称:miro,代码行数:17,代码来源:playback.py

示例5: __init__

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
 def __init__(self):
     signals.SignalEmitter.__init__(self)
     self.player = None
     self.video_display = None
     self.removing_video_display = False
     self.detached_window = None
     self.previous_left_width = 0
     self.previous_left_widget = None
     self.is_fullscreen = False
     self.is_playing = False
     self.is_playing_audio = False
     self.is_paused = False
     self.is_suspended = False
     self.shuffle = False
     self.repeat = WidgetStateStore.get_repeat_off() 
     self.open_finished = False
     self.open_successful = False
     self.playlist = None
     self.mark_as_watched_timeout = None
     self.update_timeout = None
     self.manual_item_list = None
     self.selected_tab_list = self.selected_tabs = None
     self.presentation_mode = 'fit-to-bounds'
     self.create_signal('will-start')
     self.create_signal('selecting-file')
     self.create_signal('playing-info-changed')
     self.create_signal('cant-play-file')
     self.create_signal('will-play')
     self.create_signal('did-start-playing')
     self.create_signal('will-play-attached')
     self.create_signal('will-play-detached')
     self.create_signal('will-pause')
     self.create_signal('will-stop')
     self.create_signal('did-stop')
     self.create_signal('will-fullscreen')
     self.create_signal('playback-did-progress')
     self.create_signal('update-shuffle')
     self.create_signal('update-repeat')
开发者ID:CodeforEvolution,项目名称:miro,代码行数:40,代码来源:playback.py

示例6: generate_upcoming_shuffle_items

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_repeat_off [as 别名]
 def generate_upcoming_shuffle_items(self):
     if not self.shuffle:
         return []
     elif self.repeat == WidgetStateStore.get_repeat_off() or self.repeat == WidgetStateStore.get_repeat_track():
         # random order
         items = self.get_all_playable_items()
         shuffle(items)
         # do not include currently playing item
         if self.currently_playing:
             try:
                 items.remove(self.currently_playing.id)
             except ValueError:
                 pass
         return items
     elif self.repeat == WidgetStateStore.get_repeat_playlist():
         # random items
         items = self.get_all_playable_items()
         if items:
             return self.random_sequence(items, self.currently_playing.id)
         else:
             return []
     else:
         return []
开发者ID:foxi,项目名称:miro,代码行数:25,代码来源:playback.py


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