8 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
11 #include <QRecursiveMutex>
14 #include <QStringList>
29 QString item_name,
unsigned int item_indent = 0,
30 bool item_scroll =
false) :
31 m_selected(item_selected), m_checked(item_checked),
32 m_name(
std::move(item_name)), m_scroll(item_scroll),
33 m_indent(item_indent), m_scrollPosition(item_indent)
40 bool Scroll()
const {
return m_scroll; }
48 void setIndent(
unsigned int value) { m_indent = value; }
49 void setScrollPos(
unsigned int value) { m_scrollPosition = value; }
56 bool m_scroll {
false};
57 unsigned int m_indent {0};
58 unsigned int m_scrollPosition {0};
67 QString screen =
"Generic",
bool scroll =
false,
68 QString widget =
"textWidget") :
69 m_itemRow(row), m_itemAlignment(align),
70 m_itemText(
std::move(text)), m_itemScreen(
std::move(screen)),
71 m_itemWidget(
std::move(widget)), m_itemScrollable(scroll)
75 unsigned int getRow()
const {
return m_itemRow; }
77 QString
getText()
const {
return m_itemText; }
82 void setRow(
unsigned int value) { m_itemRow = value; }
84 void setText(
const QString &value) { m_itemText = value; }
85 void setScreen(
const QString &value) { m_itemScreen = value; }
86 void setWidget(
const QString &value) { m_itemWidget = value; }
93 QString m_itemScreen {
"Generic"};
94 QString m_itemWidget {
"textWidget"};
95 bool m_itemScrollable {
false};
176 friend class TestLcdDevice;
189 MUSIC_REPEAT_NONE = 0,
190 MUSIC_REPEAT_TRACK = 1,
191 MUSIC_REPEAT_ALL = 2,
195 MUSIC_SHUFFLE_NONE = 0,
196 MUSIC_SHUFFLE_RAND = 1,
197 MUSIC_SHUFFLE_SMART = 2,
198 MUSIC_SHUFFLE_ALBUM = 3,
199 MUSIC_SHUFFLE_ARTIST = 4
202 static LCD *Get(
void);
203 static void SetupLCD (
void);
206 bool connectToHost(
const QString &
hostname,
unsigned int port);
217 void setTunerLEDs(
enum LCDTunerSet tuner,
bool on);
225 void switchToMusic(
const QString &artist,
const QString &album,
226 const QString &track);
233 void switchToChannel(
const QString &channum =
"",
const QString &title =
"",
234 const QString &subtitle =
"");
239 void setChannelProgress(
const QString &time,
float value);
244 void switchToMenu(QList<LCDMenuItem> &menuItems,
245 const QString &app_name =
"",
246 bool popMenu =
true);
251 void switchToGeneric(QList<LCDTextItem> &textItems);
256 void setGenericProgress(
float value);
262 void setGenericBusy();
265 void setMusicProgress(
const QString &time,
float value);
270 void setMusicRepeat(
int repeat);
275 void setMusicShuffle(
int shuffle);
278 void switchToVolume(
const QString &app_name);
281 void setVolumeLevel(
float value);
286 void switchToNothing();
292 void setupLEDs(
int(*LedMaskFunc)(
void));
299 void resetServer(
void);
302 void restartConnection();
305 void sendToServerSlot(
const QString &someText);
308 void sendToServer(
const QString &someText);
311 static bool startLCDServer(
void);
313 void handleKeyPress(
const QString &keyPressed);
314 static QString quotedString(
const QString &
string);
315 void describeServer();
318 void ReadyRead(
void);
319 void Disconnected(
void);
322 QTcpSocket *m_socket {
nullptr};
323 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
324 QMutex m_socketLock {QMutex::Recursive};
328 QString m_hostname {
"localhost"};
330 bool m_connected {
false};
332 QTimer *m_retryTimer {
nullptr};
333 QTimer *m_ledTimer {
nullptr};
341 bool m_lcdReady {
false};
343 bool m_lcdShowTime {
false};
344 bool m_lcdShowMenu {
false};
345 bool m_lcdShowGeneric {
false};
346 bool m_lcdShowMusic {
false};
347 bool m_lcdShowChannel {
false};
348 bool m_lcdShowVolume {
false};
349 bool m_lcdShowRecStatus {
false};
350 bool m_lcdBacklightOn {
false};
351 bool m_lcdHeartbeatOn {
false};
352 int m_lcdPopupTime {0};
356 int m_lcdLedMask {0};
358 int (*m_getLEDMask)(void) {
nullptr};