MythTV  master
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
LCD Class Reference

#include <libmythbase/lcddevice.h>

Inheritance diagram for LCD:
[legend]
Collaboration diagram for LCD:
[legend]

Public Types

enum  : std::uint8_t { MUSIC_REPEAT_NONE = 0, MUSIC_REPEAT_TRACK = 1, MUSIC_REPEAT_ALL = 2 }
 
enum  : std::uint8_t {
  MUSIC_SHUFFLE_NONE = 0, MUSIC_SHUFFLE_RAND = 1, MUSIC_SHUFFLE_SMART = 2, MUSIC_SHUFFLE_ALBUM = 3,
  MUSIC_SHUFFLE_ARTIST = 4
}
 

Signals

void sendToServer (const QString &someText)
 

Public Member Functions

 ~LCD () override
 
bool connectToHost (const QString &hostname, unsigned int port)
 
void switchToTime ()
 
void setSpeakerLEDs (enum LCDSpeakerSet speaker, bool on)
 
void setAudioFormatLEDs (enum LCDAudioFormatSet acodec, bool on)
 
void setVideoFormatLEDs (enum LCDVideoFormatSet vcodec, bool on)
 
void setVideoSrcLEDs (enum LCDVideoSourceSet vsrc, bool on)
 
void setFunctionLEDs (enum LCDFunctionSet func, bool on)
 
void setTunerLEDs (enum LCDTunerSet tuner, bool on)
 
void setVariousLEDs (enum LCDVariousFlags various, bool on)
 
void switchToMusic (const QString &artist, const QString &album, const QString &track)
 
void switchToChannel (const QString &channum="", const QString &title="", const QString &subtitle="")
 
void setChannelProgress (const QString &time, float value)
 
void switchToMenu (QList< LCDMenuItem > &menuItems, const QString &app_name="", bool popMenu=true)
 
void switchToGeneric (QList< LCDTextItem > &textItems)
 
void setGenericProgress (float value)
 Update the generic progress bar. More...
 
void setGenericBusy ()
 Update the generic screen to display a busy spinner. More...
 
void setMusicProgress (const QString &time, float value)
 
void setMusicRepeat (int repeat)
 Set music player's repeat properties. More...
 
void setMusicShuffle (int shuffle)
 Set music player's shuffle properties. More...
 
void switchToVolume (const QString &app_name)
 
void setVolumeLevel (float value)
 
void switchToNothing ()
 
void shutdown ()
 
void setupLEDs (int(*LedMaskFunc)(void))
 
void stopAll (void)
 
int getLCDHeight (void) const
 
int getLCDWidth (void) const
 
void resetServer (void)
 

Static Public Member Functions

static LCDGet (void)
 
static void SetupLCD (void)
 

Protected Member Functions

 LCD ()
 

Static Protected Attributes

static bool m_serverUnavailable = false
 
static LCDm_lcd = nullptr
 
static bool m_enabled = false
 

Private Slots

void restartConnection ()
 
void outputLEDs ()
 
void sendToServerSlot (const QString &someText)
 
void ReadyRead (void)
 
void Disconnected (void)
 

Private Member Functions

void init ()
 
void handleKeyPress (const QString &keyPressed)
 
void describeServer ()
 

Static Private Member Functions

static bool startLCDServer (void)
 
static QString quotedString (const QString &string)
 

Private Attributes

QTcpSocket * m_socket {nullptr}
 
QRecursiveMutex m_socketLock
 
QString m_hostname {"localhost"}
 
uint m_port {6545}
 
bool m_connected {false}
 
QTimer * m_retryTimer {nullptr}
 
QTimer * m_ledTimer {nullptr}
 
QString m_sendBuffer
 
QString m_lastCommand
 
int m_lcdWidth {0}
 
int m_lcdHeight {0}
 
bool m_lcdReady {false}
 
bool m_lcdShowTime {false}
 
bool m_lcdShowMenu {false}
 
bool m_lcdShowGeneric {false}
 
bool m_lcdShowMusic {false}
 
bool m_lcdShowChannel {false}
 
bool m_lcdShowVolume {false}
 
bool m_lcdShowRecStatus {false}
 
bool m_lcdBacklightOn {false}
 
bool m_lcdHeartbeatOn {false}
 
int m_lcdPopupTime {0}
 
QString m_lcdShowMusicItems
 
QString m_lcdKeyString
 
int m_lcdLedMask {0}
 
int(* m_getLEDMask )(void)
 

Friends

class TestLcdDevice
 

Detailed Description

Definition at line 169 of file lcddevice.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : std::uint8_t
Enumerator
MUSIC_REPEAT_NONE 
MUSIC_REPEAT_TRACK 
MUSIC_REPEAT_ALL 

Definition at line 184 of file lcddevice.h.

◆ anonymous enum

anonymous enum : std::uint8_t
Enumerator
MUSIC_SHUFFLE_NONE 
MUSIC_SHUFFLE_RAND 
MUSIC_SHUFFLE_SMART 
MUSIC_SHUFFLE_ALBUM 
MUSIC_SHUFFLE_ARTIST 

Definition at line 190 of file lcddevice.h.

Constructor & Destructor Documentation

◆ LCD()

LCD::LCD ( )
protected

Definition at line 44 of file lcddevice.cpp.

Referenced by Get().

◆ ~LCD()

LCD::~LCD ( )
override

Definition at line 720 of file lcddevice.cpp.

Member Function Documentation

◆ Get()

LCD * LCD::Get ( void  )
static

◆ SetupLCD()

void LCD::SetupLCD ( void  )
static

Definition at line 76 of file lcddevice.cpp.

Referenced by main(), and reloadTheme().

◆ connectToHost()

bool LCD::connectToHost ( const QString &  hostname,
unsigned int  port 
)

Definition at line 107 of file lcddevice.cpp.

Referenced by restartConnection(), and SetupLCD().

◆ switchToTime()

void LCD::switchToTime ( )

Definition at line 562 of file lcddevice.cpp.

◆ setSpeakerLEDs()

void LCD::setSpeakerLEDs ( enum LCDSpeakerSet  speaker,
bool  on 
)

Definition at line 390 of file lcddevice.cpp.

◆ setAudioFormatLEDs()

void LCD::setAudioFormatLEDs ( enum LCDAudioFormatSet  acodec,
bool  on 
)

Definition at line 400 of file lcddevice.cpp.

◆ setVideoFormatLEDs()

void LCD::setVideoFormatLEDs ( enum LCDVideoFormatSet  vcodec,
bool  on 
)

Definition at line 412 of file lcddevice.cpp.

◆ setVideoSrcLEDs()

void LCD::setVideoSrcLEDs ( enum LCDVideoSourceSet  vsrc,
bool  on 
)

Definition at line 424 of file lcddevice.cpp.

◆ setFunctionLEDs()

void LCD::setFunctionLEDs ( enum LCDFunctionSet  func,
bool  on 
)

Definition at line 434 of file lcddevice.cpp.

Referenced by VideoPlayerCommand::Play().

◆ setTunerLEDs()

void LCD::setTunerLEDs ( enum LCDTunerSet  tuner,
bool  on 
)

Definition at line 460 of file lcddevice.cpp.

◆ setVariousLEDs()

void LCD::setVariousLEDs ( enum LCDVariousFlags  various,
bool  on 
)

Definition at line 444 of file lcddevice.cpp.

◆ switchToMusic()

void LCD::switchToMusic ( const QString &  artist,
const QString &  album,
const QString &  track 
)

Definition at line 572 of file lcddevice.cpp.

Referenced by MusicCommon::setTrackOnLCD().

◆ switchToChannel()

void LCD::switchToChannel ( const QString &  channum = "",
const QString &  title = "",
const QString &  subtitle = "" 
)

◆ setChannelProgress()

void LCD::setChannelProgress ( const QString &  time,
float  value 
)

Definition at line 470 of file lcddevice.cpp.

Referenced by TV::HandleLCDTimerEvent().

◆ switchToMenu()

void LCD::switchToMenu ( QList< LCDMenuItem > &  menuItems,
const QString &  app_name = "",
bool  popMenu = true 
)

Definition at line 597 of file lcddevice.cpp.

Referenced by MythUIButtonList::updateLCD().

◆ switchToGeneric()

void LCD::switchToGeneric ( QList< LCDTextItem > &  textItems)

Definition at line 638 of file lcddevice.cpp.

◆ setGenericProgress()

void LCD::setGenericProgress ( float  value)

Update the generic progress bar.

Parameters
generic_progressa value between 0 and 1.0

Definition at line 480 of file lcddevice.cpp.

◆ setGenericBusy()

void LCD::setGenericBusy ( )

Update the generic screen to display a busy spinner.

Note
The LCD busy spinner only 'moves' when this is called instead of the lcdserver just handling it itself.

Definition at line 489 of file lcddevice.cpp.

◆ setMusicProgress()

void LCD::setMusicProgress ( const QString &  time,
float  value 
)

Definition at line 497 of file lcddevice.cpp.

◆ setMusicRepeat()

void LCD::setMusicRepeat ( int  repeat)

Set music player's repeat properties.

Parameters
repeatthe state of repeat

Definition at line 515 of file lcddevice.cpp.

◆ setMusicShuffle()

void LCD::setMusicShuffle ( int  shuffle)

Set music player's shuffle properties.

Parameters
shufflethe state of shuffle

Definition at line 507 of file lcddevice.cpp.

◆ switchToVolume()

void LCD::switchToVolume ( const QString &  app_name)

Definition at line 675 of file lcddevice.cpp.

◆ setVolumeLevel()

void LCD::setVolumeLevel ( float  value)

Definition at line 523 of file lcddevice.cpp.

◆ switchToNothing()

void LCD::switchToNothing ( )

Definition at line 685 of file lcddevice.cpp.

◆ shutdown()

void LCD::shutdown ( )

Definition at line 695 of file lcddevice.cpp.

◆ setupLEDs()

void LCD::setupLEDs ( int(*)(void)  LedMaskFunc)

Definition at line 537 of file lcddevice.cpp.

◆ stopAll()

void LCD::stopAll ( void  )

Definition at line 380 of file lcddevice.cpp.

◆ getLCDHeight()

int LCD::getLCDHeight ( void  ) const
inline

Definition at line 292 of file lcddevice.h.

Referenced by MythUIButtonList::updateLCD().

◆ getLCDWidth()

int LCD::getLCDWidth ( void  ) const
inline

Definition at line 293 of file lcddevice.h.

Referenced by TV::HandleLCDTimerEvent().

◆ resetServer()

void LCD::resetServer ( void  )

Definition at line 708 of file lcddevice.cpp.

◆ restartConnection

void LCD::restartConnection ( )
privateslot

Definition at line 245 of file lcddevice.cpp.

Referenced by LCD().

◆ outputLEDs

void LCD::outputLEDs ( )
privateslot

Definition at line 545 of file lcddevice.cpp.

Referenced by LCD().

◆ sendToServerSlot

void LCD::sendToServerSlot ( const QString &  someText)
privateslot

Definition at line 188 of file lcddevice.cpp.

Referenced by LCD().

◆ sendToServer

void LCD::sendToServer ( const QString &  someText)
signal

◆ startLCDServer()

bool LCD::startLCDServer ( void  )
staticprivate

Definition at line 744 of file lcddevice.cpp.

Referenced by connectToHost().

◆ init()

void LCD::init ( )
private

Definition at line 349 of file lcddevice.cpp.

Referenced by ReadyRead().

◆ handleKeyPress()

void LCD::handleKeyPress ( const QString &  keyPressed)
private

Definition at line 326 of file lcddevice.cpp.

Referenced by ReadyRead().

◆ quotedString()

QString LCD::quotedString ( const QString &  string)
staticprivate

◆ describeServer()

void LCD::describeServer ( )
private

◆ ReadyRead

void LCD::ReadyRead ( void  )
privateslot

Definition at line 256 of file lcddevice.cpp.

Referenced by connectToHost().

◆ Disconnected

void LCD::Disconnected ( void  )
privateslot

Definition at line 375 of file lcddevice.cpp.

Referenced by connectToHost().

Friends And Related Function Documentation

◆ TestLcdDevice

friend class TestLcdDevice
friend

Definition at line 172 of file lcddevice.h.

Member Data Documentation

◆ m_serverUnavailable

bool LCD::m_serverUnavailable = false
staticprotected

Definition at line 177 of file lcddevice.h.

Referenced by connectToHost(), Get(), restartConnection(), and SetupLCD().

◆ m_lcd

LCD * LCD::m_lcd = nullptr
staticprotected

Definition at line 178 of file lcddevice.h.

Referenced by Get(), SetupLCD(), and ~LCD().

◆ m_enabled

bool LCD::m_enabled = false
staticprotected

Definition at line 179 of file lcddevice.h.

Referenced by connectToHost(), Get(), and SetupLCD().

◆ m_socket

QTcpSocket* LCD::m_socket {nullptr}
private

Definition at line 318 of file lcddevice.h.

Referenced by connectToHost(), ReadyRead(), sendToServerSlot(), shutdown(), and ~LCD().

◆ m_socketLock

QRecursiveMutex LCD::m_socketLock
private

Definition at line 319 of file lcddevice.h.

Referenced by connectToHost(), ReadyRead(), resetServer(), sendToServerSlot(), and shutdown().

◆ m_hostname

QString LCD::m_hostname {"localhost"}
private

Definition at line 320 of file lcddevice.h.

Referenced by connectToHost(), and restartConnection().

◆ m_port

uint LCD::m_port {6545}
private

Definition at line 321 of file lcddevice.h.

Referenced by connectToHost(), and restartConnection().

◆ m_connected

bool LCD::m_connected {false}
private

◆ m_retryTimer

QTimer* LCD::m_retryTimer {nullptr}
private

Definition at line 324 of file lcddevice.h.

Referenced by init(), LCD(), and sendToServerSlot().

◆ m_ledTimer

QTimer* LCD::m_ledTimer {nullptr}
private

Definition at line 325 of file lcddevice.h.

Referenced by LCD(), and setupLEDs().

◆ m_sendBuffer

QString LCD::m_sendBuffer
private

Definition at line 327 of file lcddevice.h.

Referenced by init(), LCD(), and sendToServerSlot().

◆ m_lastCommand

QString LCD::m_lastCommand
private

Definition at line 328 of file lcddevice.h.

Referenced by LCD(), ReadyRead(), and sendToServerSlot().

◆ m_lcdWidth

int LCD::m_lcdWidth {0}
private

Definition at line 330 of file lcddevice.h.

Referenced by ReadyRead().

◆ m_lcdHeight

int LCD::m_lcdHeight {0}
private

Definition at line 331 of file lcddevice.h.

Referenced by ReadyRead().

◆ m_lcdReady

bool LCD::m_lcdReady {false}
private

◆ m_lcdShowTime

bool LCD::m_lcdShowTime {false}
private

Definition at line 335 of file lcddevice.h.

Referenced by init().

◆ m_lcdShowMenu

bool LCD::m_lcdShowMenu {false}
private

Definition at line 336 of file lcddevice.h.

Referenced by init(), and switchToMenu().

◆ m_lcdShowGeneric

bool LCD::m_lcdShowGeneric {false}
private

Definition at line 337 of file lcddevice.h.

Referenced by init(), setGenericBusy(), setGenericProgress(), and switchToGeneric().

◆ m_lcdShowMusic

bool LCD::m_lcdShowMusic {false}
private

Definition at line 338 of file lcddevice.h.

Referenced by init(), setMusicProgress(), setMusicRepeat(), setMusicShuffle(), and switchToMusic().

◆ m_lcdShowChannel

bool LCD::m_lcdShowChannel {false}
private

Definition at line 339 of file lcddevice.h.

Referenced by init(), setChannelProgress(), and switchToChannel().

◆ m_lcdShowVolume

bool LCD::m_lcdShowVolume {false}
private

Definition at line 340 of file lcddevice.h.

Referenced by init(), setVolumeLevel(), and switchToVolume().

◆ m_lcdShowRecStatus

bool LCD::m_lcdShowRecStatus {false}
private

Definition at line 341 of file lcddevice.h.

Referenced by init().

◆ m_lcdBacklightOn

bool LCD::m_lcdBacklightOn {false}
private

Definition at line 342 of file lcddevice.h.

◆ m_lcdHeartbeatOn

bool LCD::m_lcdHeartbeatOn {false}
private

Definition at line 343 of file lcddevice.h.

◆ m_lcdPopupTime

int LCD::m_lcdPopupTime {0}
private

Definition at line 344 of file lcddevice.h.

◆ m_lcdShowMusicItems

QString LCD::m_lcdShowMusicItems
private

Definition at line 345 of file lcddevice.h.

Referenced by LCD().

◆ m_lcdKeyString

QString LCD::m_lcdKeyString
private

Definition at line 346 of file lcddevice.h.

Referenced by handleKeyPress(), init(), and LCD().

◆ m_lcdLedMask

int LCD::m_lcdLedMask {0}
private

◆ m_getLEDMask

int(* LCD::m_getLEDMask) (void)
inlineprivate

Definition at line 350 of file lcddevice.h.

Referenced by outputLEDs(), and setupLEDs().


The documentation for this class was generated from the following files: