-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreenLayout.h
More file actions
49 lines (39 loc) · 1.24 KB
/
screenLayout.h
File metadata and controls
49 lines (39 loc) · 1.24 KB
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
/*
* ------------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <ramo@goodvikings.com> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return - Ramo
* ------------------------------------------------------------------------------
*/
#ifndef SCREENLAYOUT_H
#define SCREENLAYOUT_H
#include <pthread.h>
#include <string>
#define ROWS 4
#define COLS 20
#define PADDING 10
class screenLayout
{
public:
screenLayout();
~screenLayout();
void setScreen(const char** data);
void setContents(const char* title, const char* artist, const char* album, const char* year, const char* elapsed, const char* duration);
void setTime(const char* elapsed, const char* duration);
void getContents(char** data) const;
void scrollScreen();
void clearScreen();
private:
void pad(std::string* str, unsigned long maxLen);
char** screen;
std::string titleStr;
std::string artistStr;
std::string albumYearStr;
std::string timeStr;
unsigned int titlePos;
unsigned int artistPos;
unsigned int albumYearPos;
pthread_mutex_t* lock;
};
#endif /* SCREENLAYOUT_H */