[xiph-commits] r11792 - trunk/souffleur

daraku at svn.xiph.org daraku at svn.xiph.org
Thu Aug 17 11:34:10 PDT 2006


Author: daraku
Date: 2006-08-17 11:34:05 -0700 (Thu, 17 Aug 2006)
New Revision: 11792

Modified:
   trunk/souffleur/MediaInfo.py
   trunk/souffleur/Souffleur.py
   trunk/souffleur/souffleur.glade
Log:
Add callback for "File->New" menu.
Added callback for "media add" tool button in STREAM_WINDOW.
Delete Edit and View menu.
Hide unused widgets.


Modified: trunk/souffleur/MediaInfo.py
===================================================================
--- trunk/souffleur/MediaInfo.py	2006-08-17 13:33:34 UTC (rev 11791)
+++ trunk/souffleur/MediaInfo.py	2006-08-17 18:34:05 UTC (rev 11792)
@@ -312,14 +312,17 @@
         self.parsers = []
 
         self.demux = gst.element_factory_make('oggdemux')
+        #self.videoparse = gst.element_factory_make("ogmvideoparse")
         self.mux = gst.element_factory_make('oggmux')
 
-        self.add(self.demux, self.mux)
+        self.add(self.demux, self.mux)#, self.videoparse)
 
         self.add_pad(gst.GhostPad('sink', self.demux.get_pad('sink')))
+        #self.add_pad(gst.GhostPad('vsink', self.videoparse.get_pad('sink')))
         self.add_pad(gst.GhostPad('src', self.mux.get_pad('src')))
 
         self.demux.connect('pad-added', self._new_demuxed_pad)
+        #self.videoparse.connect('pad-added', self._new_demuxed_pad)
         self.demux.connect('no-more-pads', self._no_more_pads)
 
     def _no_more_pads(self, elem):
@@ -370,6 +373,9 @@
         self.startID=self.startID+1
         nStream.ID=self.startID
         self.media.addStream(nStream)
+        print format
+        #if format in "application/x-ogm-video":
+        #    pad.link(self.videoparse.get_pad('sink'))
         if format not in self.parsefactories:
             #self.async_error("Unsupported media type: %s", format)
             return

Modified: trunk/souffleur/Souffleur.py
===================================================================
--- trunk/souffleur/Souffleur.py	2006-08-17 13:33:34 UTC (rev 11791)
+++ trunk/souffleur/Souffleur.py	2006-08-17 18:34:05 UTC (rev 11792)
@@ -103,13 +103,17 @@
             "on_TOOL_DELETE_clicked": self.cb_subDel,\
             "on_main_file_save_activate": self.cb_onSaveMenu,\
             "on_main_file_save_as_activate": self.cb_onSaveAsMenu,\
+            "on_main_file_new_activate": self.cb_onNewMenu,\
             "on_LIST_SUBS_cursor_changed": self.cb_onSubsListSelect}
         self.wTree.signal_autoconnect (dic)
         
         self.windowProjectOpen=None
         self.windowProjectSO=None
         self.PFileName=None
+        self.windowMediaOpen=None
         self.windowStreams=gtk.glade.XML (self.gladefile,"STREAM_WINDOW")
+        dic = {"on_TOOL_ADD_STREAM_clicked": self.cb_addNewStream}
+        self.windowStreams.signal_autoconnect (dic)
         ### Setup LIST_STREAMS
         LIST = self.windowStreams.get_widget("LIST_STREAMS")
         if LIST:
@@ -154,6 +158,41 @@
         self.playButton = self.wTree.get_widget("TOOL_PLAY")
         return
 #==============================================================================
+    def cb_openMediaCancel(self, widget):
+        if self.windowMediaOpen:
+            WND=self.windowMediaOpen.get_widget("OPEN_MEDIA")
+            WND.hide()
+#==============================================================================
+    def cb_openMediaOpen(self, widget):
+        WND=self.windowMediaOpen.get_widget("OPEN_MEDIA")
+        FN=WND.get_filename()
+        URI=WND.get_uri()
+        WND.hide()
+        print FN, URI
+        MI = MediaInfo(URI, FN, self.lastID)
+        MI.run()
+        tMedia = MI.getMedia()
+        self.addMedia(tMedia)
+#==============================================================================
+    def cb_addNewStream(self, widget):
+        if(self.windowMediaOpen==None):
+            self.windowMediaOpen=gtk.glade.XML (self.gladefile,"OPEN_MEDIA")
+            dic={"on_OPEN_BUTTON_CANCEL_clicked": self.cb_openMediaCancel,\
+                "on_OPEN_BUTTON_OPEN_clicked": self.cb_openMediaOpen }
+            self.windowMediaOpen.signal_autoconnect(dic)
+        else:
+            WND=self.windowMediaOpen.get_widget("OPEN_MEDIA")
+            if not WND:
+                self.windowMediaOpen=None
+            else:
+                WND.show()
+        return
+#==============================================================================
+    def cb_onNewMenu(self, menu):
+        if self.windowStreams:
+            WND=self.windowStreams.get_widget("STREAM_WINDOW")
+            WND.show()
+#==============================================================================
     def setEditSubtitle(self, Sub):
         if not self.Subtitle:
             return
@@ -367,18 +406,6 @@
     def openFileOpen(self, widget):
         WND=self.windowProjectOpen.get_widget("SAVE_OPEN_PFILE")
         self.PFileName=WND.get_filename()
-        #URI=WND.get_uri()
-        #mInfo = MediaInfo(URI, FN, self.lastID)
-        #mInfo.run()
-        #Streams = None
-        #if((FN!="")and(FN!=None)):
-        #    Streams = GstFile(FN)
-        #    if Streams:
-        #        Streams.run()
-        #WND.hide()
-        #WND=self.windowStreams.get_widget("STREAM_WINDOW")
-        #WND.show()
-        #self.addMedia(mInfo.getMedia())
         WND.hide()
         PXML=ProjectXML()
         PXML.load(self.PFileName)

Modified: trunk/souffleur/souffleur.glade
===================================================================
--- trunk/souffleur/souffleur.glade	2006-08-17 13:33:34 UTC (rev 11791)
+++ trunk/souffleur/souffleur.glade	2006-08-17 18:34:05 UTC (rev 11792)
@@ -97,63 +97,6 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkMenuItem" id="MAIN_EDIT_MENU">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_Edit</property>
-	      <property name="use_underline">True</property>
-
-	      <child>
-		<widget class="GtkMenu" id="MAIN_EDIT_MENU_menu">
-
-		  <child>
-		    <widget class="GtkImageMenuItem" id="MAIN_EDIT_CUT">
-		      <property name="visible">True</property>
-		      <property name="label">gtk-cut</property>
-		      <property name="use_stock">True</property>
-		      <signal name="activate" handler="on_main_edit_cut_activate" last_modification_time="Sat, 03 Jun 2006 16:27:54 GMT"/>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkImageMenuItem" id="MAIN_EDIT_COPY">
-		      <property name="visible">True</property>
-		      <property name="label">gtk-copy</property>
-		      <property name="use_stock">True</property>
-		      <signal name="activate" handler="on_main_edit_copy_activate" last_modification_time="Sat, 03 Jun 2006 16:27:54 GMT"/>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkImageMenuItem" id="MAIN_EDIT_PASTE">
-		      <property name="visible">True</property>
-		      <property name="label">gtk-paste</property>
-		      <property name="use_stock">True</property>
-		      <signal name="activate" handler="on_main_edit_paste_activate" last_modification_time="Sat, 03 Jun 2006 16:27:54 GMT"/>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkImageMenuItem" id="MAIN_EDIT_DELETE">
-		      <property name="visible">True</property>
-		      <property name="label">gtk-delete</property>
-		      <property name="use_stock">True</property>
-		      <signal name="activate" handler="on_main_edit_delete_activate" last_modification_time="Sat, 03 Jun 2006 16:27:54 GMT"/>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
-	    </widget>
-	  </child>
-
-	  <child>
-	    <widget class="GtkMenuItem" id="MAIN_VIEW_MENU">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">_View</property>
-	      <property name="use_underline">True</property>
-	    </widget>
-	  </child>
-
-	  <child>
 	    <widget class="GtkMenuItem" id="MAIN_HELP_MENU">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Help</property>
@@ -212,7 +155,6 @@
 	      <child>
 		<widget class="GtkDrawingArea" id="AUDIO_GPAPH">
 		  <property name="height_request">64</property>
-		  <property name="visible">True</property>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -804,7 +746,6 @@
 		  <child>
 		    <widget class="GtkVBox" id="vbox6">
 		      <property name="border_width">8</property>
-		      <property name="visible">True</property>
 		      <property name="homogeneous">False</property>
 		      <property name="spacing">8</property>
 
@@ -963,7 +904,6 @@
 
 		      <child>
 			<widget class="GtkToolbar" id="toolbar5">
-			  <property name="visible">True</property>
 			  <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
 			  <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
 			  <property name="tooltips">True</property>
@@ -1233,6 +1173,7 @@
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
+	      <signal name="clicked" handler="on_TOOL_ADD_STREAM_clicked" last_modification_time="Thu, 17 Aug 2006 17:44:07 GMT"/>
 	    </widget>
 	    <packing>
 	      <property name="expand">False</property>
@@ -1438,7 +1379,7 @@
   </child>
 </widget>
 
-<widget class="GtkFileChooserDialog" id="OPEN_OGG">
+<widget class="GtkFileChooserDialog" id="OPEN_MEDIA">
   <property name="visible">True</property>
   <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
   <property name="local_only">True</property>



More information about the commits mailing list