MythTV  master
lcddevice.cpp
Go to the documentation of this file.
1 /*
2  lcddevice.cpp
3 
4  a MythTV project object to control an
5  LCDproc server
6 
7  (c) 2002, 2003 Thor Sigvaldason, Dan Morphis and Isaac Richards
8 */
9 
10 // C++ headers
11 #include <cerrno>
12 #include <chrono>
13 #include <cmath>
14 #include <cstdlib>
15 #include <fcntl.h>
16 #include <unistd.h> // for usleep()
17 
18 // Qt headers
19 #include <QApplication>
20 #include <QTextStream>
21 #include <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 
57  connect(m_ledTimer, &QTimer::timeout, this, &LCD::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, &QIODevice::readyRead,
155  this, &LCD::ReadyRead);
156  QObject::connect(m_socket, &QAbstractSocket::disconnected,
157  this, &LCD::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(10s);
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 
257  // This gets activated automatically by the MythSocket class whenever
258  // there's something to read.
259  //
260  // We currently spend most of our time (except for the first line sent
261  // back) ignoring it.
262 
263  int dataSize = static_cast<int>(m_socket->bytesAvailable() + 1);
264  QByteArray data(dataSize + 1, 0);
265 
266  m_socket->read(data.data(), dataSize);
267 
268  lineFromServer = data;
269  lineFromServer = lineFromServer.simplified();
270 
271  // Make debugging be less noisy
272  if (lineFromServer != "OK")
273  LOG(VB_NETWORK, LOG_DEBUG, LOC + QString("Received from server: %1")
274  .arg(lineFromServer));
275 
276  aList = lineFromServer.split(' ');
277  if (aList[0] == "CONNECTED")
278  {
279  // We got "CONNECTED", which is a response to "HELLO"
280  // get lcd width & height
281  if (aList.count() != 3)
282  {
283  LOG(VB_GENERAL, LOG_ERR, LOC + "received bad no. of arguments in "
284  "CONNECTED response from LCDServer");
285  }
286 
287  bool bOK = false;
288  m_lcdWidth = aList[1].toInt(&bOK);
289  if (!bOK)
290  {
291  LOG(VB_GENERAL, LOG_ERR, LOC + "received bad int for width in "
292  "CONNECTED response from LCDServer");
293  }
294 
295  m_lcdHeight = aList[2].toInt(&bOK);
296  if (!bOK)
297  {
298  LOG(VB_GENERAL, LOG_ERR, LOC + "received bad int for height in "
299  "CONNECTED response from LCDServer");
300  }
301 
302  init();
303  }
304  else if (aList[0] == "HUH?")
305  {
306  LOG(VB_GENERAL, LOG_WARNING, LOC + "Something is getting passed to "
307  "LCDServer that it does not understand");
308  LOG(VB_GENERAL, LOG_WARNING, LOC +
309  QString("last command: %1").arg(m_lastCommand));
310  }
311  else if (aList[0] == "KEY")
312  handleKeyPress(aList.last().trimmed());
313 }
314 
315 void LCD::handleKeyPress(const QString &keyPressed)
316 {
317  int key = 0;
318 
319  QChar mykey = keyPressed.at(0);
320  if (mykey == m_lcdKeyString.at(0))
321  key = Qt::Key_Up;
322  else if (mykey == m_lcdKeyString.at(1))
323  key = Qt::Key_Down;
324  else if (mykey == m_lcdKeyString.at(2))
325  key = Qt::Key_Left;
326  else if (mykey == m_lcdKeyString.at(3))
327  key = Qt::Key_Right;
328  else if (mykey == m_lcdKeyString.at(4))
329  key = Qt::Key_Space;
330  else if (mykey == m_lcdKeyString.at(5))
331  key = Qt::Key_Escape;
332 
333  QCoreApplication::postEvent(
334  (QObject *)(QApplication::activeWindow()),
335  new ExternalKeycodeEvent(key));
336 }
337 
338 void LCD::init()
339 {
340  // Stop the timer
341  m_retryTimer->stop();
342 
343  // Get LCD settings
344  m_lcdShowMusic = (GetMythDB()->GetSetting("LCDShowMusic", "1") == "1");
345  m_lcdShowTime = (GetMythDB()->GetSetting("LCDShowTime", "1") == "1");
346  m_lcdShowChannel = (GetMythDB()->GetSetting("LCDShowChannel", "1") == "1");
347  m_lcdShowGeneric = (GetMythDB()->GetSetting("LCDShowGeneric", "1") == "1");
348  m_lcdShowVolume = (GetMythDB()->GetSetting("LCDShowVolume", "1") == "1");
349  m_lcdShowMenu = (GetMythDB()->GetSetting("LCDShowMenu", "1") == "1");
350  m_lcdShowRecStatus = (GetMythDB()->GetSetting("LCDShowRecStatus", "1") == "1");
351  m_lcdKeyString = GetMythDB()->GetSetting("LCDKeyString", "ABCDEF");
352 
353  m_connected = true;
354  m_lcdReady = true;
355 
356  // send buffer if there's anything in there
357  if (m_sendBuffer.length() > 0)
358  {
360  m_sendBuffer = "";
361  }
362 }
363 
365 {
366  m_connected = false;
367 }
368 
370 {
371  if (!m_lcdReady)
372  return;
373 
374  LOG(VB_GENERAL, LOG_DEBUG, LOC + "stopAll");
375 
376  emit sendToServer("STOP_ALL");
377 }
378 
379 void LCD::setSpeakerLEDs(enum LCDSpeakerSet speaker, bool on)
380 {
381  if (!m_lcdReady)
382  return;
384  if (on)
385  m_lcdLedMask |= speaker;
386  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
387 }
388 
389 void LCD::setAudioFormatLEDs(enum LCDAudioFormatSet acodec, bool on)
390 {
391  if (!m_lcdReady)
392  return;
393 
395  if (on)
396  m_lcdLedMask |= (acodec & AUDIO_MASK);
397 
398  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
399 }
400 
401 void LCD::setVideoFormatLEDs(enum LCDVideoFormatSet vcodec, bool on)
402 {
403  if (!m_lcdReady)
404  return;
405 
407  if (on)
408  m_lcdLedMask |= (vcodec & VIDEO_MASK);
409 
410  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
411 }
412 
413 void LCD::setVideoSrcLEDs(enum LCDVideoSourceSet vsrc, bool on)
414 {
415  if (!m_lcdReady)
416  return;
418  if (on)
419  m_lcdLedMask |= vsrc;
420  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
421 }
422 
423 void LCD::setFunctionLEDs(enum LCDFunctionSet func, bool on)
424 {
425  if (!m_lcdReady)
426  return;
428  if (on)
429  m_lcdLedMask |= func;
430  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
431 }
432 
433 void LCD::setVariousLEDs(enum LCDVariousFlags various, bool on)
434 {
435  if (!m_lcdReady)
436  return;
437  if (on) {
438  m_lcdLedMask |= various;
439  if (various == VARIOUS_SPDIF)
441  } else {
442  m_lcdLedMask &= ~various;
443  if (various == VARIOUS_SPDIF)
445  }
446  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
447 }
448 
449 void LCD::setTunerLEDs(enum LCDTunerSet tuner, bool on)
450 {
451  if (!m_lcdReady)
452  return;
454  if (on)
455  m_lcdLedMask |= tuner;
456  emit sendToServer(QString("UPDATE_LEDS %1").arg(m_lcdLedMask));
457 }
458 
459 void LCD::setChannelProgress(const QString &time, float value)
460 {
461  if (!m_lcdReady || !m_lcdShowChannel)
462  return;
463 
464  value = std::min(std::max(0.0F, value), 1.0F);
465  emit sendToServer(QString("SET_CHANNEL_PROGRESS %1 %2").arg(quotedString(time))
466  .arg(value));
467 }
468 
469 void LCD::setGenericProgress(float value)
470 {
471  if (!m_lcdReady || !m_lcdShowGeneric)
472  return;
473 
474  value = std::min(std::max(0.0F, value), 1.0F);
475  emit sendToServer(QString("SET_GENERIC_PROGRESS 0 %1").arg(value));
476 }
477 
479 {
480  if (!m_lcdReady || !m_lcdShowGeneric)
481  return;
482 
483  emit sendToServer("SET_GENERIC_PROGRESS 1 0.0");
484 }
485 
486 void LCD::setMusicProgress(const QString &time, float value)
487 {
488  if (!m_lcdReady || !m_lcdShowMusic)
489  return;
490 
491  value = std::min(std::max(0.0F, value), 1.0F);
492  emit sendToServer("SET_MUSIC_PROGRESS " + quotedString(time) + ' ' +
493  QString().setNum(value));
494 }
495 
496 void LCD::setMusicShuffle(int shuffle)
497 {
498  if (!m_lcdReady || !m_lcdShowMusic)
499  return;
500 
501  emit sendToServer(QString("SET_MUSIC_PLAYER_PROP SHUFFLE %1").arg(shuffle));
502 }
503 
504 void LCD::setMusicRepeat(int repeat)
505 {
506  if (!m_lcdReady || !m_lcdShowMusic)
507  return;
508 
509  emit sendToServer(QString("SET_MUSIC_PLAYER_PROP REPEAT %1").arg(repeat));
510 }
511 
512 void LCD::setVolumeLevel(float value)
513 {
514  if (!m_lcdReady || !m_lcdShowVolume)
515  return;
516 
517  if (value < 0.0F)
518  value = 0.0F;
519  else if (value > 1.0F)
520  value = 1.0F;
521 
522  // NOLINTNEXTLINE(readability-misleading-indentation)
523  emit sendToServer("SET_VOLUME_LEVEL " + QString().setNum(value));
524 }
525 
526 void LCD::setupLEDs(int(*LedMaskFunc)(void))
527 {
528  m_getLEDMask = LedMaskFunc;
529  // update LED status every 10 seconds
530  m_ledTimer->setSingleShot(false);
531  m_ledTimer->start(10s);
532 }
533 
535 {
536  /* now implemented elsewhere for advanced icon control */
537 #if 0
538  if (!lcd_ready)
539  return;
540 
541  QString aString;
542  int mask = 0;
543  if (0 && m_getLEDMask)
544  mask = m_getLEDMask();
545  aString = "UPDATE_LEDS ";
546  aString += QString::number(mask);
547  emit sendToServer(aString);
548 #endif
549 }
550 
552 {
553  if (!m_lcdReady)
554  return;
555 
556  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToTime");
557 
558  emit sendToServer("SWITCH_TO_TIME");
559 }
560 
561 void LCD::switchToMusic(const QString &artist, const QString &album, const QString &track)
562 {
563  if (!m_lcdReady || !m_lcdShowMusic)
564  return;
565 
566  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMusic");
567 
568  emit sendToServer("SWITCH_TO_MUSIC " + quotedString(artist) + ' '
569  + quotedString(album) + ' '
570  + quotedString(track));
571 }
572 
573 void LCD::switchToChannel(const QString &channum, const QString &title,
574  const QString &subtitle)
575 {
576  if (!m_lcdReady || !m_lcdShowChannel)
577  return;
578 
579  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToChannel");
580 
581  emit sendToServer("SWITCH_TO_CHANNEL " + quotedString(channum) + ' '
582  + quotedString(title) + ' '
583  + quotedString(subtitle));
584 }
585 
586 void LCD::switchToMenu(QList<LCDMenuItem> &menuItems, const QString &app_name,
587  bool popMenu)
588 {
589  if (!m_lcdReady || !m_lcdShowMenu)
590  return;
591 
592  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToMenu");
593 
594  if (menuItems.isEmpty())
595  return;
596 
597  QString s = "SWITCH_TO_MENU ";
598 
599  s += quotedString(app_name);
600  s += ' ' + QString(popMenu ? "TRUE" : "FALSE");
601 
602 
603  QListIterator<LCDMenuItem> it(menuItems);
604 
605  while (it.hasNext())
606  {
607  const LCDMenuItem *curItem = &(it.next());
608  s += ' ' + quotedString(curItem->ItemName());
609 
610  if (curItem->isChecked() == CHECKED)
611  s += " CHECKED";
612  else if (curItem->isChecked() == UNCHECKED)
613  s += " UNCHECKED";
614  else if (curItem->isChecked() == NOTCHECKABLE)
615  s += " NOTCHECKABLE";
616 
617  s += ' ' + QString(curItem->isSelected() ? "TRUE" : "FALSE");
618  s += ' ' + QString(curItem->Scroll() ? "TRUE" : "FALSE");
619  QString sIndent;
620  sIndent.setNum(curItem->getIndent());
621  s += ' ' + sIndent;
622  }
623 
624  emit sendToServer(s);
625 }
626 
627 void LCD::switchToGeneric(QList<LCDTextItem> &textItems)
628 {
629  if (!m_lcdReady || !m_lcdShowGeneric)
630  return;
631 
632  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToGeneric");
633 
634  if (textItems.isEmpty())
635  return;
636 
637  QString s = "SWITCH_TO_GENERIC";
638 
639  QListIterator<LCDTextItem> it(textItems);
640 
641  while (it.hasNext())
642  {
643  const LCDTextItem *curItem = &(it.next());
644 
645  QString sRow;
646  sRow.setNum(curItem->getRow());
647  s += ' ' + sRow;
648 
649  if (curItem->getAlignment() == ALIGN_LEFT)
650  s += " ALIGN_LEFT";
651  else if (curItem->getAlignment() == ALIGN_RIGHT)
652  s += " ALIGN_RIGHT";
653  else if (curItem->getAlignment() == ALIGN_CENTERED)
654  s += " ALIGN_CENTERED";
655 
656  s += ' ' + quotedString(curItem->getText());
657  s += ' ' + quotedString(curItem->getScreen());
658  s += ' ' + QString(curItem->getScroll() ? "TRUE" : "FALSE");
659  }
660 
661  emit sendToServer(s);
662 }
663 
664 void LCD::switchToVolume(const QString &app_name)
665 {
666  if (!m_lcdReady || !m_lcdShowVolume)
667  return;
668 
669  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToVolume");
670 
671  emit sendToServer("SWITCH_TO_VOLUME " + quotedString(app_name));
672 }
673 
675 {
676  if (!m_lcdReady)
677  return;
678 
679  LOG(VB_GENERAL, LOG_DEBUG, LOC + "switchToNothing");
680 
681  emit sendToServer("SWITCH_TO_NOTHING");
682 }
683 
685 {
686  QMutexLocker locker(&m_socketLock);
687 
688  LOG(VB_GENERAL, LOG_DEBUG, LOC + "shutdown");
689 
690  if (m_socket)
691  m_socket->close();
692 
693  m_lcdReady = false;
694  m_connected = false;
695 }
696 
698 {
699  QMutexLocker locker(&m_socketLock);
700 
701  if (!m_lcdReady)
702  return;
703 
704  LOG(VB_GENERAL, LOG_DEBUG, LOC + "RESET");
705 
706  emit sendToServer("RESET");
707 }
708 
710 {
711  m_lcd = nullptr;
712 
713  LOG(VB_GENERAL, LOG_DEBUG, LOC + "An LCD device is being snuffed out of "
714  "existence (~LCD() was called)");
715 
716  if (m_socket)
717  {
718  delete m_socket;
719  m_socket = nullptr;
720  m_lcdReady = false;
721  }
722 }
723 
724 QString LCD::quotedString(const QString &string)
725 {
726  QString sRes = string;
727  sRes.replace(QString("\""), QString("\"\""));
728  sRes = "\"" + sRes + "\"";
729 
730  return(sRes);
731 }
732 
734 {
735  QString command = GetAppBinDir() + "mythlcdserver";
736  command += logPropagateArgs;
739 
740  uint retval = myth_system(command, flags);
741  return( retval == GENERIC_EXIT_RUNNING );
742 }
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:573
LCD::handleKeyPress
void handleKeyPress(const QString &keyPressed)
Definition: lcddevice.cpp:315
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:449
kMSDontBlockInputDevs
@ kMSDontBlockInputDevs
avoid blocking LIRC & Joystick Menu
Definition: mythsystem.h:35
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:478
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:379
LCD::m_lcdShowChannel
bool m_lcdShowChannel
Definition: lcddevice.h:339
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
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:45
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:674
LCDAudioFormatSet
LCDAudioFormatSet
Definition: lcddevice.h:103
LCD::Get
static LCD * Get(void)
Definition: lcddevice.cpp:65
mythsystemlegacy.h
LCD::sendToServer
void sendToServer(const QString &someText)
LCD::setMusicShuffle
void setMusicShuffle(int shuffle)
Set music player's shuffle properties.
Definition: lcddevice.cpp:496
ExternalKeycodeEvent
Definition: mythevent.h:91
mythlogging.h
LCDMenuItem::isChecked
CHECKED_STATE isChecked() const
Definition: lcddevice.h:33
LCD::m_lcd
static LCD * m_lcd
Definition: lcddevice.h:178
VSRC_MASK
@ VSRC_MASK
Definition: lcddevice.h:136
LCD::setVideoFormatLEDs
void setVideoFormatLEDs(enum LCDVideoFormatSet vcodec, bool on)
Definition: lcddevice.cpp:401
LCD::m_getLEDMask
int(* m_getLEDMask)(void)
Definition: lcddevice.h:350
LCD::shutdown
void shutdown()
Definition: lcddevice.cpp:684
compat.h
LCD::m_hostname
QString m_hostname
Definition: lcddevice.h:320
LOC
#define LOC
Definition: lcddevice.cpp:38
LCD::Disconnected
void Disconnected(void)
Definition: lcddevice.cpp:364
ALIGN_CENTERED
@ ALIGN_CENTERED
Definition: lcddevice.h:57
LCD::switchToGeneric
void switchToGeneric(QList< LCDTextItem > &textItems)
Definition: lcddevice.cpp:627
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:141
LCD::sendToServerSlot
void sendToServerSlot(const QString &someText)
Definition: lcddevice.cpp:183
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:42
LCD::resetServer
void resetServer(void)
Definition: lcddevice.cpp:697
LCD::init
void init()
Definition: lcddevice.cpp:338
ALIGN_LEFT
@ ALIGN_LEFT
Definition: lcddevice.h:57
kMSRunBackground
@ kMSRunBackground
run child in the background
Definition: mythsystem.h:37
LCDMenuItem
Definition: lcddevice.h:21
LCD::quotedString
static QString quotedString(const QString &string)
Definition: lcddevice.cpp:724
LCD::connectToHost
bool connectToHost(const QString &hostname, unsigned int port)
Definition: lcddevice.cpp:103
LCD::setMusicRepeat
void setMusicRepeat(int repeat)
Set music player's repeat properties.
Definition: lcddevice.cpp:504
LCDMenuItem::ItemName
QString ItemName() const
Definition: lcddevice.h:35
LCD::~LCD
~LCD() override
Definition: lcddevice.cpp:709
LCD::setGenericProgress
void setGenericProgress(float value)
Update the generic progress bar.
Definition: lcddevice.cpp:469
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:236
LCD::SetupLCD
static void SetupLCD(void)
Definition: lcddevice.cpp:72
ALIGN_RIGHT
@ ALIGN_RIGHT
Definition: lcddevice.h:57
LCD::setVideoSrcLEDs
void setVideoSrcLEDs(enum LCDVideoSourceSet vsrc, bool on)
Definition: lcddevice.cpp:413
LCD::m_socket
QTcpSocket * m_socket
Definition: lcddevice.h:318
NOTCHECKABLE
@ NOTCHECKABLE
Definition: lcddevice.h:17
LCDVideoFormatSet
LCDVideoFormatSet
Definition: lcddevice.h:118
LCD::m_retryTimer
QTimer * m_retryTimer
Definition: lcddevice.h:324
FUNC_MASK
@ FUNC_MASK
Definition: lcddevice.h:159
LCD::switchToVolume
void switchToVolume(const QString &app_name)
Definition: lcddevice.cpp:664
LCD::setupLEDs
void setupLEDs(int(*LedMaskFunc)(void))
Definition: lcddevice.cpp:526
SPDIF_MASK
@ SPDIF_MASK
Definition: lcddevice.h:152
LCDTextItem
Definition: lcddevice.h:59
GetAppBinDir
QString GetAppBinDir(void)
Definition: mythdirs.cpp:221
LCD::setVolumeLevel
void setVolumeLevel(float value)
Definition: lcddevice.cpp:512
LCD::switchToMusic
void switchToMusic(const QString &artist, const QString &album, const QString &track)
Definition: lcddevice.cpp:561
LCD::ReadyRead
void ReadyRead(void)
Definition: lcddevice.cpp:247
LCDMenuItem::getIndent
unsigned int getIndent() const
Definition: lcddevice.h:37
LCD::setFunctionLEDs
void setFunctionLEDs(enum LCDFunctionSet func, bool on)
Definition: lcddevice.cpp:423
LCD::LCD
LCD()
Definition: lcddevice.cpp:40
logPropagateArgs
QString logPropagateArgs
Definition: logging.cpp:86
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:433
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:36
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:486
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:459
LCD::stopAll
void stopAll(void)
Definition: lcddevice.cpp:369
LCDMenuItem::Scroll
bool Scroll() const
Definition: lcddevice.h:36
LCD
Definition: lcddevice.h:169
LCD::setAudioFormatLEDs
void setAudioFormatLEDs(enum LCDAudioFormatSet acodec, bool on)
Definition: lcddevice.cpp:389
LCD::switchToMenu
void switchToMenu(QList< LCDMenuItem > &menuItems, const QString &app_name="", bool popMenu=true)
Definition: lcddevice.cpp:586
LCD::startLCDServer
static bool startLCDServer(void)
Definition: lcddevice.cpp:733
LCD::outputLEDs
void outputLEDs()
Definition: lcddevice.cpp:534
LCD::switchToTime
void switchToTime()
Definition: lcddevice.cpp:551