pitivi r1229 - in branches/SOC_2008_SLAKSHMAN: . pitivi pitivi/ui



Author: slynux
Date: Fri Aug  1 17:41:35 2008
New Revision: 1229
URL: http://svn.gnome.org/viewvc/pitivi?rev=1229&view=rev

Log:
Screencast support improved

Modified:
   branches/SOC_2008_SLAKSHMAN/ChangeLog
   branches/SOC_2008_SLAKSHMAN/pitivi/bin.py
   branches/SOC_2008_SLAKSHMAN/pitivi/pitivi.py
   branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_manager.glade
   branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_managerdialog.py

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/bin.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/bin.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/bin.py	Fri Aug  1 17:41:35 2008
@@ -519,16 +519,22 @@
         self.audiosrc = gst.element_factory_make("alsasrc", "asrc")
 
         SmartBin.__init__(self, "smartcapturebin", has_video=True, has_audio=True,
-                          width=720, height=576)
+                          width=640, height=480)
 
     def _addSource(self):
-        self.add(self.videosrc,self.audiosrc)
+	self.q1 = gst.element_factory_make("queue")
+	self.q2 = gst.element_factory_make("queue")
+        self.add(self.videosrc,self.audiosrc,self.q1,self.q2)
 
     def _connectSource(self):
         self.debug("connecting sources")
         #vcaps = gst.caps_from_string("video/x-raw-yuv,width=320,height=240,framerate=25.0")
-        self.videosrc.get_pad("src").link(self.vtee.get_pad("sink"))
-	self.audiosrc.get_pad("src").link(self.atee.get_pad("sink"))
+	
+	gst.element_link_many(self.videosrc,self.q1,self.vtee)
+ 	gst.element_link_many(self.audiosrc,self.q2,self.atee)
+
+        #self.videosrc.get_pad("src").link(self.vtee.get_pad("sink"))
+	#self.audiosrc.get_pad("src").link(self.atee.get_pad("sink"))
 
         self.debug("finished connecting sources")
     def record(self, uri, settings=None):

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/pitivi.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/pitivi.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/pitivi.py	Fri Aug  1 17:41:35 2008
@@ -113,6 +113,7 @@
         # get settings
         self.settings = GlobalSettings()
         self.threads = ThreadMaster()
+	self.screencast = False
 
         self.plugin_manager = PluginManager(
             self.settings.get_local_plugin_path(),

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_manager.glade
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_manager.glade	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_manager.glade	Fri Aug  1 17:41:35 2008
@@ -5,7 +5,7 @@
 <requires lib="gnome"/>
 
 <widget class="GtkDialog" id="screencast_window">
-  <property name="width_request">0</property>
+  <property name="width_request">330</property>
   <property name="visible">True</property>
   <property name="title" translatable="yes">Screencast Desktop</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
@@ -134,79 +134,134 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToggleButton" id="btn_screencast">
-		  <property name="width_request">125</property>
-		  <property name="height_request">51</property>
+		<widget class="GtkHBox" id="hbox2">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="relief">GTK_RELIEF_HALF</property>
-		  <property name="focus_on_click">True</property>
-		  <property name="active">False</property>
-		  <property name="inconsistent">False</property>
-		  <signal name="toggled" handler="on_btn_screencast_toggled" last_modification_time="Sat, 26 Jul 2008 01:54:32 GMT"/>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
 
 		  <child>
-		    <widget class="GtkAlignment" id="alignment1">
+		    <widget class="GtkToggleButton" id="btn_screencast">
+		      <property name="width_request">125</property>
+		      <property name="height_request">51</property>
 		      <property name="visible">True</property>
-		      <property name="xalign">0.5</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xscale">0</property>
-		      <property name="yscale">0</property>
-		      <property name="top_padding">0</property>
-		      <property name="bottom_padding">0</property>
-		      <property name="left_padding">0</property>
-		      <property name="right_padding">0</property>
+		      <property name="can_focus">True</property>
+		      <property name="relief">GTK_RELIEF_HALF</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <signal name="toggled" handler="on_btn_screencast_toggled" last_modification_time="Sat, 26 Jul 2008 01:54:32 GMT"/>
 
 		      <child>
-			<widget class="GtkHBox" id="hbox2">
+			<widget class="GtkAlignment" id="alignment1">
 			  <property name="visible">True</property>
-			  <property name="homogeneous">False</property>
-			  <property name="spacing">2</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xscale">0</property>
+			  <property name="yscale">0</property>
+			  <property name="top_padding">0</property>
+			  <property name="bottom_padding">0</property>
+			  <property name="left_padding">0</property>
+			  <property name="right_padding">0</property>
 
 			  <child>
-			    <widget class="GtkImage" id="image1">
+			    <widget class="GtkHBox" id="hbox2">
 			      <property name="visible">True</property>
-			      <property name="stock">gtk-select-color</property>
-			      <property name="icon_size">4</property>
-			      <property name="xalign">0.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
-			  </child>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">2</property>
 
-			  <child>
-			    <widget class="GtkLabel" id="label1">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Screen Cast</property>
-			      <property name="use_underline">True</property>
-			      <property name="use_markup">False</property>
-			      <property name="justify">GTK_JUSTIFY_LEFT</property>
-			      <property name="wrap">False</property>
-			      <property name="selectable">False</property>
-			      <property name="xalign">0.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-			      <property name="width_chars">-1</property>
-			      <property name="single_line_mode">False</property>
-			      <property name="angle">0</property>
+			      <child>
+				<widget class="GtkImage" id="image1">
+				  <property name="visible">True</property>
+				  <property name="stock">gtk-select-color</property>
+				  <property name="icon_size">4</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label1">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Screen Cast</property>
+				  <property name="use_underline">True</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
 			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
 			  </child>
 			</widget>
 		      </child>
 		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label6">
+		      <property name="width_request">7</property>
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes"></property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkButton" id="btn_istanbul">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Start Istanbul</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
 		  </child>
 		</widget>
 		<packing>
@@ -250,7 +305,7 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkLabel" id="label2">
+	    <widget class="GtkLabel" id="lblbox">
 	      <property name="width_request">40</property>
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes"></property>

Modified: branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_managerdialog.py
==============================================================================
--- branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_managerdialog.py	(original)
+++ branches/SOC_2008_SLAKSHMAN/pitivi/ui/screencast_managerdialog.py	Fri Aug  1 17:41:35 2008
@@ -35,6 +35,8 @@
 import dbus.service
 import dbus.glib
 import gobject
+import thread
+import time
 
 
 class ScreencastManagerDialog(object):
@@ -50,18 +52,31 @@
 		self.close_btn = pool_ui.get_widget("btn_close")
 		self.ok_btn = pool_ui.get_widget("btn_ok")
 		self.screencast_btn = pool_ui.get_widget("btn_screencast")
+		self.istanbul_btn = pool_ui.get_widget("btn_istanbul")
 
 		self.close_btn.connect("clicked",self.close)
 		self.ok_btn.connect("clicked",self.ok)
-		self.screencast_btn.connect("toggled",self.screencast)
+		self.istanbul_btn.connect("clicked",self.start_istanbul)
+		self.screencast_btn.set_active(instance.PiTiVi.screencast)
 
+
+		self.dbus_connect()
+
+			
+
+	def dbus_connect(self):
 		# Connect to istanbul dbus service
 		try:
 			bus = dbus.SessionBus()
             		remote_object = bus.get_object("org.gnome.istanbul", "/state")
             		self.iface = dbus.Interface(remote_object, "org.gnome.istanbul")
+			self.istanbul_btn.hide()
+			self.screencast_btn.set_sensitive(True)
+			self.ok_btn.set_sensitive(True)
+
 		except:
 			self.screencast_btn.set_sensitive(False)
+			self.ok_btn.set_sensitive(False)
 
 	def close(self,w):
 		self.window.destroy()
@@ -71,12 +86,24 @@
 		self.close(None)
 		
 
-	def screencast(self,w):
+	def start_thread_istanbul(self):
+		os.system("istanbul")
 
 
+	# Start istanbul using thread module
+	def start_istanbul(self,w):
+		thread.start_new_thread(self.start_thread_istanbul,())
+		time.sleep(1)
+		self.dbus_connect()
+		
+		
+		
+
+	def screencast(self,w):
 		if self.screencast_btn.get_active():
 			self.iface.savemode(True)
+			instance.PiTiVi.screencast = True
 		else:
 			self.iface.savemode(False)
-
+			instance.PiTiVi.screencast = False
 		



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