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