2
player.h@1:17913cff05a2, 2017-12-09 (annotated)
- Committer:
- csggreen
- Date:
- Sat Dec 09 14:21:59 2017 +0000
- Revision:
- 1:17913cff05a2
- Parent:
- 0:58524d569dfd
- Child:
- 2:a59255e80c0d
gwev
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cha45689 | 0:58524d569dfd | 1 | #ifndef PLAYER_H |
cha45689 | 0:58524d569dfd | 2 | #define PLAYER_H |
cha45689 | 0:58524d569dfd | 3 | #include "vs10xx.h" |
cha45689 | 0:58524d569dfd | 4 | |
cha45689 | 0:58524d569dfd | 5 | /** Playing states definations. */ |
cha45689 | 0:58524d569dfd | 6 | volatile typedef enum { |
cha45689 | 0:58524d569dfd | 7 | PS_STOP, // Player stop |
csggreen | 1:17913cff05a2 | 8 | PS_PLAY, // Start to player |
cha45689 | 0:58524d569dfd | 9 | } playerStatetype; |
cha45689 | 0:58524d569dfd | 10 | |
cha45689 | 0:58524d569dfd | 11 | /** Control states definations. */ |
cha45689 | 0:58524d569dfd | 12 | volatile typedef enum |
cha45689 | 0:58524d569dfd | 13 | { |
cha45689 | 0:58524d569dfd | 14 | CS_EMPTY = 0, // Have no control |
cha45689 | 0:58524d569dfd | 15 | CS_PLAYPAUSE, // Play/pause button pressed |
cha45689 | 0:58524d569dfd | 16 | CS_RECORDING, // Play/pause button long pressed |
cha45689 | 0:58524d569dfd | 17 | CS_UP, // Up button pressed |
cha45689 | 0:58524d569dfd | 18 | CS_DOWN, // Down button pressed |
cha45689 | 0:58524d569dfd | 19 | CS_NEXT, // Right button pressed |
cha45689 | 0:58524d569dfd | 20 | CS_PREV, // Left button pressed |
cha45689 | 0:58524d569dfd | 21 | } ctrlStatetype; |
cha45689 | 0:58524d569dfd | 22 | |
cha45689 | 0:58524d569dfd | 23 | class Player |
cha45689 | 0:58524d569dfd | 24 | { |
cha45689 | 0:58524d569dfd | 25 | public: |
cha45689 | 0:58524d569dfd | 26 | void begin(void); |
cha45689 | 0:58524d569dfd | 27 | void playFile(char *file); |
csggreen | 1:17913cff05a2 | 28 | void playfile(char n); |
csggreen | 1:17913cff05a2 | 29 | void getsong(void); |
csggreen | 1:17913cff05a2 | 30 | void readswitch(void); |
csggreen | 1:17913cff05a2 | 31 | void stop(void); |
cha45689 | 0:58524d569dfd | 32 | private: |
cha45689 | 0:58524d569dfd | 33 | |
cha45689 | 0:58524d569dfd | 34 | }; |
cha45689 | 0:58524d569dfd | 35 | |
cha45689 | 0:58524d569dfd | 36 | #endif |
cha45689 | 0:58524d569dfd | 37 |