Skip to content

Commit

Permalink
viewer: Get rid of redundant seeker methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohayo committed Mar 1, 2012
1 parent 8fa38a9 commit 27dcd83
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions pitivi/viewer.py
Expand Up @@ -355,9 +355,6 @@ def _entryFocusOutCb(self, entry, event):
self.app.gui.setActionsSensitive(sensitive_actions, True)
self.app.gui.setActionsSensitive(['DeleteObj'], True)

def seek(self, position, format=gst.FORMAT_TIME):
self.seeker.seek(position, format)

## active Timeline calllbacks
def _durationChangedCb(self, unused_pipeline, duration):
self.debug("duration : %s", gst.TIME_ARGS(duration))
Expand Down Expand Up @@ -395,33 +392,35 @@ def setZoom(self, zoom):
self.target.sink = self.sink
self.target.renderbox()

def _playButtonCb(self, unused_button, playing):
self.togglePlayback()

def _goToStartCb(self, unused_button):
self.seek(0)
self.seeker.seek(0)

def _backCb(self, unused_button):
self.seekRelative(0 - gst.SECOND)

def _playButtonCb(self, unused_button, playing):
self.togglePlayback()
# Seek backwards one second
self.seeker.seekRelative(0 - gst.SECOND)

def _forwardCb(self, unused_button):
self.seekRelative(gst.SECOND)
# Seek forward one second
self.seeker.seekRelative(gst.SECOND)

def _goToEndCb(self, unused_button):
try:
end = self.app.current.timeline.props.duration
except:
self.warning("Couldn't get timeline duration")
try:
self.seek(end)
self.seeker.seek(end)
except:
self.warning("Couldn't seek to the end of the timeline")

## Callback for jumping to a specific timecode

def _jumpToTimecodeCb(self, widget):
nanoseconds = widget.getWidgetValue()
self.seek(nanoseconds)
self.seeker.seek(nanoseconds)

## public methods for controlling playback

Expand Down Expand Up @@ -480,9 +479,6 @@ def _toggleDocked(self, action):
else:
self.dock()

def seekRelative(self, time):
self.seeker.seekRelative(time)

def _positionCheckCb(self):
"""
Every 300 ms, check if the timeline position changed.
Expand Down

0 comments on commit 27dcd83

Please sign in to comment.