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