[chronojump] Chronopic win plays sound when connected



commit f10875e71cf719b845eb22843adf978dcee8fdd5
Author: Xavier de Blas <xaviblas master gnome org>
Date:   Wed Jun 2 15:34:09 2010 +0800

    Chronopic win plays sound when connected

 src/gui/chronojump.cs |    4 ++--
 src/gui/chronopic.cs  |   10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 906ffe0..00ba339 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -504,7 +504,7 @@ public class ChronoJumpWindow
 			ChronopicPortData a = new ChronopicPortData(i,"",false);
 			cpd.Add(a);
 		}
-		chronopicWin = ChronopicWindow.Create(cpd, recreate);
+		chronopicWin = ChronopicWindow.Create(cpd, recreate, volumeOn);
 	}
 
 
@@ -3810,7 +3810,7 @@ Console.WriteLine("X");
 	 */
 
 	private void on_menuitem_chronopic_activate (object o, EventArgs args) {
-		chronopicWin = ChronopicWindow.View();
+		chronopicWin = ChronopicWindow.View(volumeOn);
 		chronopicWin.FakeWindowDone.Clicked += new EventHandler(on_chronopic_window_done);
 	}
 	
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 3cb62ef..6aac2cf 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -97,6 +97,7 @@ public class ChronopicWindow
 		OFF
 	}
 	bool connected;
+	bool volumeOn;
 	int currentCp; //1 to 4
 
 	//cp1	
@@ -153,7 +154,7 @@ public class ChronopicWindow
 	}
 	
 	//recreate is used when a Chronopic was disconnected
-	static public ChronopicWindow Create (ArrayList myCpd, bool recreate)
+	static public ChronopicWindow Create (ArrayList myCpd, bool recreate, bool volumeOn)
 	{
 		if (ChronopicWindowBox == null || recreate) {
 			ChronopicWindowBox = new ChronopicWindow (myCpd);
@@ -161,18 +162,21 @@ public class ChronopicWindow
 		
 		//don't show until View is called
 		//ChronopicWindowBox.chronopic_window.Show ();
+		
+		ChronopicWindowBox.volumeOn = volumeOn;
 
 		ChronopicWindowBox.fakeWindowDone = new Gtk.Button();
 		
 		return ChronopicWindowBox;
 	}
 
-	static public ChronopicWindow View ()
+	static public ChronopicWindow View (bool volumeOn)
 	{
 		if (ChronopicWindowBox == null) {
 			ChronopicWindowBox = new ChronopicWindow (cpd);
 		}
 		
+		ChronopicWindowBox.volumeOn = volumeOn;
 		ChronopicWindowBox.createCombos();
 		ChronopicWindowBox.chronopic_window.Show();
 	
@@ -608,9 +612,11 @@ public class ChronopicWindow
 		Log.WriteLine(string.Format("wait_chronopic_start {0}", message));
 			
 		if(success) {
+			Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn);
 			updateChronopicWinValuesState= true; //connected
 			updateChronopicWinValuesMessage= message;
 		} else {
+			Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
 			updateChronopicWinValuesState= false; //disconnected
 			updateChronopicWinValuesMessage= message;
 		}



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