
player 1
Dependencies: 4DGL-uLCD-SE PinDetect SparkfunAnalogJoystick mbed-rtos mbed SDFileSystem
Fork of 4180FinalLab by
Wireless 2 Player Pong game
soundBuilder.h@6:9cdde66d7502, 2016-04-26 (annotated)
- Committer:
- Mpmart08
- Date:
- Tue Apr 26 18:54:13 2016 +0000
- Revision:
- 6:9cdde66d7502
- Parent:
- 3:591086e44bf9
stuff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jlind6 | 0:356124c0bafc | 1 | #include "Speaker.h" |
jlind6 | 0:356124c0bafc | 2 | |
jlind6 | 0:356124c0bafc | 3 | class Note |
jlind6 | 0:356124c0bafc | 4 | { |
jlind6 | 0:356124c0bafc | 5 | public: |
rishibhargava1 | 3:591086e44bf9 | 6 | // Constructor |
rishibhargava1 | 3:591086e44bf9 | 7 | Note (); |
rishibhargava1 | 3:591086e44bf9 | 8 | Note (float, float, float); |
rishibhargava1 | 3:591086e44bf9 | 9 | // setters |
rishibhargava1 | 3:591086e44bf9 | 10 | void setFreq(float); |
rishibhargava1 | 3:591086e44bf9 | 11 | void setLength(float); |
rishibhargava1 | 3:591086e44bf9 | 12 | void setVolume(float); |
rishibhargava1 | 3:591086e44bf9 | 13 | // getters |
rishibhargava1 | 3:591086e44bf9 | 14 | float getFreq(); |
rishibhargava1 | 3:591086e44bf9 | 15 | float getLength(); |
rishibhargava1 | 3:591086e44bf9 | 16 | float getVolume(); |
jlind6 | 0:356124c0bafc | 17 | private: |
jlind6 | 0:356124c0bafc | 18 | float freq; |
jlind6 | 0:356124c0bafc | 19 | float length; |
jlind6 | 0:356124c0bafc | 20 | float volume; |
jlind6 | 0:356124c0bafc | 21 | }; |
jlind6 | 0:356124c0bafc | 22 | |
jlind6 | 0:356124c0bafc | 23 | class SoundBuilder |
jlind6 | 0:356124c0bafc | 24 | { |
jlind6 | 0:356124c0bafc | 25 | public: |
rishibhargava1 | 3:591086e44bf9 | 26 | // Set Song |
rishibhargava1 | 3:591086e44bf9 | 27 | SoundBuilder (float [], float [], float [], int, Speaker *); |
rishibhargava1 | 3:591086e44bf9 | 28 | // Set sound, where int is the note number starting from 0 |
rishibhargava1 | 3:591086e44bf9 | 29 | void setNote(float, float, float, int); |
jlind6 | 0:356124c0bafc | 30 | // Play Sounds |
rishibhargava1 | 3:591086e44bf9 | 31 | void playNotes(int, int); |
jlind6 | 0:356124c0bafc | 32 | // Play Songs |
rishibhargava1 | 3:591086e44bf9 | 33 | void playSong(); |
jlind6 | 0:356124c0bafc | 34 | // Clear Songs |
rishibhargava1 | 3:591086e44bf9 | 35 | void clearSong(); |
jlind6 | 0:356124c0bafc | 36 | |
jlind6 | 0:356124c0bafc | 37 | private: |
jlind6 | 0:356124c0bafc | 38 | Note song[20]; |
jlind6 | 0:356124c0bafc | 39 | Speaker *speaker; |
jlind6 | 0:356124c0bafc | 40 | |
jlind6 | 0:356124c0bafc | 41 | }; |