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