8 #include <QRecursiveMutex>
10 #include <QStringList>
25 QString item_name,
unsigned int item_indent = 0,
26 bool item_scroll =
false) :
27 m_selected(item_selected), m_checked(item_checked),
28 m_name(
std::move(item_name)), m_scroll(item_scroll),
29 m_indent(item_indent), m_scrollPosition(item_indent)
36 bool Scroll()
const {
return m_scroll; }
44 void setIndent(
unsigned int value) { m_indent = value; }
45 void setScrollPos(
unsigned int value) { m_scrollPosition = value; }
52 bool m_scroll {
false};
53 unsigned int m_indent {0};
54 unsigned int m_scrollPosition {0};
63 QString screen =
"Generic",
bool scroll =
false,
64 QString widget =
"textWidget") :
65 m_itemRow(row), m_itemAlignment(align),
66 m_itemText(
std::move(text)), m_itemScreen(
std::move(screen)),
67 m_itemWidget(
std::move(widget)), m_itemScrollable(scroll)
71 unsigned int getRow()
const {
return m_itemRow; }
73 QString
getText()
const {
return m_itemText; }
78 void setRow(
unsigned int value) { m_itemRow = value; }
80 void setText(
const QString &value) { m_itemText = value; }
81 void setScreen(
const QString &value) { m_itemScreen = value; }
82 void setWidget(
const QString &value) { m_itemWidget = value; }
89 QString m_itemScreen {
"Generic"};
90 QString m_itemWidget {
"textWidget"};
91 bool m_itemScrollable {
false};
172 friend class TestLcdDevice;
185 MUSIC_REPEAT_NONE = 0,
186 MUSIC_REPEAT_TRACK = 1,
187 MUSIC_REPEAT_ALL = 2,
191 MUSIC_SHUFFLE_NONE = 0,
192 MUSIC_SHUFFLE_RAND = 1,
193 MUSIC_SHUFFLE_SMART = 2,
194 MUSIC_SHUFFLE_ALBUM = 3,
195 MUSIC_SHUFFLE_ARTIST = 4
198 static LCD *Get(
void);
199 static void SetupLCD (
void);
202 bool connectToHost(
const QString &
hostname,
unsigned int port);
213 void setTunerLEDs(
enum LCDTunerSet tuner,
bool on);
221 void switchToMusic(
const QString &artist,
const QString &album,
222 const QString &track);
229 void switchToChannel(
const QString &channum =
"",
const QString &title =
"",
230 const QString &subtitle =
"");
235 void setChannelProgress(
const QString &time,
float value);
240 void switchToMenu(QList<LCDMenuItem> &menuItems,
241 const QString &app_name =
"",
242 bool popMenu =
true);
247 void switchToGeneric(QList<LCDTextItem> &textItems);
252 void setGenericProgress(
float value);
258 void setGenericBusy();
261 void setMusicProgress(
const QString &time,
float value);
266 void setMusicRepeat(
int repeat);
271 void setMusicShuffle(
int shuffle);
274 void switchToVolume(
const QString &app_name);
277 void setVolumeLevel(
float value);
282 void switchToNothing();
288 void setupLEDs(
int(*LedMaskFunc)(
void));
295 void resetServer(
void);
298 void restartConnection();
301 void sendToServerSlot(
const QString &someText);
304 void sendToServer(
const QString &someText);
307 static bool startLCDServer(
void);
309 void handleKeyPress(
const QString &keyPressed);
310 static QString quotedString(
const QString &
string);
311 void describeServer();
314 void ReadyRead(
void);
315 void Disconnected(
void);
318 QTcpSocket *m_socket {
nullptr};
320 QString m_hostname {
"localhost"};
322 bool m_connected {
false};
324 QTimer *m_retryTimer {
nullptr};
325 QTimer *m_ledTimer {
nullptr};
333 bool m_lcdReady {
false};
335 bool m_lcdShowTime {
false};
336 bool m_lcdShowMenu {
false};
337 bool m_lcdShowGeneric {
false};
338 bool m_lcdShowMusic {
false};
339 bool m_lcdShowChannel {
false};
340 bool m_lcdShowVolume {
false};
341 bool m_lcdShowRecStatus {
false};
342 bool m_lcdBacklightOn {
false};
343 bool m_lcdHeartbeatOn {
false};
344 int m_lcdPopupTime {0};
348 int m_lcdLedMask {0};
350 int (*m_getLEDMask)(void) {
nullptr};