Big Mouth Billy Bass player that takes raw wavefiles and decision list text files from an SD card
Dependencies: SDFileSystem mbed BillyBass
action.hpp@5:5b846ef42702, 2013-06-15 (annotated)
- Committer:
- bikeNomad
- Date:
- Sat Jun 15 03:32:20 2013 +0000
- Revision:
- 5:5b846ef42702
separated into multiple files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bikeNomad | 5:5b846ef42702 | 1 | #ifndef __included_action_hpp |
bikeNomad | 5:5b846ef42702 | 2 | #define __included_action_hpp |
bikeNomad | 5:5b846ef42702 | 3 | |
bikeNomad | 5:5b846ef42702 | 4 | #include "billybass.hpp" |
bikeNomad | 5:5b846ef42702 | 5 | |
bikeNomad | 5:5b846ef42702 | 6 | struct Action |
bikeNomad | 5:5b846ef42702 | 7 | { |
bikeNomad | 5:5b846ef42702 | 8 | float actionTime; |
bikeNomad | 5:5b846ef42702 | 9 | bool desiredState; |
bikeNomad | 5:5b846ef42702 | 10 | DigitalOut *output; |
bikeNomad | 5:5b846ef42702 | 11 | |
bikeNomad | 5:5b846ef42702 | 12 | bool operator < (Action const &other) const { |
bikeNomad | 5:5b846ef42702 | 13 | return actionTime < other.actionTime; |
bikeNomad | 5:5b846ef42702 | 14 | } |
bikeNomad | 5:5b846ef42702 | 15 | |
bikeNomad | 5:5b846ef42702 | 16 | bool isValid() |
bikeNomad | 5:5b846ef42702 | 17 | { |
bikeNomad | 5:5b846ef42702 | 18 | return actionTime >= 0.0 && output != 0; |
bikeNomad | 5:5b846ef42702 | 19 | } |
bikeNomad | 5:5b846ef42702 | 20 | |
bikeNomad | 5:5b846ef42702 | 21 | Action() : actionTime(-1.0) |
bikeNomad | 5:5b846ef42702 | 22 | , desiredState(false) |
bikeNomad | 5:5b846ef42702 | 23 | , output(0) { |
bikeNomad | 5:5b846ef42702 | 24 | } |
bikeNomad | 5:5b846ef42702 | 25 | |
bikeNomad | 5:5b846ef42702 | 26 | bool parseLine(char const *line) |
bikeNomad | 5:5b846ef42702 | 27 | { |
bikeNomad | 5:5b846ef42702 | 28 | // TODO |
bikeNomad | 5:5b846ef42702 | 29 | return true; |
bikeNomad | 5:5b846ef42702 | 30 | } |
bikeNomad | 5:5b846ef42702 | 31 | }; |
bikeNomad | 5:5b846ef42702 | 32 | |
bikeNomad | 5:5b846ef42702 | 33 | #endif |