Rishi Bhargava / Mbed 2 deprecated 4180FinalLab

Dependencies:   4DGL-uLCD-SE PinDetect mbed SparkfunAnalogJoystick mbed-rtos

Fork of ECE2036Lab2StarterCode by Joseph Lind

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers soundBuilder.h Source File

soundBuilder.h

00001 #include "Speaker.h"
00002 
00003 class Note
00004 {
00005 public:
00006     // Constructor
00007     Note ();
00008     Note (float, float, float);
00009     // setters
00010     void setFreq(float);
00011     void setLength(float);
00012     void setVolume(float);
00013     // getters
00014     float getFreq();
00015     float getLength();
00016     float getVolume();
00017 private:
00018     float freq;
00019     float length;
00020     float volume;
00021 };
00022 
00023 class SoundBuilder
00024 {
00025 public:
00026     // Set Song
00027     SoundBuilder (float [], float [], float [], int, Speaker *);
00028     // Set sound, where int is the note number starting from 0
00029     void setNote(float, float, float, int);
00030     // Play Sounds
00031     void playNotes(int, int);
00032     // Play Songs
00033     void playSong();
00034     // Clear Songs
00035     void clearSong();
00036 
00037 private:
00038     Note song[20];
00039     Speaker *speaker;
00040     
00041 };