[pitivi/ges: 25/287] Enable basic rendering



commit c20a27dd3947554cedbc462c65c195c36649e57e
Author: Mathieu Duponchelle <seeed laposte net>
Date:   Sun Aug 28 21:33:07 2011 +0200

    Enable basic rendering

 pitivi/ui/encodingdialog.py |   25 +++++++++++++++++--------
 pitivi/ui/mainwindow.py     |    4 ----
 2 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/pitivi/ui/encodingdialog.py b/pitivi/ui/encodingdialog.py
index 7a30a73..711c50c 100644
--- a/pitivi/ui/encodingdialog.py
+++ b/pitivi/ui/encodingdialog.py
@@ -684,15 +684,24 @@ class EncodingDialog(Renderer, Loggable):
         self.dialog.window.destroy()
 
     def _renderButtonClickedCb(self, unused_button):
-        self.outfile = os.path.join(self.filebutton.get_uri(),
-                                    self.fileentry.get_text())
-        self.progress = EncodingProgressDialog(self.app, self)
+        self.outfile = "file:///home/mathieu/Videos/pute3.ogv"
+        #self.progress = EncodingProgressDialog(self.app, self)
         self.window.hide()  # Hide the rendering settings dialog while rendering
-        self.progress.window.show()
-        self.startAction()
-        self.progress.connect("cancel", self._cancelRender)
-        self.progress.connect("pause", self._pauseRender)
-        self.pipeline.connect("state-changed", self._stateChanged)
+        self.containerprofile = gst.pbutils.EncodingContainerProfile ("ogg", None , gst.Caps("application/ogg"), None)
+        self.videoprofile = gst.pbutils.EncodingVideoProfile (gst.Caps("video/x-dirac"), None, gst.caps_new_any(), 0)
+        self.audioprofile = gst.pbutils.EncodingAudioProfile (gst.Caps("audio/x-vorbis"), None, gst.caps_new_any(), 0)
+        self.containerprofile.add_profile(self.videoprofile)
+        self.containerprofile.add_profile(self.audioprofile)
+        pipeline = self.app.app.projectManager.current.pipeline
+        pipeline.set_state(gst.STATE_NULL)
+        pipeline.set_render_settings(self.outfile, self.containerprofile)
+        print pipeline.set_mode("render")
+        pipeline.set_state(gst.STATE_PLAYING)
+        #self.progress.window.show()
+        #self.startAction()
+        #self.progress.connect("cancel", self._cancelRender)
+        #self.progress.connect("pause", self._pauseRender)
+        #self.pipeline.connect("state-changed", self._stateChanged)
 
     def _cancelRender(self, progress):
         self.debug("aborting render")
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 5c8d092..ca5a9ed 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -222,8 +222,6 @@ class PitiviMainWindow(gtk.Window, Loggable):
         """
         from encodingdialog import EncodingDialog
 
-        if pause:
-            project.pipeline.pause()
         dialog = EncodingDialog(self, project)
         dialog.window.connect("destroy", self._encodingDialogDestroyCb)
         self.set_sensitive(False)
@@ -312,7 +310,6 @@ class PitiviMainWindow(gtk.Window, Loggable):
             if action_name == "RenderProject":
                 self.render_button = action
                 # this will be set sensitive when the timeline duration changes
-                action.set_sensitive(False)
                 action.props.is_important = True
             elif action_name in [
                 "ProjectSettings", "Quit", "File", "Edit", "Help", "About",
@@ -693,7 +690,6 @@ class PitiviMainWindow(gtk.Window, Loggable):
         self._connectToProjectSources(project.sources)
         duration = 0
         can_render = duration > 0
-        self.render_button.set_sensitive(can_render)
         self._syncDoUndo(self.app.action_log)
 
         if self._missingUriOnLoading:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]