-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSong.h
54 lines (44 loc) · 906 Bytes
/
Song.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Arduino Library for VS10XX Decoder & FatFs
* (c) 2010, David Sirkin [email protected]
*/
#ifndef SONG_H
#define SONG_H
#include <Id3Tag.h>
#include <JsonHandler.h>
class Song
{
public:
Song();
void setup(JsonHandler *handler);
void loop();
void pause();
void play();
int seek(int percent);
double setVolume(int volume_percentage);
int getVolume();
bool nextFile();
bool prevFile();
void setSong(int songNumber);
uint32_t getFileSize();
bool isPlaying();
char* getTitle();
char* getArtist();
char* getAlbum();
char* getTime();
void sendPlayerState();
void sendSongInfo();
private:
JsonHandler *handler;
void sd_file_open();
bool nextFileExists();
bool prevFileExists();
void dir_play();
void mp3_play();
void sd_card_setup();
void sd_dir_setup();
void map_current_song_to_fn();
void initPlayerStateFromEEPROM();
void sendSongInfo(bool first);
};
#endif