[pitivi] project, application: move creation of default tracks to the newBlankProject() method (temporary hack



commit 38f63b5c4bb9f7cd5ba07132a391341b2a63b638
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date:   Fri Apr 17 21:19:59 2009 -0700

    project,application: move creation of default tracks to the newBlankProject() method (temporary hack to make loading work)
---
 pitivi/application.py |   21 ++++++++++++++++-----
 pitivi/project.py     |    9 +--------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/pitivi/application.py b/pitivi/application.py
index 5993e99..46d7e06 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -113,6 +113,7 @@ class Pitivi(object, Loggable, Signallable):
         instance.PiTiVi = self
 
         self.projects = []
+        self.current = None
 
         # get settings
         self.settings = GlobalSettings()
@@ -122,13 +123,9 @@ class Pitivi(object, Loggable, Signallable):
         self.plugin_manager = PluginManager(
             self.settings.get_local_plugin_path(),
             self.settings.get_plugin_settings_path())
-
-        # FIXME: don't assume the user wishes to create  the default project
-        # class
-        self.current = Project(_("New Project"))
         self.effects = Magician()
-
         self.deviceprobe = get_probe()
+        self.newBlankProject()
 
     #{ Project-related methods
 
@@ -217,6 +214,20 @@ class Pitivi(object, Loggable, Signallable):
             project = Project(_("New Project"))
             self.emit("new-project-loading", project)
             self.current = project
+
+            from pitivi.stream import AudioStream, VideoStream
+            import gst
+            from pitivi.timeline.track import Track
+
+            # FIXME: this should not be hard-coded
+            # add default tracks for a new project
+            video = VideoStream(gst.Caps('video/x-raw-rgb; video/x-raw-yuv'))
+            track = Track(video)
+            project.timeline.addTrack(track)
+            audio = AudioStream(gst.Caps('audio/x-raw-int; audio/x-raw-float'))
+            track = Track(audio)
+            project.timeline.addTrack(track)
+
             self.emit("new-project-loaded", self.current)
 
     #{ Shutdown methods
diff --git a/pitivi/project.py b/pitivi/project.py
index 880f519..9c7a5f1 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -102,14 +102,7 @@ class Project(object, Signallable, Loggable):
 
         self.timeline = Timeline()
 
-        # FIXME: the tracks should be loaded from the settings
-        video = VideoStream(gst.Caps('video/x-raw-rgb; video/x-raw-yuv'))
-        track = Track(video)
-        self.timeline.addTrack(track)
-        audio = AudioStream(gst.Caps('audio/x-raw-int; audio/x-raw-float'))
-        track = Track(audio)
-        self.timeline.addTrack(track)
-
+        
         self.factory = TimelineSourceFactory(self.timeline)
         self.pipeline = Pipeline()
         self.view_action = ViewAction()



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