cheese r749 - in branches/cheese-vala: . src



Author: jhaitsma
Date: Tue Jun  3 05:54:20 2008
New Revision: 749
URL: http://svn.gnome.org/viewvc/cheese?rev=749&view=rev

Log:
work in progress

Modified:
   branches/cheese-vala/   (props changed)
   branches/cheese-vala/configure.ac
   branches/cheese-vala/src/cheese-webcam.vala
   branches/cheese-vala/src/cheese-window.vala

Modified: branches/cheese-vala/configure.ac
==============================================================================
--- branches/cheese-vala/configure.ac	(original)
+++ branches/cheese-vala/configure.ac	Tue Jun  3 05:54:20 2008
@@ -60,9 +60,9 @@
 # Check required libraries
 #*******************************************************************************
 
-GLIB_REQUIRED=2.15.5
-GIO_REQUIRED=2.15.5
-GTK_REQUIRED=2.10.0
+GLIB_REQUIRED=2.16.0
+GIO_REQUIRED=2.16.0
+GTK_REQUIRED=2.13.1
 LIBGNOMEUI_REQUIRED=2.14.0
 GCONF_REQUIRED=2.16.0
 GSTREAMER_REQUIRED=0.10.15

Modified: branches/cheese-vala/src/cheese-webcam.vala
==============================================================================
--- branches/cheese-vala/src/cheese-webcam.vala	(original)
+++ branches/cheese-vala/src/cheese-webcam.vala	Tue Jun  3 05:54:20 2008
@@ -163,10 +163,6 @@
 		bus.message += on_bus_message;
 		if (!ok)
 			error ("Unable link pipeline for photo");
-
-		threads_enter();
-		// FIXME XF86VidModeGetGamma (GDK_DISPLAY (), 0, &(priv->normal_gamma));
-		threads_leave();		
 	}
 		
 	void print_devices () {
@@ -226,6 +222,10 @@
 	public ArrayList<Device> get_devices () {
 		return devices;
 	}
+
+	public int get_num_devices () {
+		return devices.size;
+	}
 	
 	public void set_effect (Effect effect) {
 		string rgb_effects, yuv_effects;
@@ -528,7 +528,7 @@
                                     cur_video_format.height,
                                     cur_frame_rate.numerator,
                                     cur_frame_rate.denominator);
-			print ("%s\n", webcam_input);
+			print ("webcam_input: %s\n", webcam_input);
 			// FIXME: throw error
 			webcam_source_bin = (Gst.Bin)parse_bin_from_description (webcam_input, true);
 

Modified: branches/cheese-vala/src/cheese-window.vala
==============================================================================
--- branches/cheese-vala/src/cheese-window.vala	(original)
+++ branches/cheese-vala/src/cheese-window.vala	Tue Jun  3 05:54:20 2008
@@ -56,7 +56,7 @@
 	weak GConf.Client gconf_client = GConf.Client.get_default ();
 
 	Window window;
-	Widget notebook;
+	Notebook notebook;
 	Widget notebook_bar;
 
 	VBox main_vbox;
@@ -170,14 +170,49 @@
 		media_path = Path.build_filename (Environment.get_home_dir(), ".local", "share", "cheese", "media");
 		DirUtils.create_with_parents (media_path, 0775);
 		setup_ui ();
+
 		webcam = new Webcam (screen);
+
+		try {
+			Thread.create (setup_webcam, false);
+		} catch (ThreadError e) {
+			error ("Creating thread: " + e.message);
+    			return;
+		}
+	}
+	
+	public void* setup_webcam () {
 		webcam.setup ();
+		webcam.photo_saved += on_photo_saved;
+		webcam.video_saved += on_video_saved;
+		
+		//TODO fixme
+//		webcam.set_effect (0);
+		webcam.play ();
+
+		Gdk.threads_enter ();
+		notebook.set_current_page (0);
+		//ephy_spinner_stop (EPHY_SPINNER (cheese_window->throbber));
+		if (webcam.get_num_devices () == 0) {
+		   // TODO message area
+		}
+		take_picture.set_sensitive (true);
+		Gdk.threads_leave ();		
+		return null;
 	}
 
 	void on_move_all_media_to_trash (Action action) {
 
 	}
 	
+	void on_photo_saved () {
+		
+	}
+	
+	void on_video_saved () {
+		
+	}
+	
 	void on_quit (Action action) {
 		main_quit ();
 	}
@@ -225,7 +260,7 @@
 	}
 
 	void on_action_button (Button button) {
-		Audio.play_file ("/home/haitsma/Programming/gnome2/cheese/data/sounds/shutter0.ogg");
+		Audio.play_file (Path.build_filename (Config.PACKAGE_DATADIR, "sounds", "shutter0.ogg"));
 	}
 
 	void on_account_photo (Action action) {
@@ -296,7 +331,7 @@
 	
 	void setup_ui () {
 		try {
-			add_from_file (Path.build_filename (Config.PACKAGE_DATADIR, "/cheese.ui"));
+			add_from_file (Path.build_filename (Config.PACKAGE_DATADIR, "cheese.ui"));
 
 			window = (Window) get_object ("cheese_window");
 			button_effects = (Button) get_object ("button_effects");
@@ -309,7 +344,7 @@
 			label_video = (Label) get_object ("label_video");
 			main_vbox = (VBox) get_object ("main_vbox");
 			video_vbox = (VBox) get_object ("video_vbox");
-			notebook = (Widget) get_object ("notebook");
+			notebook = (Notebook) get_object ("notebook");
 			notebook_bar = (Widget) get_object ("notebook_bar");
 			screen = (DrawingArea) get_object ("video_screen");
 			take_picture = (Button) get_object ("take_picture");
@@ -321,7 +356,7 @@
 			label_take_photo.set_text_with_mnemonic ("<b>" + _("_Take a photo") + "</b>");
 			label_take_photo.set_use_markup (true);
 
-			//take_picture.set_sensitive (false);
+			take_picture.set_sensitive (false);
 
 			thumb_view = new ThumbView (media_path);
 			thumb_container.add (thumb_view);			



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