[pitivi/ges: 5/287] GES : make it so the projects load from menu and startupwizard, also don't start position callback i
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 5/287] GES : make it so the projects load from menu and startupwizard, also don't start position callback i
- Date: Thu, 15 Mar 2012 16:26:15 +0000 (UTC)
commit 0d83d37d7bb23ed7a47cee3b03b3ec5ef09b8da3
Author: Mathieu Duponchelle <seeed laposte net>
Date: Wed Jul 20 03:37:14 2011 +0200
GES : make it so the projects load from menu and startupwizard, also don't start position callback if not playing
pitivi/projectmanager.py | 23 +++++++++--------------
pitivi/ui/viewer.py | 14 ++------------
2 files changed, 11 insertions(+), 26 deletions(-)
---
diff --git a/pitivi/projectmanager.py b/pitivi/projectmanager.py
index 5f25a66..71b1170 100644
--- a/pitivi/projectmanager.py
+++ b/pitivi/projectmanager.py
@@ -97,20 +97,15 @@ class ProjectManager(Signallable, Loggable):
self.emit("new-project-loading", uri)
- formatter = self._getFormatterForUri(uri)
- if not formatter:
- self.emit("new-project-failed", uri,
- FormatterLoadError(_("Not a valid project file.")))
- return
-
- if not self.closeRunningProject():
- self.emit("new-project-failed", uri,
- FormatterLoadError(_("Couldn't close current project")))
- return
-
- self._connectToFormatter(formatter)
- # start loading the project, from now on everything is async
- formatter.loadProject(uri)
+ self.formatter = ges.PitiviFormatter()
+
+ pipeline = self.current.pipeline
+ pipeline.set_state(gst.STATE_NULL)
+ self.timeline = self.current.timeline
+ for layer in self.timeline.get_layers():
+ self.timeline.remove_layer(layer)
+ self.formatter.load_from_uri(self.timeline, uri)
+ pipeline.set_state(gst.STATE_PAUSED)
def saveProject(self, project, uri=None, overwrite=False, formatter=None, backup=False):
"""
diff --git a/pitivi/ui/viewer.py b/pitivi/ui/viewer.py
index 1252b16..857370d 100644
--- a/pitivi/ui/viewer.py
+++ b/pitivi/ui/viewer.py
@@ -131,16 +131,6 @@ class PitiviViewer(gtk.VBox, Loggable):
if not self.settings.viewerDocked:
self.undock()
- def loadProject(self, uri):
- pipeline = self.app.projectManager.current.pipeline
- pipeline.set_state(gst.STATE_NULL)
- self.timeline = self.app.projectManager.current.timeline
- for layer in self.timeline.get_layers():
- self.timeline.remove_layer(layer)
- self.formatter.load_from_uri(self.timeline, uri)
- self.app.projectManager.emit("new-project-loading", uri)
- pipeline.set_state(gst.STATE_PAUSED)
-
def setPipeline(self):
"""
Set the Viewer to the given Pipeline.
@@ -619,11 +609,11 @@ class PitiviViewer(gtk.VBox, Loggable):
self.warning("seek failed")
def _posCb(self):
+ if not self.playing :
+ return False
position = self.pipeline.query_position(gst.FORMAT_TIME)[0]
self._newTime(position)
self.app.gui.timeline._canvas.timelinePositionChanged(position)
- if not self.playing :
- return False
return True
def _currentStateCb(self, state):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]