[ease/presenter: 11/11] Adds a timer and start positionning actors around.



commit 379c7edd9dbd4398429567e92072195b5acbd828
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Mon Aug 16 16:57:59 2010 -0500

    Adds a timer and start positionning actors around.

 ease/ease-player.vala           |    8 ++++++--
 ease/ease-presenter-window.vala |   21 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/ease/ease-player.vala b/ease/ease-player.vala
index df0fb41..af1a9c2 100644
--- a/ease/ease-player.vala
+++ b/ease/ease-player.vala
@@ -50,7 +50,10 @@ internal class Ease.Player : Gtk.Window
 	private Clutter.CairoTexture focus_circle;
 	private Cairo.Pattern radial;
 	private Cairo.Context cr;
-	
+
+	// presenter notes
+	private PresenterWindow presenter;
+
 	internal signal void complete();
 	
 	internal Player(Document doc)
@@ -149,7 +152,8 @@ internal class Ease.Player : Gtk.Window
 		show_all();
 		present();
 		
-		presenter_window = new PresenterWindow (this.document);
+		presenter = new PresenterWindow (this.document);
+		presenter.show_all ();
 		can_animate = true;
 		advance();
 	}
diff --git a/ease/ease-presenter-window.vala b/ease/ease-presenter-window.vala
index 62d9c55..d432d4f 100644
--- a/ease/ease-presenter-window.vala
+++ b/ease/ease-presenter-window.vala
@@ -25,23 +25,42 @@ internal class Ease.PresenterWindow : Gtk.Window
 	private Clutter.Text time_elapsed;
 	private Clutter.Text slides_elapsed;
 	
+	/* other data */
+	Timer timer;
+
 	internal PresenterWindow (Document doc)
 	{
 		document = doc;
 		slide_index = -1;
 
+		timer = new Timer ();
 		this.title = _("Presenter window");
 
 		var embed = new GtkClutter.Embed ();
+		embed.set_size_request (doc.width, doc.height);
 		this.add (embed);
 		stage = embed.get_stage () as Clutter.Stage;
 
 		current_display = new Clutter.Group ();
 		bottom_display = new Clutter.Group ();
 
+		int docsize = doc.length;
+		var slidenum = @"Slide n°$slide_index / $docsize";
+		var elapsed = (uint)timer.elapsed ();
 		slides_elapsed = new Clutter.Text.full ("Sans 20",
-												@"Slide n°$slide_index/$doc.length",
+												slidenum,
 											    Clutter.Color.from_string ("white"));
+		time_elapsed = new Clutter.Text.full ("Sans 20",
+											  @"$elapsed s",
+											  Clutter.Color.from_string ("white"));
+		time_elapsed.set_position (stage.width - time_elapsed.width,
+								   stage.height - time_elapsed.height);
+		bottom_display.set_position (0, stage.height/4*3);
+		bottom_display.add (slides_elapsed,
+							time_elapsed,
+							null);
+		stage.add (current_display,
+				   bottom_display);
 		stage.color = { 0, 0, 0, 255 };
 		stage.set_fullscreen (true);
 		stage.show_all ();



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