From 9d16741e86873a84b2e518906adf0111b95103dd Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 15 May 2014 20:27:04 +0200 Subject: [PATCH 1/1] Add boop when changing actions --- data/sounds/SOURCES.txt | 9 +++++++++ data/sounds/change_action.ogg | Bin 0 -> 5700 bytes naja/widgets/info_area.py | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 data/sounds/change_action.ogg diff --git a/data/sounds/SOURCES.txt b/data/sounds/SOURCES.txt index 7bf4b28..5224bcb 100644 --- a/data/sounds/SOURCES.txt +++ b/data/sounds/SOURCES.txt @@ -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 index 0000000000000000000000000000000000000000..e889ea1da504636745edbbcbdae7db73962618df GIT binary patch literal 5700 zcmeHLc~Dcy*6)M>0TB|28Ze^)6D1flXdJFS;vb?@GI67Z_Rqv~s@2^*{tJC-Na+dy` zbGy%tb8xU5z=DZV+7ujuka^L%S(q7^-8;eqL=ngU*6uX&06<)cL7(R_&Isq91>r9;ke(BXt4Gie&{W)!Z#G#6NO#(DumS z;GkU$L_9`Q%}nR5@W22L0JI3Q#Y$zwR0+X^=VIJL;oS-CH|DJ&#!?on@oA<rJ~#F@A#j$9|3=covet|H z#d??`vA6Lgz_Axpi2?7tBJQ*eTufW!;1Z{0^MWF2V46!~8(HV4N^pzJlVhK=uHTEB z#7k7fIW8JDkpy$2rmA(&xDKgtTHNbo$x1G?K+EPlNz%+MFp*f;;Acvx>`hZZDgZfo z=F&WKU4lu4F1QW=f#XWLwv%$>2<1jOWfFd}mnH-Q;Ndz4X}&|s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q29fFi65xK?(6?qhvpi+# z2Bl98PCTNE2nJ{0FE_x5uO7H*jCOY;0mJc~24=#yZX5&9{|wd6D+6kbI*?eZ*8;=+ zFWaGIdzNX>H>{24yB}CF>~A${2;HLETq1;Y^Dv(Dv+N2kX_JL?YaC9(cb=NZ*+Zp_WO9u z9avK7{c%iHdtCVXP}HNofs14BUT>=#Jh!-X)O%lb_oMBf1|M=ZU;e(dcMW3`%-Klf zuF8-@h+C-D^MMThTc&l=<7U!@ig~@4%06At-R*nfyZ(X9OD6+IKltr<|9P8#i>aPRXL*Xx^jR$ItdFAuSilAw4%vPiP2A_-om--(b>?ZE z&EwvG+)m6(HnTvYheTR~`n2b_4b|EG`!A~e#s>ZRs-7NcZXUljfBw7~13$cL9v|KF zsrtY`=ef6g9&fmGY0&S}?*k*YJ4zqFkLii-%lPo}T=wx`{m!n=Jtsse<2_NE6<0#N zG>*^6%1Ai(>6eV?s0-bL$Af$QYq|$>gB2qE(jdQt(8q(h3Bjt2?Vr4NM4aFI$-9#> mSW$XqQ9|eERs+<_i?YX^-_B(KBkPgptwYo5^kOG#fPVpYYBst6 literal 0 HcmV?d00001 diff --git a/naja/widgets/info_area.py b/naja/widgets/info_area.py index b5231b2..babf873 100644 --- a/naja/widgets/info_area.py +++ b/naja/widgets/info_area.py @@ -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) -- 2.34.1