-
Notifications
You must be signed in to change notification settings - Fork 1
/
PlayerControl.h
103 lines (77 loc) · 1.84 KB
/
PlayerControl.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* PlayerControl.h
*
* Copyright (c) 2018 Yulay Rakhmangulov.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLAYERCONTROL_H_
#define PLAYERCONTROL_H_
#include <stdint.h>
#include <stdbool.h>
void Player_LoadState();
void Player_Update();
void Player_InitializeUsb();
void Player_InitializeSd();
void Player_PlayTrack();
void Player_Play();
void Player_Pause();
void Player_PlayNext();
void Player_PlayPrev();
void Player_NextFolder();
void Player_PrevFolder();
void PlayNormal();
void PlayLoopAll();
void PlayLoopOne();
void PlayAllRandom();
void RequestCurrTrack();
enum eMode
{
All = 1,
None = 5,
One = 9,
RandomAll = 0x0d
};
enum
{
Randomizator = 63, //odd number
MaxFileNum = 2999,
MaxFolderNum = 99,
FolderSize = 16,
FolderSizeMax = 32
};
struct PlayerState
{
//Non persistent model
uint8_t device; // USB or SD or AUX
uint8_t deviceMask;
uint8_t loopMode; //All, None, One, Random All
//Persistent model
//presentation
uint8_t folder; //virtual folder #
uint8_t folderSize; //files per virtual folder
uint8_t maxFolders; //max folders
union
{
uint16_t fileNum; //global file number on media (USB/SD)
uint8_t file[2];
};
union
{
uint16_t totalFiles;
uint8_t total[2];
};
//uint8_t crc8;
};
extern struct PlayerState gPlay;
#endif /* PLAYERCONTROL_H_ */