本文整理汇总了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())
示例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)
示例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)
示例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)
示例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')
示例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 []