本文整理汇总了Python中pitivi.utils.pipeline.Seeker.seekRelative方法的典型用法代码示例。如果您正苦于以下问题:Python Seeker.seekRelative方法的具体用法?Python Seeker.seekRelative怎么用?Python Seeker.seekRelative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pitivi.utils.pipeline.Seeker
的用法示例。
在下文中一共展示了Seeker.seekRelative方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ViewerContainer
# 需要导入模块: from pitivi.utils.pipeline import Seeker [as 别名]
# 或者: from pitivi.utils.pipeline.Seeker import seekRelative [as 别名]
#.........这里部分代码省略.........
self.buttons = bbox
self.buttons_container = bbox
self.show_all()
self.external_vbox.show_all()
def setDisplayAspectRatio(self, ratio):
self.debug("Setting aspect ratio to %f [%r]", float(ratio), ratio)
self.target.setDisplayAspectRatio(ratio)
def _entryActivateCb(self, unused_entry):
self._seekFromTimecodeWidget()
def _seekFromTimecodeWidget(self):
nanoseconds = self.timecode_entry.getWidgetValue()
self.seeker.seek(nanoseconds)
# Active Timeline calllbacks
def _durationChangedCb(self, unused_pipeline, duration):
if duration == 0:
self._setUiActive(False)
else:
self._setUiActive(True)
def _playButtonCb(self, unused_button, unused_playing):
self.app.project_manager.current_project.pipeline.togglePlayback()
self.app.gui.focusTimeline()
def _goToStartCb(self, unused_button):
self.seeker.seek(0)
self.app.gui.focusTimeline()
def _backCb(self, unused_button):
# Seek backwards one second
self.seeker.seekRelative(0 - Gst.SECOND)
self.app.gui.focusTimeline()
def _forwardCb(self, unused_button):
# Seek forward one second
self.seeker.seekRelative(Gst.SECOND)
self.app.gui.focusTimeline()
def _goToEndCb(self, unused_button):
end = self.app.project_manager.current_project.pipeline.getDuration()
self.seeker.seek(end)
self.app.gui.focusTimeline()
# Public methods for controlling playback
def undock(self, *unused_widget):
if not self.docked:
self.warning("The viewer is already undocked")
return
self.docked = False
self.settings.viewerDocked = False
self.remove(self.buttons_container)
position = None
if self.pipeline:
position = self.pipeline.getPosition()
self.pipeline.setState(Gst.State.NULL)
self.remove(self.target)
self.__createNewViewer()
self.external_vbox.pack_end(self.buttons_container, False, False, 0)
self.undock_button.hide()
self.fullscreen_button = Gtk.ToggleToolButton()
示例2: PitiviViewer
# 需要导入模块: from pitivi.utils.pipeline import Seeker [as 别名]
# 或者: from pitivi.utils.pipeline.Seeker import seekRelative [as 别名]
#.........这里部分代码省略.........
if duration == 0:
self._setUiActive(False)
else:
self._setUiActive(True)
## Control Gtk.Button callbacks
def setZoom(self, zoom):
"""
Zoom in or out of the transformation box canvas.
This is called by clipproperties.
"""
if self.target.box:
maxSize = self.target.area
width = int(float(maxSize.width) * zoom)
height = int(float(maxSize.height) * zoom)
area = ((maxSize.width - width) / 2,
(maxSize.height - height) / 2,
width, height)
self.sink.set_render_rectangle(*area)
self.target.box.update_size(area)
self.target.zoom = zoom
self.target.sink = self.sink
self.target.renderbox()
def _playButtonCb(self, unused_button, playing):
self.app.current.pipeline.togglePlayback()
def _goToStartCb(self, unused_button):
self.seeker.seek(0)
def _backCb(self, unused_button):
# Seek backwards one second
self.seeker.seekRelative(0 - Gst.SECOND)
def _forwardCb(self, unused_button):
# Seek forward one second
self.seeker.seekRelative(Gst.SECOND)
def _goToEndCb(self, unused_button):
try:
end = self.app.current.pipeline.getDuration()
except:
self.warning("Couldn't get timeline duration")
try:
self.seeker.seek(end)
except:
self.warning("Couldn't seek to the end of the timeline")
## public methods for controlling playback
def undock(self):
if not self.undock_action:
self.error("Cannot undock because undock_action is missing.")
return
if not self.docked:
return
self.docked = False
self.settings.viewerDocked = False
self.undock_action.set_label(_("Dock Viewer"))
self.target = self.external
self.remove(self.buttons_container)
self.external_vbox.pack_end(self.buttons_container, False, False, 0)
self.external_window.set_type_hint(Gdk.WindowTypeHint.UTILITY)
示例3: ViewerContainer
# 需要导入模块: from pitivi.utils.pipeline import Seeker [as 别名]
# 或者: from pitivi.utils.pipeline.Seeker import seekRelative [as 别名]
#.........这里部分代码省略.........
self._setUiActive(False)
else:
self._setUiActive(True)
## Control Gtk.Button callbacks
def setZoom(self, zoom):
"""
Zoom in or out of the transformation box canvas.
This is called by clipproperties.
"""
if self.target.box:
maxSize = self.target.area
width = int(float(maxSize.width) * zoom)
height = int(float(maxSize.height) * zoom)
area = ((maxSize.width - width) / 2,
(maxSize.height - height) / 2,
width, height)
self.sink.set_render_rectangle(*area)
self.target.box.update_size(area)
self.target.zoom = zoom
self.target.renderbox()
def _playButtonCb(self, unused_button, unused_playing):
self.app.current_project.pipeline.togglePlayback()
self.app.gui.focusTimeline()
def _goToStartCb(self, unused_button):
self.seeker.seek(0)
self.app.gui.focusTimeline()
def _backCb(self, unused_button):
# Seek backwards one second
self.seeker.seekRelative(0 - Gst.SECOND)
self.app.gui.focusTimeline()
def _forwardCb(self, unused_button):
# Seek forward one second
self.seeker.seekRelative(Gst.SECOND)
self.app.gui.focusTimeline()
def _goToEndCb(self, unused_button):
end = self.app.current_project.pipeline.getDuration()
self.seeker.seek(end)
self.app.gui.focusTimeline()
## public methods for controlling playback
def undock(self):
if not self.undock_action:
self.error("Cannot undock because undock_action is missing.")
return
if not self.docked:
return
self.docked = False
self.settings.viewerDocked = False
self.undock_action.set_label(_("Dock Viewer"))
self.remove(self.buttons_container)
self.external_vbox.pack_end(self.buttons_container, False, False, 0)
self.external_window.set_type_hint(Gdk.WindowTypeHint.UTILITY)
self.external_window.show()
self.fullscreen_button = Gtk.ToggleToolButton()
self.fullscreen_button.set_icon_name("view-fullscreen")