Add boop when changing actions
authorNeil <neil@dip.sun.ac.za>
Thu, 15 May 2014 18:27:04 +0000 (20:27 +0200)
committerNeil <neil@dip.sun.ac.za>
Thu, 15 May 2014 18:29:38 +0000 (20:29 +0200)
data/sounds/SOURCES.txt
data/sounds/change_action.ogg [new file with mode: 0644]
naja/widgets/info_area.py

index 7bf4b2854e972bf9c99395098b5915237b4c520f..5224bcb56abf712319f14104a87760f0cdbde30b 100644 (file)
@@ -8,3 +8,12 @@ Notes:
     Generated 2 secs of silence - dd if=/dev/zero of=silence.pcm bs=176400 count=2 ; oggenc -r silence.pcm
     Generated by Neil Muller, Aug 2010
     Not copyrightable.
+
+change_action.ogg
+-----------------
+
+Notes:
+   Generated by: tools/gen_sound.py 400 0.25 ; oggenc -o change_action.ogg -r beep1000.pcm
+   Generate by Neil Muller, May 2014
+   License: MIT-style permissive license - see LICENSE.txt
+
diff --git a/data/sounds/change_action.ogg b/data/sounds/change_action.ogg
new file mode 100644 (file)
index 0000000..e889ea1
Binary files /dev/null and b/data/sounds/change_action.ogg differ
index b5231b2a5ba946030869d2c603c74da97a89deff..babf873de9e2d177fd574be12c7259e5d050c89f 100644 (file)
@@ -9,6 +9,7 @@ from naja.constants import (INFO_SIZE, EIGHT_BIT_SCALE, ACT, KEYS,
 from naja.events import finish_event
 from naja.resources import resources
 from naja.resources.mutators import EIGHT_BIT
+from naja.sound import sound
 
 from naja.widgets.base import Widget
 from naja.widgets.tile import BIT_MAP
@@ -127,9 +128,11 @@ class InfoAreaWidget(Widget):
             if ev.key in KEYS.UP:
                 if self.chosen > 0:
                     self.chosen -= 1
+                    sound.play_sound('change_action.ogg')
                 return finish_event()
             if ev.key in KEYS.DOWN:
                 if self.chosen + 1 < len(self.card.actions):
+                    sound.play_sound('change_action.ogg')
                     self.chosen += 1
                 return finish_event()
         return super(InfoAreaWidget, self).handle_event(ev)