Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
SoundFx.cpp
00001 #include "SoundFX.h" 00002 00003 SoundFX::SoundFX() : music(P0_18) 00004 { 00005 this->fMute=false; 00006 music.setCompletionCallback(this, &SoundFX::musicCompleted); 00007 } 00008 00009 void SoundFX::musicCompleted(void) 00010 { 00011 00012 } 00013 00014 void SoundFX::reset() 00015 { 00016 00017 } 00018 00019 void SoundFX::setMute(bool fMute) 00020 { 00021 this->fMute=fMute; 00022 } 00023 00024 00025 bool SoundFX::getMute() 00026 { 00027 return(this->fMute); 00028 } 00029 00030 00031 void SoundFX::beep(int nDuration) //nDuration=1 00032 { 00033 if(this->fMute) 00034 return; 00035 music.play("T240 L16 O6 C"); 00036 } 00037 00038 void SoundFX::beepShort() 00039 { 00040 if(this->fMute) 00041 return; 00042 00043 music.play("T240 L32 O6 C"); 00044 } 00045 00046 void SoundFX::beepLong() 00047 { 00048 if(this->fMute) 00049 return; 00050 music.play("T240 L8 O5 C"); 00051 } 00052 00053 void SoundFX::beepLow() 00054 { 00055 if(this->fMute) 00056 return; 00057 music.play("T180 L4 O3 C"); 00058 } 00059 00060 void SoundFX::play(char *szPlay) 00061 { 00062 if(this->fMute) 00063 return; 00064 music.play(szPlay); 00065 } 00066 00067 void SoundFX::playTune() 00068 { 00069 if(this->fMute) 00070 return; 00071 // music.setCompletionCallback(this, &SoundFX::musicCompleted); 00072 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"); 00073 }
Generated on Thu Jul 14 2022 10:55:45 by
1.7.2