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