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  handleKeyPress(aList.last().trimmed());
322 }
323 
324 void LCD::handleKeyPress(const QString &keyPressed)
325 {
326  int key = 0;
327 
328  QChar mykey = keyPressed.at(0);
329  if (mykey == m_lcdKeyString.at(0))
330  key = Qt::Key_Up;
331  else if (mykey == m_lcdKeyString.at(1))
332  key = Qt::Key_Down;
333  else if (mykey == m_lcdKeyString.at(2))
334  key = Qt::Key_Left;
335  else if (mykey == m_lcdKeyString.at(3))
336  key = Qt::Key_Right;
337  else if (mykey == m_lcdKeyString.at(4))
338  key = Qt::Key_Space;
339  else if (mykey == m_lcdKeyString.at(5))
340  key = Qt::Key_Escape;
341 
342  QCoreApplication::postEvent(
343  (QObject *)(QApplication::activeWindow()),
344  new ExternalKeycodeEvent(key));
345 }
346 
347 void LCD::init()
348 {
349  // Stop the timer
350  m_retryTimer->stop();
351 
352  // Get LCD settings
353  m_lcdShowMusic = (GetMythDB()->GetSetting("LCDShowMusic", "1") == "1");
354  m_lcdShowTime = (GetMythDB()->GetSetting("LCDShowTime", "1") == "1");
355  m_lcdShowChannel = (GetMythDB()->GetSetting("LCDShowChannel", "1") == "1");
356  m_lcdShowGeneric = (GetMythDB()->GetSetting("LCDShowGeneric", "1") == "1");
357  m_lcdShowVolume = (GetMythDB()->GetSetting("LCDShowVolume", "1") == "1");
358  m_lcdShowMenu = (GetMythDB()->GetSetting("LCDShowMenu", "1") == "1");
359  m_lcdShowRecStatus = (GetMythDB()->GetSetting("LCDShowRecStatus", "1") == "1");
360  m_lcdKeyString = GetMythDB()->GetSetting("LCDKeyString", "ABCDEF");
361 
362  m_connected = true;
363  m_lcdReady = true;
364 
365  // send buffer if there's anything in there
366  if (m_sendBuffer.length() > 0)
367  {
369  m_sendBuffer = "";
370  }
371 }
372 
374 {
375  m_connected = false;
376 }
377 
379 {
380  if (!m_lcdReady)
381  return;
382 
383  LOG(VB_GENERAL, LOG_DEBUG, LOC + "stopAll");
384 
385  emit sendToServer("STOP_ALL");
386 }
387 
388 void LCD::setSpeakerLEDs(enum LCDSpeakerSet speaker, bool on)
389 {
390  if (!m_lcdReady)
391  return;
393  if (on)
394  m_lcdLedMask |= speaker;
395  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
396 }
397 
398 void LCD::setAudioFormatLEDs(enum LCDAudioFormatSet acodec, bool on)
399 {
400  if (!m_lcdReady)
401  return;
402 
404  if (on)
405  m_lcdLedMask |= (acodec & AUDIO_MASK);
406 
407  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
408 }
409 
410 void LCD::setVideoFormatLEDs(enum LCDVideoFormatSet vcodec, bool on)
411 {
412  if (!m_lcdReady)
413  return;
414 
416  if (on)
417  m_lcdLedMask |= (vcodec & VIDEO_MASK);
418 
419  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
420 }
421 
422 void LCD::setVideoSrcLEDs(enum LCDVideoSourceSet vsrc, bool on)
423 {
424  if (!m_lcdReady)
425  return;
427  if (on)
428  m_lcdLedMask |= vsrc;
429  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
430 }
431 
432 void LCD::setFunctionLEDs(enum LCDFunctionSet func, bool on)
433 {
434  if (!m_lcdReady)
435  return;
437  if (on)
438  m_lcdLedMask |= func;
439  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
440 }
441 
442 void LCD::setVariousLEDs(enum LCDVariousFlags various, bool on)
443 {
444  if (!m_lcdReady)
445  return;
446  if (on) {
447  m_lcdLedMask |= various;
448  if (various == VARIOUS_SPDIF)
450  } else {
451  m_lcdLedMask &= ~various;
452  if (various == VARIOUS_SPDIF)
454  }
455  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
456 }
457 
458 void LCD::setTunerLEDs(enum LCDTunerSet tuner, bool on)
459 {
460  if (!m_lcdReady)
461  return;
463  if (on)
464  m_lcdLedMask |= tuner;
465  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
466 }
467 
468 void LCD::setChannelProgress(const QString &time, float value)
469 {
470  if (!m_lcdReady || !m_lcdShowChannel)
471  return;
472 
473  value = std::min(std::max(0.0F, value), 1.0F);
474  emit sendToServer(QString("SET_CHANNEL_PROGRESS %1 %2").arg(quotedString(time))
475  .arg(value));
476 }
477 
478 void LCD::setGenericProgress(float value)
479 {
480  if (!m_lcdReady || !m_lcdShowGeneric)
481  return;
482 
483  value = std::min(std::max(0.0F, value), 1.0F);
484  emit sendToServer(QString("SET_GENERIC_PROGRESS 0 %1").arg(value));
485 }
486 
488 {
489  if (!m_lcdReady || !m_lcdShowGeneric)
490  return;
491 
492  emit sendToServer("SET_GENERIC_PROGRESS 1 0.0");
493 }
494 
495 void LCD::setMusicProgress(const QString &time, float value)
496 {
497  if (!m_lcdReady || !m_lcdShowMusic)
498  return;
499 
500  value = std::min(std::max(0.0F, value), 1.0F);
501  emit sendToServer("SET_MUSIC_PROGRESS " + quotedString(time) + ' ' +
502  QString().setNum(value));
503 }
504 
505 void LCD::setMusicShuffle(int shuffle)
506 {
507  if (!m_lcdReady || !m_lcdShowMusic)
508  return;
509 
510  emit sendToServer(QString("SET_MUSIC_PLAYER_PROP SHUFFLE %1").arg(shuffle));
511 }
512 
513 void LCD::setMusicRepeat(int repeat)
514 {
515  if (!m_lcdReady || !m_lcdShowMusic)
516  return;
517 
518  emit sendToServer(QString("SET_MUSIC_PLAYER_PROP REPEAT %1").arg(repeat));
519 }
520 
521 void LCD::setVolumeLevel(float value)
522 {
523  if (!m_lcdReady || !m_lcdShowVolume)
524  return;
525 
526  if (value < 0.0F)
527  value = 0.0F;
528  else if (value > 1.0F)
529  value = 1.0F;
530 
531  // NOLINTNEXTLINE(readability-misleading-indentation)
532  emit sendToServer("SET_VOLUME_LEVEL " + QString().setNum(value));
533 }
534 
535 void LCD::setupLEDs(int(*LedMaskFunc)(void))
536 {
537  m_getLEDMask = LedMaskFunc;
538  // update LED status every 10 seconds
539  m_ledTimer->setSingleShot(false);
540  m_ledTimer->start(10s);
541 }
542 
544 {
545  /* now implemented elsewhere for advanced icon control */
546 #if 0
547  if (!lcd_ready)
548  return;
549 
550  QString aString;
551  int mask = 0;
552  if (0 && m_getLEDMask)
553  mask = m_getLEDMask();
554  aString = "UPDATE_LEDS ";
555  aString += QString::number(mask);
556  emit sendToServer(aString);
557 #endif
558 }
559 
561 {
562  if (!m_lcdReady)
563  return;
564 
565  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToTime");
566 
567  emit sendToServer("SWITCH_TO_TIME");
568 }
569 
570 void LCD::switchToMusic(const QString &artist, const QString &album, const QString &track)
571 {
572  if (!m_lcdReady || !m_lcdShowMusic)
573  return;
574 
575  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMusic");
576 
577  emit sendToServer("SWITCH_TO_MUSIC " + quotedString(artist) + ' '
578  + quotedString(album) + ' '
579  + quotedString(track));
580 }
581 
582 void LCD::switchToChannel(const QString &channum, const QString &title,
583  const QString &subtitle)
584 {
585  if (!m_lcdReady || !m_lcdShowChannel)
586  return;
587 
588  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToChannel");
589 
590  emit sendToServer("SWITCH_TO_CHANNEL " + quotedString(channum) + ' '
591  + quotedString(title) + ' '
592  + quotedString(subtitle));
593 }
594 
595 void LCD::switchToMenu(QList<LCDMenuItem> &menuItems, const QString &app_name,
596  bool popMenu)
597 {
598  if (!m_lcdReady || !m_lcdShowMenu)
599  return;
600 
601  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMenu");
602 
603  if (menuItems.isEmpty())
604  return;
605 
606  QString s = "SWITCH_TO_MENU ";
607 
608  s += quotedString(app_name);
609  s += ' ' + QString(popMenu ? "TRUE" : "FALSE");
610 
611 
612  QListIterator<LCDMenuItem> it(menuItems);
613 
614  while (it.hasNext())
615  {
616  const LCDMenuItem *curItem = &(it.next());
617  s += ' ' + quotedString(curItem->ItemName());
618 
619  if (curItem->isChecked() == CHECKED)
620  s += " CHECKED";
621  else if (curItem->isChecked() == UNCHECKED)
622  s += " UNCHECKED";
623  else if (curItem->isChecked() == NOTCHECKABLE)
624  s += " NOTCHECKABLE";
625 
626  s += ' ' + QString(curItem->isSelected() ? "TRUE" : "FALSE");
627  s += ' ' + QString(curItem->Scroll() ? "TRUE" : "FALSE");
628  QString sIndent;
629  sIndent.setNum(curItem->getIndent());
630  s += ' ' + sIndent;
631  }
632 
633  emit sendToServer(s);
634 }
635 
636 void LCD::switchToGeneric(QList<LCDTextItem> &textItems)
637 {
638  if (!m_lcdReady || !m_lcdShowGeneric)
639  return;
640 
641  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToGeneric");
642 
643  if (textItems.isEmpty())
644  return;
645 
646  QString s = "SWITCH_TO_GENERIC";
647 
648  QListIterator<LCDTextItem> it(textItems);
649 
650  while (it.hasNext())
651  {
652  const LCDTextItem *curItem = &(it.next());
653 
654  QString sRow;
655  sRow.setNum(curItem->getRow());
656  s += ' ' + sRow;
657 
658  if (curItem->getAlignment() == ALIGN_LEFT)
659  s += " ALIGN_LEFT";
660  else if (curItem->getAlignment() == ALIGN_RIGHT)
661  s += " ALIGN_RIGHT";
662  else if (curItem->getAlignment() == ALIGN_CENTERED)
663  s += " ALIGN_CENTERED";
664 
665  s += ' ' + quotedString(curItem->getText());
666  s += ' ' + quotedString(curItem->getScreen());
667  s += ' ' + QString(curItem->getScroll() ? "TRUE" : "FALSE");
668  }
669 
670  emit sendToServer(s);
671 }
672 
673 void LCD::switchToVolume(const QString &app_name)
674 {
675  if (!m_lcdReady || !m_lcdShowVolume)
676  return;
677 
678  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToVolume");
679 
680  emit sendToServer("SWITCH_TO_VOLUME " + quotedString(app_name));
681 }
682 
684 {
685  if (!m_lcdReady)
686  return;
687 
688  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToNothing");
689 
690  emit sendToServer("SWITCH_TO_NOTHING");
691 }
692 
694 {
695  QMutexLocker locker(&m_socketLock);
696 
697  LOG(VB_GENERAL, LOG_DEBUG, LOC + "shutdown");
698 
699  if (m_socket)
700  m_socket->close();
701 
702  m_lcdReady = false;
703  m_connected = false;
704 }
705 
707 {
708  QMutexLocker locker(&m_socketLock);
709 
710  if (!m_lcdReady)
711  return;
712 
713  LOG(VB_GENERAL, LOG_DEBUG, LOC + "RESET");
714 
715  emit sendToServer("RESET");
716 }
717 
719 {
720  m_lcd = nullptr;
721 
722  LOG(VB_GENERAL, LOG_DEBUG, LOC + "An LCD device is being snuffed out of "
723  "existence (~LCD() was called)");
724 
725  if (m_socket)
726  {
727  delete m_socket;
728  m_socket = nullptr;
729  m_lcdReady = false;
730  }
731 }
732 
733 QString LCD::quotedString(const QString &string)
734 {
735  QString sRes = string;
736  sRes.replace(QString("\""), QString("\"\""));
737  sRes = "\"" + sRes + "\"";
738 
739  return(sRes);
740 }
741 
743 {
744  QString command = GetAppBinDir() + "mythlcdserver";
745  command += logPropagateArgs;
748 
749  uint retval = myth_system(command, flags);
750  return( retval == GENERIC_EXIT_RUNNING );
751 }
LCDTextItem::getScroll
bool getScroll() const
Definition: lcddevice.h:76
TUNER_MASK
@ TUNER_MASK
Definition: lcddevice.h:128
mythevent.h
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:102
LCDFunctionSet
LCDFunctionSet
Definition: lcddevice.h:157
LCDSpeakerSet
LCDSpeakerSet
Definition: lcddevice.h:95
LCD::switchToChannel
void switchToChannel(const QString &channum="", const QString &title="", const QString &subtitle="")
Definition: lcddevice.cpp:582
LCD::handleKeyPress
void handleKeyPress(const QString &keyPressed)
Definition: lcddevice.cpp:324
LCDTunerSet
LCDTunerSet
Definition: lcddevice.h:127
LCDTextItem::getText
QString getText() const
Definition: lcddevice.h:73
LCD::setTunerLEDs
void setTunerLEDs(enum LCDTunerSet tuner, bool on)
Definition: lcddevice.cpp:458
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:487
LCD::m_connected
bool m_connected
Definition: lcddevice.h:322
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:388
LCD::m_lcdShowChannel
bool m_lcdShowChannel
Definition: lcddevice.h:339
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
GetMythDB
MythDB * GetMythDB(void)
Definition: mythdb.cpp:50
LCD::m_lcdHeight
int m_lcdHeight
Definition: lcddevice.h:331
SPEAKER_MASK
@ SPEAKER_MASK
Definition: lcddevice.h:96
UNCHECKED
@ UNCHECKED
Definition: lcddevice.h:17
mythdirs.h
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:683
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:505
ExternalKeycodeEvent
Definition: mythevent.h:105
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
VSRC_MASK
@ VSRC_MASK
Definition: lcddevice.h:136
LCD::setVideoFormatLEDs
void setVideoFormatLEDs(enum LCDVideoFormatSet vcodec, bool on)
Definition: lcddevice.cpp:410
LCD::m_getLEDMask
int(* m_getLEDMask)(void)
Definition: lcddevice.h:350
LCD::shutdown
void shutdown()
Definition: lcddevice.cpp:693
compat.h
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:373
ALIGN_CENTERED
@ ALIGN_CENTERED
Definition: lcddevice.h:57
LCD::switchToGeneric
void switchToGeneric(QList< LCDTextItem > &textItems)
Definition: lcddevice.cpp:636
LCDTextItem::getAlignment
TEXT_ALIGNMENT getAlignment() const
Definition: lcddevice.h:72
VARIOUS_SPDIF
@ VARIOUS_SPDIF
Definition: lcddevice.h:151
LCD::m_lcdShowGeneric
bool m_lcdShowGeneric
Definition: lcddevice.h:337
LCDVideoSourceSet
LCDVideoSourceSet
Definition: lcddevice.h:135
uint
unsigned int uint
Definition: compat.h:81
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:706
LCD::init
void init()
Definition: lcddevice.cpp:347
ALIGN_LEFT
@ ALIGN_LEFT
Definition: lcddevice.h:57
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:733
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:513
LCDMenuItem::ItemName
QString ItemName() const
Definition: lcddevice.h:35
LCD::~LCD
~LCD() override
Definition: lcddevice.cpp:718
LCD::setGenericProgress
void setGenericProgress(float value)
Update the generic progress bar.
Definition: lcddevice.cpp:478
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
LCD::SetupLCD
static void SetupLCD(void)
Definition: lcddevice.cpp:76
ALIGN_RIGHT
@ ALIGN_RIGHT
Definition: lcddevice.h:57
LCD::setVideoSrcLEDs
void setVideoSrcLEDs(enum LCDVideoSourceSet vsrc, bool on)
Definition: lcddevice.cpp:422
LCD::m_socket
QTcpSocket * m_socket
Definition: lcddevice.h:318
NOTCHECKABLE
@ NOTCHECKABLE
Definition: lcddevice.h:17
LCDVideoFormatSet
LCDVideoFormatSet
Definition: lcddevice.h:118
LCD::m_retryTimer
QTimer * m_retryTimer
Definition: lcddevice.h:324
FUNC_MASK
@ FUNC_MASK
Definition: lcddevice.h:159
LCD::switchToVolume
void switchToVolume(const QString &app_name)
Definition: lcddevice.cpp:673
LCD::setupLEDs
void setupLEDs(int(*LedMaskFunc)(void))
Definition: lcddevice.cpp:535
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:521
LCD::switchToMusic
void switchToMusic(const QString &artist, const QString &album, const QString &track)
Definition: lcddevice.cpp:570
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:432
LCD::LCD
LCD()
Definition: lcddevice.cpp:44
logPropagateArgs
QString logPropagateArgs
Definition: logging.cpp:82
LCDMenuItem::isSelected
bool isSelected() const
Definition: lcddevice.h:34
CHECKED
@ CHECKED
Definition: lcddevice.h:17
LCD::setVariousLEDs
void setVariousLEDs(enum LCDVariousFlags various, bool on)
Definition: lcddevice.cpp:442
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:495
GENERIC_EXIT_RUNNING
@ GENERIC_EXIT_RUNNING
Process is running.
Definition: exitcodes.h:26
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:468
LCD::stopAll
void stopAll(void)
Definition: lcddevice.cpp:378
LCDMenuItem::Scroll
bool Scroll() const
Definition: lcddevice.h:36
LCD
Definition: lcddevice.h:169
LCD::setAudioFormatLEDs
void setAudioFormatLEDs(enum LCDAudioFormatSet acodec, bool on)
Definition: lcddevice.cpp:398
LCD::switchToMenu
void switchToMenu(QList< LCDMenuItem > &menuItems, const QString &app_name="", bool popMenu=true)
Definition: lcddevice.cpp:595
LCD::startLCDServer
static bool startLCDServer(void)
Definition: lcddevice.cpp:742
LCD::outputLEDs
void outputLEDs()
Definition: lcddevice.cpp:543
LCD::switchToTime
void switchToTime()
Definition: lcddevice.cpp:560