-
Notifications
You must be signed in to change notification settings - Fork 0
/
SongList.h
67 lines (63 loc) · 1.9 KB
/
SongList.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
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __SONGLIST_H__
#define __SONGLIST_H__
#include "Arduino.h"
#include <string.h>
#include <SD.h>
#include <SerialFlash.h>
#define ListSize 5
#define MaxName 25
class SongList{
private:
char **Songlist = 0;
uint16_t numsongs;
uint16_t listsize_r = ListSize;
uint16_t counter = 0;
uint16_t counter_limit = 0;
void initializeSongList();
void AddMoreListMember(size_t Size);
char* stringUpper(char* string_in);
public:
uint16_t CurrentTrackNo;
/*
SongList Class Constructor
Initializes the list data structure
*/
SongList();
/*
Displays all the contents in the list. Data is output to the serial port.
*/
void DisplayListContents();
/*
Displays the current 10 tracks that can be selected. The data is output to the serial port.
*/
void DisplayCurrentList();
/*
Finds all the .Wav files in a specified directory. Fills the internal data structure with their name.
ParameterL rootDir: File pointer to the directory that you want to search the tracks in.
*/
void SearchSongs(File rootDir);
/*
checks if the selected song is in the list. Returns the postiton of the song, otherwise returns -1.
Parameter: tracknum, a character which should be from 0-9.
*/
int isInList(char tracknum);
/*
Outputs the track name corresponding to the tracknum selected.
Parameter: tracknum, uint16_t track number selected to play.
Returns: pointer to the string containing the track name.
*/
char* SendTrack(uint16_t tracknum);
/*
Moves the internal track selector forward by 10 tracks.
Outputs the list of track that can be selected.
Data is output to the serial port.
*/
void Fwd();
/*
Moves the internal track selector backward by 10 tracks.
Outputs the list of track that can be selected.
Data is output to the serial port.
*/
void Bwd();
};
#endif