MythTV master
lcddevice.cpp
Go to the documentation of this file.
1/*
2 lcddevice.cpp
3
4 a MythTV project object to control an
5 LCDproc server
6
7 (c) 2002, 2003 Thor Sigvaldason, Dan Morphis and Isaac Richards
8*/
9
10// C++ headers
11#include <cerrno>
12#include <chrono>
13#include <cmath>
14#include <cstdlib>
15#include <fcntl.h>
16#include <unistd.h> // for usleep()
17
18// Qt headers
19#include <QApplication>
20#include <QTextStream>
21#include <QByteArray>
22#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
23#include <QStringConverter>
24#else
25#include <QTextCodec>
26#endif
27#include <QTcpSocket>
28#include <QTimer>
29
30// MythTV headers
31#include "lcddevice.h"
32#include "mythlogging.h"
33#include "compat.h"
34#include "mythdb.h"
35#include "mythdirs.h"
36#include "mythevent.h"
37#include "mythsocket.h"
38#include "mythsystemlegacy.h"
39#include "exitcodes.h"
40
41
42#define LOC QString("LCDdevice: ")
43
45 : m_retryTimer(new QTimer(this)), m_ledTimer(new QTimer(this))
46{
47 m_sendBuffer.clear(); m_lastCommand.clear();
48 m_lcdShowMusicItems.clear(); m_lcdKeyString.clear();
49
50 setObjectName("LCD");
51
52 // Constructor for LCD
53 //
54 // Note that this does *not* include opening the socket and initiating
55 // communications with the LDCd daemon.
56
57 LOG(VB_GENERAL, LOG_DEBUG, LOC +
58 "An LCD object now exists (LCD() was called)");
59
62 connect(this, &LCD::sendToServer, this, &LCD::sendToServerSlot, Qt::QueuedConnection);
63}
64
65bool LCD::m_enabled = false;
66bool LCD::m_serverUnavailable = false;
67LCD *LCD::m_lcd = nullptr;
68
70{
71 if (m_enabled && m_lcd == nullptr && !m_serverUnavailable)
72 m_lcd = new LCD;
73 return m_lcd;
74}
75
76void LCD::SetupLCD (void)
77{
78 QString lcd_host;
79
80 if (m_lcd)
81 {
82 delete m_lcd;
83 m_lcd = nullptr;
84 m_serverUnavailable = false;
85 }
86
87 lcd_host = GetMythDB()->GetSetting("LCDServerHost", "localhost");
88 int lcd_port = GetMythDB()->GetNumSetting("LCDServerPort", 6545);
89 m_enabled = GetMythDB()->GetBoolSetting("LCDEnable", false);
90
91 // workaround a problem with Ubuntu not resolving localhost properly
92 if (lcd_host == "localhost")
93 lcd_host = "127.0.0.1";
94
95 if (m_enabled && lcd_host.length() > 0 && lcd_port > 1024)
96 {
97 LCD *lcd = LCD::Get();
98 if (!lcd->connectToHost(lcd_host, lcd_port))
99 {
100 delete m_lcd;
101 m_lcd = nullptr;
102 m_serverUnavailable = false;
103 }
104 }
105}
106
107bool LCD::connectToHost(const QString &lhostname, unsigned int lport)
108{
109 QMutexLocker locker(&m_socketLock);
110
111 LOG(VB_NETWORK, LOG_DEBUG, LOC +
112 QString("connecting to host: %1 - port: %2")
113 .arg(lhostname).arg(lport));
114
115 // Open communications
116 // Store the hostname and port in case we need to reconnect.
117 m_hostname = lhostname;
118 m_port = lport;
119
120 // Don't even try to connect if we're currently disabled.
121 m_enabled = GetMythDB()->GetBoolSetting("LCDEnable", false);
122 if (!m_enabled)
123 {
124 m_connected = false;
125 m_serverUnavailable = true;
126 return m_connected;
127 }
128
129 // check if the 'mythlcdserver' is running
131 if (myth_system("ps ch -C mythlcdserver -o pid > /dev/null", flags) == 1)
132 {
133 // we need to start the mythlcdserver
134 LOG(VB_GENERAL, LOG_NOTICE, "Starting mythlcdserver");
135
136 if (!startLCDServer())
137 {
138 LOG(VB_GENERAL, LOG_ERR, "Failed start MythTV LCD Server");
139 return m_connected;
140 }
141
142 usleep(500000);
143 }
144
145 for (int count = 1; count <= 10 && !m_connected; count++)
146 {
147 LOG(VB_GENERAL, LOG_INFO, QString("Connecting to lcd server: "
148 "%1:%2 (try %3 of 10)").arg(m_hostname).arg(m_port)
149 .arg(count));
150
151 delete m_socket;
152 m_socket = new QTcpSocket();
153
154 QObject::connect(m_socket, &QIODevice::readyRead,
155 this, &LCD::ReadyRead);
156 QObject::connect(m_socket, &QAbstractSocket::disconnected,
157 this, &LCD::Disconnected);
158
159 m_socket->connectToHost(m_hostname, m_port);
160 if (m_socket->waitForConnected())
161 {
162 m_lcdReady = false;
163 m_connected = true;
164 QTextStream os(m_socket);
165 os << "HELLO\n";
166 os.flush();
167
168 break;
169 }
170 m_socket->close();
171
172 usleep(500000);
173 }
174
175 if (!m_connected)
176 m_serverUnavailable = true;
177
178 return m_connected;
179}
180
181void LCD::sendToServerSlot(const QString &someText)
182{
183 QMutexLocker locker(&m_socketLock);
184
185 if (!m_socket || !m_lcdReady)
186 return;
187
188 if (m_socket->thread() != QThread::currentThread())
189 {
190 LOG(VB_GENERAL, LOG_ERR,
191 "Sending to LCDServer from wrong thread.");
192 return;
193 }
194
195 // Check the socket, make sure the connection is still up
196 if (QAbstractSocket::ConnectedState != m_socket->state())
197 {
198 m_lcdReady = false;
199
200 // Ack, connection to server has been severed try to re-establish the
201 // connection
202 m_retryTimer->setSingleShot(false);
203 m_retryTimer->start(10s);
204 LOG(VB_GENERAL, LOG_ERR,
205 "Connection to LCDServer died unexpectedly. "
206 "Trying to reconnect every 10 seconds...");
207
208 m_connected = false;
209 return;
210 }
211
212 QTextStream os(m_socket);
213#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
214 os.setCodec(QTextCodec::codecForName("ISO 8859-1"));
215#else
216 os.setEncoding(QStringConverter::Latin1);
217#endif
218
219 m_lastCommand = someText;
220
221 if (m_connected)
222 {
223 LOG(VB_NETWORK, LOG_DEBUG, LOC +
224 QString("Sending to Server: %1").arg(someText));
225
226 // Just stream the text out the socket
227 os << someText << "\n";
228 }
229 else
230 {
231 // Buffer this up in the hope that the connection will open soon
232
233 m_sendBuffer += someText;
234 m_sendBuffer += '\n';
235 }
236}
237
239{
240 // Reset the flag
241 m_lcdReady = false;
242 m_connected = false;
243 m_serverUnavailable = false;
244
245 // Retry to connect. . . Maybe the user restarted LCDd?
247}
248
250{
251 QMutexLocker locker(&m_socketLock);
252
253 if (!m_socket)
254 return;
255
256 QString lineFromServer;
257 QStringList aList;
258
259 // This gets activated automatically by the MythSocket class whenever
260 // there's something to read.
261 //
262 // We currently spend most of our time (except for the first line sent
263 // back) ignoring it.
264
265 int dataSize = static_cast<int>(m_socket->bytesAvailable() + 1);
266 QByteArray data(dataSize + 1, 0);
267
268 m_socket->read(data.data(), dataSize);
269
270 lineFromServer = data;
271 lineFromServer = lineFromServer.simplified();
272
273 // Make debugging be less noisy
274 if (lineFromServer != "OK")
275 LOG(VB_NETWORK, LOG_DEBUG, LOC + QString("Received from server: %1")
276 .arg(lineFromServer));
277
278 aList = lineFromServer.split(' ');
279 if (aList[0] == "CONNECTED")
280 {
281 // We got "CONNECTED", which is a response to "HELLO"
282 // get lcd width & height
283 if (aList.count() != 3)
284 {
285 LOG(VB_GENERAL, LOG_ERR, LOC + "received bad no. of arguments in "
286 "CONNECTED response from LCDServer");
287 }
288
289 bool bOK = false;
290 m_lcdWidth = aList[1].toInt(&bOK);
291 if (!bOK)
292 {
293 LOG(VB_GENERAL, LOG_ERR, LOC + "received bad int for width in "
294 "CONNECTED response from LCDServer");
295 }
296
297 m_lcdHeight = aList[2].toInt(&bOK);
298 if (!bOK)
299 {
300 LOG(VB_GENERAL, LOG_ERR, LOC + "received bad int for height in "
301 "CONNECTED response from LCDServer");
302 }
303
304 init();
305 }
306 else if (aList[0] == "HUH?")
307 {
308 LOG(VB_GENERAL, LOG_WARNING, LOC + "Something is getting passed to "
309 "LCDServer that it does not understand");
310 LOG(VB_GENERAL, LOG_WARNING, LOC +
311 QString("last command: %1").arg(m_lastCommand));
312 }
313 else if (aList[0] == "KEY")
314 {
315 handleKeyPress(aList.last().trimmed());
316 }
317}
318
319void LCD::handleKeyPress(const QString &keyPressed)
320{
321 int key = 0;
322
323 QChar mykey = keyPressed.at(0);
324 if (mykey == m_lcdKeyString.at(0))
325 key = Qt::Key_Up;
326 else if (mykey == m_lcdKeyString.at(1))
327 key = Qt::Key_Down;
328 else if (mykey == m_lcdKeyString.at(2))
329 key = Qt::Key_Left;
330 else if (mykey == m_lcdKeyString.at(3))
331 key = Qt::Key_Right;
332 else if (mykey == m_lcdKeyString.at(4))
333 key = Qt::Key_Space;
334 else if (mykey == m_lcdKeyString.at(5))
335 key = Qt::Key_Escape;
336
337 QCoreApplication::postEvent(
338 (QObject *)(QApplication::activeWindow()),
339 new ExternalKeycodeEvent(key));
340}
341
343{
344 // Stop the timer
345 m_retryTimer->stop();
346
347 // Get LCD settings
348 m_lcdShowMusic = (GetMythDB()->GetSetting("LCDShowMusic", "1") == "1");
349 m_lcdShowTime = (GetMythDB()->GetSetting("LCDShowTime", "1") == "1");
350 m_lcdShowChannel = (GetMythDB()->GetSetting("LCDShowChannel", "1") == "1");
351 m_lcdShowGeneric = (GetMythDB()->GetSetting("LCDShowGeneric", "1") == "1");
352 m_lcdShowVolume = (GetMythDB()->GetSetting("LCDShowVolume", "1") == "1");
353 m_lcdShowMenu = (GetMythDB()->GetSetting("LCDShowMenu", "1") == "1");
354 m_lcdShowRecStatus = (GetMythDB()->GetSetting("LCDShowRecStatus", "1") == "1");
355 m_lcdKeyString = GetMythDB()->GetSetting("LCDKeyString", "ABCDEF");
356
357 m_connected = true;
358 m_lcdReady = true;
359
360 // send buffer if there's anything in there
361 if (m_sendBuffer.length() > 0)
362 {
364 m_sendBuffer = "";
365 }
366}
367
369{
370 m_connected = false;
371}
372
374{
375 if (!m_lcdReady)
376 return;
377
378 LOG(VB_GENERAL, LOG_DEBUG, LOC + "stopAll");
379
380 emit sendToServer("STOP_ALL");
381}
382
383void LCD::setSpeakerLEDs(enum LCDSpeakerSet speaker, bool on)
384{
385 if (!m_lcdReady)
386 return;
387 m_lcdLedMask &= ~SPEAKER_MASK;
388 if (on)
389 m_lcdLedMask |= speaker;
390 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
391}
392
394{
395 if (!m_lcdReady)
396 return;
397
398 m_lcdLedMask &= ~AUDIO_MASK;
399 if (on)
400 m_lcdLedMask |= (acodec & AUDIO_MASK);
401
402 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
403}
404
406{
407 if (!m_lcdReady)
408 return;
409
410 m_lcdLedMask &= ~VIDEO_MASK;
411 if (on)
412 m_lcdLedMask |= (vcodec & VIDEO_MASK);
413
414 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
415}
416
418{
419 if (!m_lcdReady)
420 return;
421 m_lcdLedMask &= ~VSRC_MASK;
422 if (on)
423 m_lcdLedMask |= vsrc;
424 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
425}
426
427void LCD::setFunctionLEDs(enum LCDFunctionSet func, bool on)
428{
429 if (!m_lcdReady)
430 return;
431 m_lcdLedMask &= ~FUNC_MASK;
432 if (on)
433 m_lcdLedMask |= func;
434 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
435}
436
437void LCD::setVariousLEDs(enum LCDVariousFlags various, bool on)
438{
439 if (!m_lcdReady)
440 return;
441 if (on) {
442 m_lcdLedMask |= various;
443 if (various == VARIOUS_SPDIF)
445 } else {
446 m_lcdLedMask &= ~various;
447 if (various == VARIOUS_SPDIF)
448 m_lcdLedMask &= ~SPDIF_MASK;
449 }
450 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
451}
452
453void LCD::setTunerLEDs(enum LCDTunerSet tuner, bool on)
454{
455 if (!m_lcdReady)
456 return;
457 m_lcdLedMask &= ~TUNER_MASK;
458 if (on)
459 m_lcdLedMask |= tuner;
460 emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
461}
462
463void LCD::setChannelProgress(const QString &time, float value)
464{
466 return;
467
468 value = std::clamp(value, 0.0F, 1.0F);
469 emit sendToServer(QString("SET_CHANNEL_PROGRESS %1 %2").arg(quotedString(time))
470 .arg(value));
471}
472
473void LCD::setGenericProgress(float value)
474{
476 return;
477
478 value = std::clamp(value, 0.0F, 1.0F);
479 emit sendToServer(QString("SET_GENERIC_PROGRESS 0 %1").arg(value));
480}
481
483{
485 return;
486
487 emit sendToServer("SET_GENERIC_PROGRESS 1 0.0");
488}
489
490void LCD::setMusicProgress(const QString &time, float value)
491{
492 if (!m_lcdReady || !m_lcdShowMusic)
493 return;
494
495 value = std::clamp(value, 0.0F, 1.0F);
496 emit sendToServer("SET_MUSIC_PROGRESS " + quotedString(time) + ' ' +
497 QString().setNum(value));
498}
499
500void LCD::setMusicShuffle(int shuffle)
501{
502 if (!m_lcdReady || !m_lcdShowMusic)
503 return;
504
505 emit sendToServer(QString("SET_MUSIC_PLAYER_PROP SHUFFLE %1").arg(shuffle));
506}
507
508void LCD::setMusicRepeat(int repeat)
509{
510 if (!m_lcdReady || !m_lcdShowMusic)
511 return;
512
513 emit sendToServer(QString("SET_MUSIC_PLAYER_PROP REPEAT %1").arg(repeat));
514}
515
516void LCD::setVolumeLevel(float value)
517{
519 return;
520
521 if (value < 0.0F)
522 value = 0.0F;
523 else if (value > 1.0F)
524 value = 1.0F;
525
526 // NOLINTNEXTLINE(readability-misleading-indentation)
527 emit sendToServer("SET_VOLUME_LEVEL " + QString().setNum(value));
528}
529
530void LCD::setupLEDs(int(*LedMaskFunc)(void))
531{
532 m_getLEDMask = LedMaskFunc;
533 // update LED status every 10 seconds
534 m_ledTimer->setSingleShot(false);
535 m_ledTimer->start(10s);
536}
537
539{
540 /* now implemented elsewhere for advanced icon control */
541#if 0
542 if (!lcd_ready)
543 return;
544
545 QString aString;
546 int mask = 0;
547 if (0 && m_getLEDMask)
548 mask = m_getLEDMask();
549 aString = "UPDATE_LEDS ";
550 aString += QString::number(mask);
551 emit sendToServer(aString);
552#endif
553}
554
556{
557 if (!m_lcdReady)
558 return;
559
560 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToTime");
561
562 emit sendToServer("SWITCH_TO_TIME");
563}
564
565void LCD::switchToMusic(const QString &artist, const QString &album, const QString &track)
566{
567 if (!m_lcdReady || !m_lcdShowMusic)
568 return;
569
570 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMusic");
571
572 emit sendToServer("SWITCH_TO_MUSIC " + quotedString(artist) + ' '
573 + quotedString(album) + ' '
574 + quotedString(track));
575}
576
577void LCD::switchToChannel(const QString &channum, const QString &title,
578 const QString &subtitle)
579{
581 return;
582
583 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToChannel");
584
585 emit sendToServer("SWITCH_TO_CHANNEL " + quotedString(channum) + ' '
586 + quotedString(title) + ' '
587 + quotedString(subtitle));
588}
589
590void LCD::switchToMenu(QList<LCDMenuItem> &menuItems, const QString &app_name,
591 bool popMenu)
592{
593 if (!m_lcdReady || !m_lcdShowMenu)
594 return;
595
596 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMenu");
597
598 if (menuItems.isEmpty())
599 return;
600
601 QString s = "SWITCH_TO_MENU ";
602
603 s += quotedString(app_name);
604 s += ' ' + QString(popMenu ? "TRUE" : "FALSE");
605
606
607 QListIterator<LCDMenuItem> it(menuItems);
608
609 while (it.hasNext())
610 {
611 const LCDMenuItem *curItem = &(it.next());
612 s += ' ' + quotedString(curItem->ItemName());
613
614 if (curItem->isChecked() == CHECKED)
615 s += " CHECKED";
616 else if (curItem->isChecked() == UNCHECKED)
617 s += " UNCHECKED";
618 else if (curItem->isChecked() == NOTCHECKABLE)
619 s += " NOTCHECKABLE";
620
621 s += ' ' + QString(curItem->isSelected() ? "TRUE" : "FALSE");
622 s += ' ' + QString(curItem->Scroll() ? "TRUE" : "FALSE");
623 QString sIndent;
624 sIndent.setNum(curItem->getIndent());
625 s += ' ' + sIndent;
626 }
627
628 emit sendToServer(s);
629}
630
631void LCD::switchToGeneric(QList<LCDTextItem> &textItems)
632{
634 return;
635
636 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToGeneric");
637
638 if (textItems.isEmpty())
639 return;
640
641 QString s = "SWITCH_TO_GENERIC";
642
643 QListIterator<LCDTextItem> it(textItems);
644
645 while (it.hasNext())
646 {
647 const LCDTextItem *curItem = &(it.next());
648
649 QString sRow;
650 sRow.setNum(curItem->getRow());
651 s += ' ' + sRow;
652
653 if (curItem->getAlignment() == ALIGN_LEFT)
654 s += " ALIGN_LEFT";
655 else if (curItem->getAlignment() == ALIGN_RIGHT)
656 s += " ALIGN_RIGHT";
657 else if (curItem->getAlignment() == ALIGN_CENTERED)
658 s += " ALIGN_CENTERED";
659
660 s += ' ' + quotedString(curItem->getText());
661 s += ' ' + quotedString(curItem->getScreen());
662 s += ' ' + QString(curItem->getScroll() ? "TRUE" : "FALSE");
663 }
664
665 emit sendToServer(s);
666}
667
668void LCD::switchToVolume(const QString &app_name)
669{
671 return;
672
673 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToVolume");
674
675 emit sendToServer("SWITCH_TO_VOLUME " + quotedString(app_name));
676}
677
679{
680 if (!m_lcdReady)
681 return;
682
683 LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToNothing");
684
685 emit sendToServer("SWITCH_TO_NOTHING");
686}
687
689{
690 QMutexLocker locker(&m_socketLock);
691
692 LOG(VB_GENERAL, LOG_DEBUG, LOC + "shutdown");
693
694 if (m_socket)
695 m_socket->close();
696
697 m_lcdReady = false;
698 m_connected = false;
699}
700
702{
703 QMutexLocker locker(&m_socketLock);
704
705 if (!m_lcdReady)
706 return;
707
708 LOG(VB_GENERAL, LOG_DEBUG, LOC + "RESET");
709
710 emit sendToServer("RESET");
711}
712
714{
715 m_lcd = nullptr;
716
717 LOG(VB_GENERAL, LOG_DEBUG, LOC + "An LCD device is being snuffed out of "
718 "existence (~LCD() was called)");
719
720 if (m_socket)
721 {
722 delete m_socket;
723 m_socket = nullptr;
724 m_lcdReady = false;
725 }
726}
727
728QString LCD::quotedString(const QString &string)
729{
730 QString sRes = string;
731 sRes.replace(QString("\""), QString("\"\""));
732 sRes = "\"" + sRes + "\"";
733
734 return(sRes);
735}
736
738{
739 QString command = GetAppBinDir() + "mythlcdserver";
740 command += logPropagateArgs;
743
744 uint retval = myth_system(command, flags);
745 return( retval == GENERIC_EXIT_RUNNING );
746}
unsigned int getIndent() const
Definition: lcddevice.h:37
CHECKED_STATE isChecked() const
Definition: lcddevice.h:33
bool isSelected() const
Definition: lcddevice.h:34
bool Scroll() const
Definition: lcddevice.h:36
QString ItemName() const
Definition: lcddevice.h:35
QString getScreen() const
Definition: lcddevice.h:74
TEXT_ALIGNMENT getAlignment() const
Definition: lcddevice.h:72
unsigned int getRow() const
Definition: lcddevice.h:71
QString getText() const
Definition: lcddevice.h:73
bool getScroll() const
Definition: lcddevice.h:76
Definition: lcddevice.h:170
LCD()
Definition: lcddevice.cpp:44
static LCD * Get(void)
Definition: lcddevice.cpp:69
bool m_lcdShowGeneric
Definition: lcddevice.h:337
void setAudioFormatLEDs(enum LCDAudioFormatSet acodec, bool on)
Definition: lcddevice.cpp:393
QTcpSocket * m_socket
Definition: lcddevice.h:318
void setVideoSrcLEDs(enum LCDVideoSourceSet vsrc, bool on)
Definition: lcddevice.cpp:417
QString m_sendBuffer
Definition: lcddevice.h:327
int m_lcdLedMask
Definition: lcddevice.h:348
void setVolumeLevel(float value)
Definition: lcddevice.cpp:516
~LCD() override
Definition: lcddevice.cpp:713
void init()
Definition: lcddevice.cpp:342
bool m_lcdShowChannel
Definition: lcddevice.h:339
QTimer * m_ledTimer
Definition: lcddevice.h:325
void setupLEDs(int(*LedMaskFunc)(void))
Definition: lcddevice.cpp:530
bool m_connected
Definition: lcddevice.h:322
void sendToServer(const QString &someText)
void setFunctionLEDs(enum LCDFunctionSet func, bool on)
Definition: lcddevice.cpp:427
bool m_lcdShowTime
Definition: lcddevice.h:335
static void SetupLCD(void)
Definition: lcddevice.cpp:76
QString m_lcdShowMusicItems
Definition: lcddevice.h:345
QTimer * m_retryTimer
Definition: lcddevice.h:324
bool m_lcdReady
Definition: lcddevice.h:333
bool connectToHost(const QString &hostname, unsigned int port)
Definition: lcddevice.cpp:107
void setGenericProgress(float value)
Update the generic progress bar.
Definition: lcddevice.cpp:473
static bool m_serverUnavailable
Definition: lcddevice.h:177
QRecursiveMutex m_socketLock
Definition: lcddevice.h:319
void setSpeakerLEDs(enum LCDSpeakerSet speaker, bool on)
Definition: lcddevice.cpp:383
void switchToTime()
Definition: lcddevice.cpp:555
void stopAll(void)
Definition: lcddevice.cpp:373
void setGenericBusy()
Update the generic screen to display a busy spinner.
Definition: lcddevice.cpp:482
static QString quotedString(const QString &string)
Definition: lcddevice.cpp:728
void setMusicRepeat(int repeat)
Set music player's repeat properties.
Definition: lcddevice.cpp:508
int(* m_getLEDMask)(void)
Definition: lcddevice.h:350
void resetServer(void)
Definition: lcddevice.cpp:701
QString m_hostname
Definition: lcddevice.h:320
void switchToMusic(const QString &artist, const QString &album, const QString &track)
Definition: lcddevice.cpp:565
void ReadyRead(void)
Definition: lcddevice.cpp:249
void setTunerLEDs(enum LCDTunerSet tuner, bool on)
Definition: lcddevice.cpp:453
void setMusicProgress(const QString &time, float value)
Definition: lcddevice.cpp:490
int m_lcdHeight
Definition: lcddevice.h:331
void setMusicShuffle(int shuffle)
Set music player's shuffle properties.
Definition: lcddevice.cpp:500
void setVariousLEDs(enum LCDVariousFlags various, bool on)
Definition: lcddevice.cpp:437
bool m_lcdShowRecStatus
Definition: lcddevice.h:341
void setVideoFormatLEDs(enum LCDVideoFormatSet vcodec, bool on)
Definition: lcddevice.cpp:405
void Disconnected(void)
Definition: lcddevice.cpp:368
void switchToMenu(QList< LCDMenuItem > &menuItems, const QString &app_name="", bool popMenu=true)
Definition: lcddevice.cpp:590
QString m_lastCommand
Definition: lcddevice.h:328
void switchToVolume(const QString &app_name)
Definition: lcddevice.cpp:668
bool m_lcdShowMusic
Definition: lcddevice.h:338
void switchToNothing()
Definition: lcddevice.cpp:678
void shutdown()
Definition: lcddevice.cpp:688
bool m_lcdShowVolume
Definition: lcddevice.h:340
bool m_lcdShowMenu
Definition: lcddevice.h:336
static bool startLCDServer(void)
Definition: lcddevice.cpp:737
static LCD * m_lcd
Definition: lcddevice.h:178
void outputLEDs()
Definition: lcddevice.cpp:538
void sendToServerSlot(const QString &someText)
Definition: lcddevice.cpp:181
static bool m_enabled
Definition: lcddevice.h:179
void switchToChannel(const QString &channum="", const QString &title="", const QString &subtitle="")
Definition: lcddevice.cpp:577
void switchToGeneric(QList< LCDTextItem > &textItems)
Definition: lcddevice.cpp:631
void handleKeyPress(const QString &keyPressed)
Definition: lcddevice.cpp:319
void setChannelProgress(const QString &time, float value)
Definition: lcddevice.cpp:463
void restartConnection()
Definition: lcddevice.cpp:238
QString m_lcdKeyString
Definition: lcddevice.h:346
uint m_port
Definition: lcddevice.h:321
int m_lcdWidth
Definition: lcddevice.h:330
unsigned int uint
Definition: compat.h:68
@ GENERIC_EXIT_RUNNING
Process is running.
Definition: exitcodes.h:28
#define LOC
Definition: lcddevice.cpp:42
LCDSpeakerSet
Definition: lcddevice.h:95
LCDVideoSourceSet
Definition: lcddevice.h:135
LCDTunerSet
Definition: lcddevice.h:127
LCDFunctionSet
Definition: lcddevice.h:157
@ ALIGN_CENTERED
Definition: lcddevice.h:57
@ ALIGN_LEFT
Definition: lcddevice.h:57
@ ALIGN_RIGHT
Definition: lcddevice.h:57
LCDAudioFormatSet
Definition: lcddevice.h:103
@ AUDIO_MASK
Definition: lcddevice.h:104
LCDVideoFormatSet
Definition: lcddevice.h:118
@ VIDEO_MASK
Definition: lcddevice.h:119
@ NOTCHECKABLE
Definition: lcddevice.h:17
@ CHECKED
Definition: lcddevice.h:17
@ UNCHECKED
Definition: lcddevice.h:17
LCDVariousFlags
Definition: lcddevice.h:142
@ SPDIF_MASK
Definition: lcddevice.h:152
@ VARIOUS_SPDIF
Definition: lcddevice.h:151
QString logPropagateArgs
Definition: logging.cpp:82
MythDB * GetMythDB(void)
Definition: mythdb.cpp:51
QString GetAppBinDir(void)
Definition: mythdirs.cpp:260
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
@ kMSDontBlockInputDevs
avoid blocking LIRC & Joystick Menu
Definition: mythsystem.h:36
@ kMSRunShell
run process through shell
Definition: mythsystem.h:43
@ kMSRunBackground
run child in the background
Definition: mythsystem.h:38
@ kMSDontDisableDrawing
avoid disabling UI drawing
Definition: mythsystem.h:37
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
static eu8 clamp(eu8 value, eu8 low, eu8 high)
Definition: pxsup2dast.c:206