-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerScreen.cpp
More file actions
41 lines (30 loc) · 1.03 KB
/
Copy pathPlayerScreen.cpp
File metadata and controls
41 lines (30 loc) · 1.03 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
// Author: Niklas Meinzer <meinzer.niklas@gmail.com>
// This code is open-source under the terms of the GPLv3 (see LICENSE file)
#include <string>
#include "./PlayerScreen.h"
#include "./Screen.h"
#include "./RaspiLCD.h"
#include "./JukeBerry.h"
using std::string;
// _____________________________________________________________________________
PlayerScreen::PlayerScreen(RaspiLCD& display, JukeBerry* jb, Player& player) :
Screen(display, jb), _player(player) {
}
// _____________________________________________________________________________
void PlayerScreen::draw() {
printTitle("Player");
_raspiLcd.printString(0, 12, "now playing:");
string currentSong;
if (_player.getCurrentSong(currentSong)) {
_raspiLcd.printString(5, 20, currentSong);
} else {
_raspiLcd.printString(5, 20, "nothing");
}
}
// _____________________________________________________________________________
void PlayerScreen::update() {
if (_raspiLcd.buttonPressed(LEFT)) {
_jukeBerry->changeToScreen(SC_MainMenu);
return;
}
}