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