changeset 28:6854dc3a8273

Print a nice error message when sound is unavailable committer: Jeff <jeffpc@batlh.(none)> 1121808535 -0400
author Jeff <jeffpc@batlh.(none)>
date Tue, 19 Jul 2005 21:28:55 -0400
parents 8ad7abaf91e4
children 6882f67524d8
files TODO atc.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Mon Jul 18 18:55:58 2005 -0400
+++ b/TODO	Tue Jul 19 21:28:55 2005 -0400
@@ -7,4 +7,3 @@
 * Implement communication breakdown
 * Implement emergency situations
 * Implement nav beacons
-* Fix no available sound device error
--- a/atc.py	Mon Jul 18 18:55:58 2005 -0400
+++ b/atc.py	Tue Jul 19 21:28:55 2005 -0400
@@ -52,7 +52,11 @@
 	pygame.display.set_caption('Air Traffic Controller (' + version + ')')
 	
 	# background music
-	pygame.mixer.init()
+	try:
+		pygame.mixer.init()
+	except pygame.error:
+		print "Could not init sound"
+		sys.exit(1)
 	#atc_utils.playmusic("some.mp3");
 
 	# Set background