Elements used in the Balls and Things games for the RETRO.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
SoundFx.cpp@8:19dd2a538cbe, 2015-03-02 (annotated)
- Committer:
- maxint
- Date:
- Mon Mar 02 09:58:53 2015 +0000
- Revision:
- 8:19dd2a538cbe
- Parent:
- 7:4fa3edaa1201
more clean-up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maxint | 0:3d0db4e183ee | 1 | #include "SoundFX.h" |
maxint | 0:3d0db4e183ee | 2 | |
maxint | 1:71185a0aadfc | 3 | SoundFX::SoundFX() : music(P0_18) |
maxint | 0:3d0db4e183ee | 4 | { |
maxint | 0:3d0db4e183ee | 5 | this->fMute=false; |
maxint | 0:3d0db4e183ee | 6 | music.setCompletionCallback(this, &SoundFX::musicCompleted); |
maxint | 0:3d0db4e183ee | 7 | } |
maxint | 0:3d0db4e183ee | 8 | |
maxint | 0:3d0db4e183ee | 9 | void SoundFX::musicCompleted(void) |
maxint | 0:3d0db4e183ee | 10 | { |
maxint | 1:71185a0aadfc | 11 | |
maxint | 0:3d0db4e183ee | 12 | } |
maxint | 0:3d0db4e183ee | 13 | |
maxint | 0:3d0db4e183ee | 14 | void SoundFX::reset() |
maxint | 0:3d0db4e183ee | 15 | { |
maxint | 0:3d0db4e183ee | 16 | |
maxint | 0:3d0db4e183ee | 17 | } |
maxint | 0:3d0db4e183ee | 18 | |
maxint | 0:3d0db4e183ee | 19 | void SoundFX::setMute(bool fMute) |
maxint | 0:3d0db4e183ee | 20 | { |
maxint | 0:3d0db4e183ee | 21 | this->fMute=fMute; |
maxint | 0:3d0db4e183ee | 22 | } |
maxint | 0:3d0db4e183ee | 23 | |
maxint | 0:3d0db4e183ee | 24 | |
maxint | 0:3d0db4e183ee | 25 | bool SoundFX::getMute() |
maxint | 0:3d0db4e183ee | 26 | { |
maxint | 0:3d0db4e183ee | 27 | return(this->fMute); |
maxint | 0:3d0db4e183ee | 28 | } |
maxint | 0:3d0db4e183ee | 29 | |
maxint | 0:3d0db4e183ee | 30 | |
maxint | 0:3d0db4e183ee | 31 | void SoundFX::beep(int nDuration) //nDuration=1 |
maxint | 0:3d0db4e183ee | 32 | { |
maxint | 0:3d0db4e183ee | 33 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 34 | return; |
maxint | 1:71185a0aadfc | 35 | music.play("T240 L16 O6 C"); |
maxint | 0:3d0db4e183ee | 36 | } |
maxint | 0:3d0db4e183ee | 37 | |
maxint | 0:3d0db4e183ee | 38 | void SoundFX::beepShort() |
maxint | 0:3d0db4e183ee | 39 | { |
maxint | 0:3d0db4e183ee | 40 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 41 | return; |
maxint | 1:71185a0aadfc | 42 | |
maxint | 0:3d0db4e183ee | 43 | music.play("T240 L32 O6 C"); |
maxint | 0:3d0db4e183ee | 44 | } |
maxint | 0:3d0db4e183ee | 45 | |
maxint | 0:3d0db4e183ee | 46 | void SoundFX::beepLong() |
maxint | 0:3d0db4e183ee | 47 | { |
maxint | 0:3d0db4e183ee | 48 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 49 | return; |
maxint | 0:3d0db4e183ee | 50 | music.play("T240 L8 O5 C"); |
maxint | 0:3d0db4e183ee | 51 | } |
maxint | 0:3d0db4e183ee | 52 | |
maxint | 0:3d0db4e183ee | 53 | void SoundFX::beepLow() |
maxint | 0:3d0db4e183ee | 54 | { |
maxint | 0:3d0db4e183ee | 55 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 56 | return; |
maxint | 0:3d0db4e183ee | 57 | music.play("T180 L4 O3 C"); |
maxint | 0:3d0db4e183ee | 58 | } |
maxint | 0:3d0db4e183ee | 59 | |
maxint | 0:3d0db4e183ee | 60 | void SoundFX::play(char *szPlay) |
maxint | 0:3d0db4e183ee | 61 | { |
maxint | 0:3d0db4e183ee | 62 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 63 | return; |
maxint | 0:3d0db4e183ee | 64 | music.play(szPlay); |
maxint | 0:3d0db4e183ee | 65 | } |
maxint | 0:3d0db4e183ee | 66 | |
maxint | 0:3d0db4e183ee | 67 | void SoundFX::playTune() |
maxint | 0:3d0db4e183ee | 68 | { |
maxint | 0:3d0db4e183ee | 69 | if(this->fMute) |
maxint | 0:3d0db4e183ee | 70 | return; |
maxint | 0:3d0db4e183ee | 71 | // music.setCompletionCallback(this, &SoundFX::musicCompleted); |
maxint | 7:4fa3edaa1201 | 72 | music.play("T224L8O5CL16>C<P16GP16L8EL16P16>C<GP16L8E.L16P16L8C#L16>C#<P16G#P16L8FL16P16>C#<G#P16L8F.L16P16L8CL16>C<P16GP16L8EL16P16>C<GP16L8E.L16P16D#EFP16FF#GP16GG#AP16L8>C<P8L4>C"); |
maxint | 0:3d0db4e183ee | 73 | } |