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