本文整理汇总了Python中miro.plat.frontends.widgets.threads.warn_if_not_on_main_thread函数的典型用法代码示例。如果您正苦于以下问题:Python warn_if_not_on_main_thread函数的具体用法?Python warn_if_not_on_main_thread怎么用?Python warn_if_not_on_main_thread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了warn_if_not_on_main_thread函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: set_item
def set_item(self, item_info, callback, errback, force_subtitles=False):
threads.warn_if_not_on_main_thread('quicktime.Player.set_item')
self.reset()
qtmovie = self.get_movie_from_file(item_info.video_path)
self.callback = callback
self.errback = errback
self.force_subtitles = force_subtitles
if qtmovie is not None:
self.item_info = item_info
self.movie = qtmovie
self.movie_notifications = NotificationForwarder.create(self.movie)
self.movie_notifications.connect(self.handle_movie_notification,
QTMovieDidEndNotification)
load_state = qtmovie.attributeForKey_(
QTMovieLoadStateAttribute).longValue()
# Only setup a deferred notification if we are unsure of status
# anything else in movie_load_state_changed().
if load_state in (QTMovieLoadStateLoading,
QTMovieLoadStateLoaded):
self.movie_notifications.connect(
self.handle_movie_notification,
QTMovieLoadStateDidChangeNotification)
else:
# Playable right away or error - just call and don't disconnect
# notification because it wasn't connected in the first place.
self.movie_load_state_changed(disconnect=False)
else:
threads.call_on_ui_thread(errback)
开发者ID:kmshi,项目名称:miro,代码行数:28,代码来源:quicktime.py
示例2: stop
def stop(self, will_play_another=False):
threads.warn_if_not_on_main_thread('VideoPlayer.stop')
self.prevent_system_sleep(True)
self.video_view.pause_(nil)
if self.video_window and not will_play_another:
self.video_window.palette.remove()
self.reset()
开发者ID:ShriramK,项目名称:miro,代码行数:7,代码来源:video.py
示例3: reveal
def reveal(self, videoWindow):
threads.warn_if_not_on_main_thread('OverlayPalette.reveal')
self.resetAutoHiding()
if (not self.window().isVisible() and not self.revealing) or (self.window().isVisible() and self.hiding):
self.update_(nil)
if self.renderer.movie is not None:
self.set_volume(self.renderer.movie.volume())
self.adjustPosition(videoWindow)
self.adjustContent(videoWindow, False)
if self.hiding and self.anim is not None:
self.anim.stopAnimation()
self.hiding = False
else:
self.window().setAlphaValue_(0.0)
self.window().orderFront_(nil)
videoWindow.parentWindow().addChildWindow_ordered_(self.window(), NSWindowAbove)
self.revealing = True
params = {NSViewAnimationTargetKey: self.window(), NSViewAnimationEffectKey: NSViewAnimationFadeInEffect}
self.animate(params, 0.3)
else:
self.resumeAutoHiding()
开发者ID:nxmirrors,项目名称:miro,代码行数:25,代码来源:overlay.py
示例4: reset
def reset(self):
threads.warn_if_not_on_main_thread('quicktime.Player.reset')
if self.movie_notifications is not None:
self.movie_notifications.disconnect()
self.movie_notifications = None
self.movie = None
self.item_info = None
开发者ID:nxmirrors,项目名称:miro,代码行数:7,代码来源:quicktime.py
示例5: reset
def reset(self):
threads.warn_if_not_on_main_thread('quicktime.Player.reset')
if self.movie_notifications is not None:
self.movie_notifications.disconnect()
self.movie_notifications = None
self.movie = None
self.callback = self.errback = None
self.force_subtitles = False
开发者ID:kmshi,项目名称:miro,代码行数:8,代码来源:quicktime.py
示例6: remove
def remove(self):
threads.warn_if_not_on_main_thread('OverlayPalette.remove')
self.suspendAutoHiding()
if self.updateTimer is not nil:
self.updateTimer.invalidate()
self.updateTimer = nil
if self.window().parentWindow() is not nil:
self.window().parentWindow().removeChildWindow_(self.window())
self.window().orderOut_(nil)
开发者ID:nxmirrors,项目名称:miro,代码行数:9,代码来源:overlay.py
示例7: set_item
def set_item(self, item_info, callback, errback, force_subtitles=False):
threads.warn_if_not_on_main_thread('quicktime.Player.set_item')
qtmovie = self.get_movie_from_file(item_info.video_path)
self.reset()
if qtmovie is not None:
self.movie = qtmovie
self.item_info = item_info
self.movie_notifications = NotificationForwarder.create(self.movie)
self.movie_notifications.connect(self.handle_movie_notification, QTMovieDidEndNotification)
self.setup_subtitles(force_subtitles)
callback()
else:
errback()
开发者ID:nxmirrors,项目名称:miro,代码行数:13,代码来源:quicktime.py
示例8: hide
def hide(self):
threads.warn_if_not_on_main_thread('OverlayPalette.hide')
if not self.hiding:
if self.autoHidingTimer is not nil:
self.autoHidingTimer.invalidate()
self.autoHidingTimer = nil
if self.revealing and self.anim is not None:
self.anim.stopAnimation()
self.revealing = False
self.hiding = True
params = {NSViewAnimationTargetKey: self.window(), NSViewAnimationEffectKey: NSViewAnimationFadeOutEffect}
self.animate(params, 0.5)
开发者ID:nxmirrors,项目名称:miro,代码行数:14,代码来源:overlay.py
示例9: can_open_file
def can_open_file(self, qtmovie):
threads.warn_if_not_on_main_thread('quicktime.Player.can_open_file')
can_open = False
duration = utils.qttimevalue(qtmovie.duration())
if qtmovie is not None and duration > 0:
allTracks = qtmovie.tracks()
if len(qtmovie.tracks()) > 0:
# Make sure we have at least one track with a non zero length
allMedia = [track.media() for track in allTracks]
for media in allMedia:
mediaType = media.attributeForKey_(QTMediaTypeAttribute)
mediaDuration = utils.qttimevalue(media.attributeForKey_(QTMediaDurationAttribute).QTTimeValue())
if mediaType in self.supported_media_types and mediaDuration > 0:
can_open = True
break
return can_open
开发者ID:nxmirrors,项目名称:miro,代码行数:18,代码来源:quicktime.py
示例10: setFloatValue_
def setFloatValue_(self, value):
threads.warn_if_not_on_main_thread('Slider.setFloatValue_')
self.value = value
self.setNeedsDisplay_(YES)
开发者ID:nxmirrors,项目名称:miro,代码行数:4,代码来源:overlay.py
示例11: pause
def pause(self):
threads.warn_if_not_on_main_thread('VideoPlayer.pause')
self.video_view.pause_(nil)
self.prevent_system_sleep(False)
开发者ID:ShriramK,项目名称:miro,代码行数:4,代码来源:video.py
示例12: play
def play(self):
threads.warn_if_not_on_main_thread('VideoPlayer.play')
self.video_view.play_(nil)
self.video_view.setNeedsDisplay_(YES)
self.prevent_system_sleep(True)
开发者ID:ShriramK,项目名称:miro,代码行数:5,代码来源:video.py
示例13: pause
def pause(self):
threads.warn_if_not_on_main_thread('AudioPlayer.pause')
if self.movie is not None:
self.movie.stop()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:4,代码来源:audio.py
示例14: play
def play(self):
threads.warn_if_not_on_main_thread('AudioPlayer.play')
if self.movie is not None:
self.movie.play()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:4,代码来源:audio.py
注:本文中的miro.plat.frontends.widgets.threads.warn_if_not_on_main_thread函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论