pitivi r1412 - in trunk/pitivi: . ui



Author: edwardrv
Date: Fri Nov 28 17:36:15 2008
New Revision: 1412
URL: http://svn.gnome.org/viewvc/pitivi?rev=1412&view=rev

Log:
major module split-up in the non-timeline UI classes. Also set some better defaults for pane positions on startup

Added:
   trunk/pitivi/ui/audiofxlist.py
   trunk/pitivi/ui/pathwalker.py
   trunk/pitivi/ui/projecttabs.py
   trunk/pitivi/ui/propertyeditor.py
   trunk/pitivi/ui/transitionlist.py
   trunk/pitivi/ui/videofxlist.py
Removed:
   trunk/pitivi/ui/sourcefactories.py
Modified:
   trunk/pitivi/receiver.py
   trunk/pitivi/ui/actions.xml
   trunk/pitivi/ui/mainwindow.py
   trunk/pitivi/ui/webcam_managerdialog.py

Modified: trunk/pitivi/receiver.py
==============================================================================
--- trunk/pitivi/receiver.py	(original)
+++ trunk/pitivi/receiver.py	Fri Nov 28 17:36:15 2008
@@ -1,4 +1,3 @@
-from signalinterface import Signallable
 from types import MethodType
 
 class _receiver_data(object):

Modified: trunk/pitivi/ui/actions.xml
==============================================================================
--- trunk/pitivi/ui/actions.xml	(original)
+++ trunk/pitivi/ui/actions.xml	Fri Nov 28 17:36:15 2008
@@ -7,8 +7,7 @@
       <menuitem action="SaveProjectAs" />
       <menuitem action="ProjectSettings" />
       <separator />
-      <menuitem action="ImportSources" />
-      <menuitem action="ImportSourcesFolder" />
+      <placeholder name="SourceList"/>
       <menuitem action="ImportfromCam" />
       <menuitem action="NetstreamCapture" />
       <menuitem action="Screencast" />
@@ -33,7 +32,7 @@
     <toolitem action="SaveProject" />
     <toolitem action="SaveProjectAs" />
     <separator />
-    <toolitem action="ImportSources" />
+    <placeholder name="SourceList" />
     <separator />
     <toolitem action="RenderProject" />
     <separator />

Added: trunk/pitivi/ui/audiofxlist.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/audiofxlist.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,72 @@
+# PiTiVi , Non-linear video editor
+#
+#       ui/audiofxlist.py
+#
+# Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+import gtk
+import pango
+import pitivi.instance as instance
+from gettext import gettext as _
+
+"""
+Audio FX list widgets
+"""
+
+class AudioFxList(gtk.VBox):
+    """ Widget for listing video effects """
+
+    def __init__(self):
+        gtk.VBox.__init__(self)
+        self.set_border_width(5)
+
+        # model
+        self.storemodel = gtk.ListStore(str, str, object)
+
+        self.scrollwin = gtk.ScrolledWindow()
+        self.scrollwin.set_policy(gtk.POLICY_NEVER,
+                                  gtk.POLICY_AUTOMATIC)
+        self.pack_start(self.scrollwin)
+
+        self.iconview = gtk.IconView(self.storemodel)
+        self.treeview = gtk.TreeView(self.storemodel)
+
+        namecol = gtk.TreeViewColumn(_("Name"))
+        self.treeview.append_column(namecol)
+        namecell = gtk.CellRendererText()
+        namecol.pack_start(namecell)
+        namecol.add_attribute(namecell, "text", 0)
+
+        namecol = gtk.TreeViewColumn(_("Description"))
+        self.treeview.append_column(namecol)
+        namecell = gtk.CellRendererText()
+        namecell.set_property("ellipsize", pango.ELLIPSIZE_END)
+        namecol.pack_start(namecell)
+        namecol.add_attribute(namecell, "text", 1)
+
+        self.scrollwin.add(self.treeview)
+
+        self._fillUpModel()
+
+    def _fillUpModel(self):
+        for factory in instance.PiTiVi.effects.simple_audio:
+            self.storemodel.append([factory.get_longname(),
+                                    factory.get_description(),
+                                    factory])
+
+

Modified: trunk/pitivi/ui/mainwindow.py
==============================================================================
--- trunk/pitivi/ui/mainwindow.py	(original)
+++ trunk/pitivi/ui/mainwindow.py	Fri Nov 28 17:36:15 2008
@@ -42,7 +42,7 @@
 from gettext import gettext as _
 
 from timeline import Timeline
-from sourcefactories import SourceFactoriesWidget
+from projecttabs import ProjectTabs
 from viewer import PitiviViewer
 from pitivi.bin import SmartTimelineBin
 from projectsettings import ProjectSettingsDialog
@@ -170,11 +170,6 @@
              None, _("Save the current project"), self._saveProjectAsCb),
             ("ProjectSettings", gtk.STOCK_PROPERTIES, _("Project settings"),
              None, _("Edit the project settings"), self._projectSettingsCb),
-            ("ImportSources", gtk.STOCK_ADD, _("_Import clips..."),
-             None, _("Import clips to use"), self._importSourcesCb),
-            ("ImportSourcesFolder", gtk.STOCK_ADD,
-             _("_Import folder of clips..."), None,
-             _("Import folder of clips to use"), self._importSourcesFolderCb),
             ("RenderProject", 'pitivi-render' , _("_Render project"),
              None, _("Render project"), self._recordCb),
             ("PluginManager", gtk.STOCK_PREFERENCES ,
@@ -261,13 +256,13 @@
 
         self.timeline = Timeline()
 
-        vpaned.pack2(self.timeline, resize=False, shrink=True)
+        vpaned.pack2(self.timeline, resize=True, shrink=False)
 
         hpaned = gtk.HPaned()
-        vpaned.pack1(hpaned, resize=True, shrink=False)
+        vpaned.pack1(hpaned, resize=False, shrink=True)
 
         # source-and-effects list
-        self.sourcefactories = SourceFactoriesWidget()
+        self.projecttabs = ProjectTabs()
 
         # Viewer
         self.viewer = PitiviViewer()
@@ -275,8 +270,9 @@
         self.pitivi.playground.connect("current-changed", 
             self._currentPlaygroundChangedCb)
 
-        hpaned.pack1(self.sourcefactories, resize=False, shrink=False)
-        hpaned.pack2(self.viewer, resize=True, shrink=False)
+        hpaned.pack1(self.projecttabs, resize=True, shrink=False)
+        hpaned.pack2(self.viewer, resize=False, shrink=False)
+        vpaned.set_position(200)
         # FIXME: remove toolbar padding and shadow. In fullscreen mode, the
         # toolbar buttons should be clickable with the mouse cursor at the
         # very bottom of the screen.
@@ -414,17 +410,9 @@
         abt.connect("response", self._aboutResponseCb)
         abt.show()
 
-    def _importSourcesCb(self, unused_action):
-        self.sourcefactories.sourcelist.showImportSourcesDialog()
-
-    def _importSourcesFolderCb(self, unused_action):
-        self.sourcefactories.sourcelist.showImportSourcesDialog(True)
-
     def _pluginManagerCb(self, unused_action):
         PluginManagerDialog(self.pitivi.plugin_manager)
 
-
-
     # Import from Webcam callback
     def _ImportWebcam(self,unused_action):
         w = WebcamManagerDialog(self.pitivi)
@@ -438,7 +426,6 @@
     def _Screencast(self,unused_action):
         ScreencastManagerDialog()
 
-
     ## Devices changed
     def __deviceChangeCb(self, probe, unused_device):
         if len(probe.getVideoSourceDevices()) < 1:

Added: trunk/pitivi/ui/pathwalker.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/pathwalker.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,53 @@
+# PiTiVi , Non-linear video editor
+#
+#       ui/pathwalker.py
+#
+# Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+import gst
+import threading
+from pitivi.threads import Thread
+
+class PathWalker(Thread):
+    """
+    Thread for recursively searching in a list of directories
+    """
+
+    def __init__(self, paths, callback):
+        Thread.__init__(self)
+        gst.log("New PathWalker for %s" % paths)
+        self.paths = paths
+        self.callback = callback
+        self.stopme = threading.Event()
+
+    def process(self):
+        for folder in self.paths:
+            gst.log("folder %s" % folder)
+            if folder.startswith("file://"):
+                folder = folder[len("file://"):]
+            for path, dirs, files in os.walk(folder):
+                if self.stopme.isSet():
+                    return
+                uris = []
+                for afile in files:
+                    uris.append("file://%s" % os.path.join(path, afile))
+                if uris:
+                    self.callback(uris)
+
+    def abort(self):
+        self.stopme.set()

Added: trunk/pitivi/ui/projecttabs.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/projecttabs.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,58 @@
+# PiTiVi , Non-linear video editor
+#
+#       ui/projecttabs.py
+#
+# Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+"""
+Source and effects list widgets
+"""
+
+import gtk
+from gettext import gettext as _
+from sourcelist import SourceList
+from audiofxlist import AudioFxList
+from videofxlist import VideoFxList
+from propertyeditor import PropertyEditor
+
+class ProjectTabs(gtk.Notebook):
+    """
+    Widget for the various source factories (files, effects, live,...)
+    """
+
+    __DEFAULT_COMPONENTS__ = (
+        (SourceList, _("Clip Library")),
+        (AudioFxList, _("Audio Effects")),
+        (VideoFxList, _("Video Effects")),
+        (PropertyEditor, _("Properties")),
+    )
+
+    def __init__(self):
+        """ initialize """
+        gtk.Notebook.__init__(self)
+        self._createUi()
+
+    def _createUi(self):
+        """ set up the gui """
+        self.set_tab_pos(gtk.POS_TOP)
+        for component, label in self.__DEFAULT_COMPONENTS__:
+            self.addComponent(component, label)
+
+    def addComponent(self, component, label):
+        # TODO: detachability
+        self.append_page(component(), gtk.Label(label))

Added: trunk/pitivi/ui/propertyeditor.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/propertyeditor.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,33 @@
+# PiTiVi , Non-linear video editor
+#
+#       ui/propertyeditor.py
+#
+# Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+"""
+Editor for aribtrary properties of timeline objects
+"""
+
+import gtk
+from gettext import gettext as _
+
+class PropertyEditor(gtk.VBox):
+
+    def __init__(self, *args, **kwargs):
+        gtk.VBox.__init__(self, *args, **kwargs)
+        self.add(gtk.Label(_("Not Implemented")))

Added: trunk/pitivi/ui/transitionlist.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/transitionlist.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,10 @@
+class TransitionListWidget(gtk.VBox):
+    """ Widget for listing transitions """
+
+    def __init__(self):
+        gtk.VBox.__init__(self)
+        self.iconview = gtk.IconView()
+        self.treeview = gtk.TreeView()
+        self.pack_start(self.iconview)
+
+

Added: trunk/pitivi/ui/videofxlist.py
==============================================================================
--- (empty file)
+++ trunk/pitivi/ui/videofxlist.py	Fri Nov 28 17:36:15 2008
@@ -0,0 +1,77 @@
+# PiTiVi , Non-linear video editor
+#
+#       ui/videofxlist.py
+#
+# Copyright (c) 2005, Edward Hervey <bilboed bilboed com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+"""
+Video effects list widget
+"""
+
+import gtk
+import pango
+import pitivi.instance as instance
+from gettext import gettext as _
+
+(COL_NAME,
+ COL_DESCRIPTION,
+ COL_FACTORY) = range(3)
+
+class VideoFxList(gtk.VBox):
+    """ Widget for listing video effects """
+
+    def __init__(self):
+        gtk.VBox.__init__(self)
+        self.set_border_width(5)
+
+        # model
+        self.storemodel = gtk.ListStore(str, str, object)
+
+        self.scrollwin = gtk.ScrolledWindow()
+        self.scrollwin.set_policy(gtk.POLICY_NEVER,
+                                  gtk.POLICY_AUTOMATIC)
+        self.pack_start(self.scrollwin)
+
+        self.iconview = gtk.IconView(self.storemodel)
+        self.treeview = gtk.TreeView(self.storemodel)
+
+        namecol = gtk.TreeViewColumn(_("Name"))
+        self.treeview.append_column(namecol)
+        namecell = gtk.CellRendererText()
+        namecol.pack_start(namecell)
+        namecol.add_attribute(namecell, "text", COL_NAME)
+
+        namecol = gtk.TreeViewColumn(_("Description"))
+        self.treeview.append_column(namecol)
+        namecell = gtk.CellRendererText()
+        namecell.set_property("ellipsize", pango.ELLIPSIZE_END)
+        namecol.pack_start(namecell)
+        namecol.add_attribute(namecell, "text", COL_DESCRIPTION)
+
+        self.scrollwin.add(self.treeview)
+
+        self._fillUpModel()
+
+    def _fillUpModel(self):
+        for factory in instance.PiTiVi.effects.simple_video:
+            self.storemodel.append([factory.get_longname(),
+                                    factory.get_description(),
+                                    factory])
+
+
+

Modified: trunk/pitivi/ui/webcam_managerdialog.py
==============================================================================
--- trunk/pitivi/ui/webcam_managerdialog.py	(original)
+++ trunk/pitivi/ui/webcam_managerdialog.py	Fri Nov 28 17:36:15 2008
@@ -24,7 +24,7 @@
 import gst
 import tempfile
 from pitivi.settings import ExportSettings
-from sourcefactories import SourceFactoriesWidget
+from sourcelist import SourceList
 from pitivi.bin import SmartCaptureBin, SinkBin
 from pitivi.threads import CallbackThread
 from glade import GladeWindow
@@ -55,7 +55,7 @@
         self.record_btn = self.record_btn.get_children()[0].get_children()[1]
         self.record_btn.set_label("Start Recording")
 
-        self.sourcefactories = SourceFactoriesWidget()
+        self.sourcefactories = SourceList()
 
         self._audiodev = None
         self._videodev = None
@@ -102,7 +102,7 @@
             gst.debug("recording stopped")
             self.player.stopRecording()
             # FIXME : use the generic way for adding a file
-            self.sourcefactories.sourcelist.addFiles([self.filepath])
+            self.sourcefactories.addFiles([self.filepath])
             self.player.set_state(gst.STATE_PLAYING)
             self.record_btn.set_label("Start Recording")
 



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