PVP Wireless Pong

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

Fork of ECE2036Lab2StarterCode by Joseph Lind

soundBuilder.h

Committer:
Mpmart08
Date:
2016-04-27
Revision:
7:7f2393b8ba4a
Parent:
3:591086e44bf9

File content as of revision 7:7f2393b8ba4a:

#include "Speaker.h"

class Note
{
public:
    // Constructor
    Note ();
    Note (float, float, float);
    // setters
    void setFreq(float);
    void setLength(float);
    void setVolume(float);
    // getters
    float getFreq();
    float getLength();
    float getVolume();
private:
    float freq;
    float length;
    float volume;
};

class SoundBuilder
{
public:
    // Set Song
    SoundBuilder (float [], float [], float [], int, Speaker *);
    // Set sound, where int is the note number starting from 0
    void setNote(float, float, float, int);
    // Play Sounds
    void playNotes(int, int);
    // Play Songs
    void playSong();
    // Clear Songs
    void clearSong();

private:
    Note song[20];
    Speaker *speaker;
    
};