gnome-subtitles r1056 - trunk/src/GnomeSubtitles/Ui/VideoPreview



Author: pcastro
Date: Fri Oct  3 23:01:47 2008
New Revision: 1056
URL: http://svn.gnome.org/viewvc/gnome-subtitles?rev=1056&view=rev

Log:
Allow to return the FrameRate and Seek to a specified frame.

Modified:
   trunk/src/GnomeSubtitles/Ui/VideoPreview/Video.cs

Modified: trunk/src/GnomeSubtitles/Ui/VideoPreview/Video.cs
==============================================================================
--- trunk/src/GnomeSubtitles/Ui/VideoPreview/Video.cs	(original)
+++ trunk/src/GnomeSubtitles/Ui/VideoPreview/Video.cs	Fri Oct  3 23:01:47 2008
@@ -20,6 +20,7 @@
 using GnomeSubtitles.Core;
 using GnomeSubtitles.Dialog;
 using Gtk;
+using SubLib.Core;
 using SubLib.Core.Domain;
 using System;
 using System.Text.RegularExpressions;
@@ -87,6 +88,10 @@
 		get { return isLoaded; }
 	}
 	
+	public float FrameRate {
+		get { return player.FrameRate; }
+	}
+	
 	/* Public methods */
 	
 	public void Show () {
@@ -170,6 +175,14 @@
 		player.Seek(time);
 	}
 	
+	public void Seek (int frames) {
+		if (!isLoaded)
+			return;
+
+		TimeSpan time = Synchronization.FramesToTime(frames, this.FrameRate);
+		Seek(time);
+	}
+	
 	public void SeekToSelection () { //TODO check out
 		Subtitle subtitle = Core.Base.Ui.View.Selection.Subtitle;
     	TimeSpan time = subtitle.Times.Start;



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