[longomatch/livecapturemerged: 70/84] Don't allow creating new plays if the capturer is not recording



commit ce97abb36e47eec9d8802c1cd319e1fc7ebaf06b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed May 5 22:17:00 2010 +0200

    Don't allow creating new plays if the capturer is not recording

 CesarPlayer/Gui/CapturerBin.cs       |   11 +++++++++++
 LongoMatch/Handlers/EventsManager.cs |    9 ++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/CesarPlayer/Gui/CapturerBin.cs b/CesarPlayer/Gui/CapturerBin.cs
index dd85449..45fc96f 100644
--- a/CesarPlayer/Gui/CapturerBin.cs
+++ b/CesarPlayer/Gui/CapturerBin.cs
@@ -47,6 +47,7 @@ namespace LongoMatch.Gui
 		private GccAudioEncoderType audioEncoder;
 		private GccVideoMuxerType videoMuxer;
 		private string outputFile;
+		private bool capturing;
 		private const int THUMBNAIL_MAX_WIDTH = 100;		
 		
 		ICapturer capturer;
@@ -142,6 +143,12 @@ namespace LongoMatch.Gui
 			}
 		}
 		
+		public bool Capturing{
+			get{
+				return capturing;
+			}
+		}
+		
 		public CapturePropertiesStruct CaptureProperties{
 			set{
 				outputWidth = value.Width;
@@ -155,15 +162,18 @@ namespace LongoMatch.Gui
 		}
 		
 		public void TogglePause(){
+			capturing = !capturing;
 			capturer.TogglePause();
 		}
 		
 		public void Start(){
 			capturer.Start();
+			capturing = true;
 		}
 		
 		public void Stop(){
 			capturer.Stop();
+			capturing = false;
 		}
 		
 		public void Run(){
@@ -172,6 +182,7 @@ namespace LongoMatch.Gui
 
 		public void Close(){
 			capturer.Close();
+			capturing = false;
 		}
 		
 		public Pixbuf CurrentMiniatureFrame {
diff --git a/LongoMatch/Handlers/EventsManager.cs b/LongoMatch/Handlers/EventsManager.cs
index b33e16a..e64c169 100644
--- a/LongoMatch/Handlers/EventsManager.cs
+++ b/LongoMatch/Handlers/EventsManager.cs
@@ -175,8 +175,15 @@ namespace LongoMatch
 			Pixbuf miniature;
 			MediaTimeNode tn;
 		
-			if (projectType == ProjectType.CaptureProject)
+			if (projectType == ProjectType.CaptureProject){
+				if (!capturer.Capturing){
+					MessagePopup.PopupMessage(capturer, MessageType.Info,
+					                          Catalog.GetString("You can't create a new play if the capturer "+
+					                                            "is not recording."));
+					return;
+				}
 				miniature = capturer.CurrentMiniatureFrame;
+			}
 			else if (projectType == ProjectType.FileProject)
 				miniature = player.CurrentMiniatureFrame;
 			else 



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