MythTV  master
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PlaybackSock Class Reference

#include <mythbackend/playbacksock.h>

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

Public Member Functions

 PlaybackSock (MythSocket *lsock, QString lhostname, PlaybackSockEventsMode eventsMode)
 
void SetDisconnected (void)
 
bool IsDisconnected (void) const
 
MythSocketgetSocket (void) const
 
QString getHostname (void) const
 
bool isLocal (void) const
 
bool wantsEvents (void) const
 
bool wantsNonSystemEvents (void) const
 
bool wantsSystemEvents (void) const
 
bool wantsOnlySystemEvents (void) const
 
PlaybackSockEventsMode eventsMode (void) const
 
bool getBlockShutdown (void) const
 
void setBlockShutdown (bool value)
 
bool IsFrontend (void) const
 
void SetAsFrontend (void)
 
bool isSlaveBackend (void) const
 
void setAsSlaveBackend (void)
 
bool isMediaServer (void) const
 
void setAsMediaServer (void)
 
void setIP (const QString &lip)
 
QString getIP (void) const
 
bool GoToSleep (void)
 Tells a slave to go to sleep. More...
 
void GetDiskSpace (QStringList &o_strlist)
 Appends host's dir's total and used space in kilobytes. More...
 
int DeleteFile (const QString &filename, const QString &sgroup)
 
int StopRecording (const ProgramInfo *pginfo)
 
int CheckRecordingActive (const ProgramInfo *pginfo)
 
int DeleteRecording (const ProgramInfo *pginfo, bool forceMetadataDelete=false)
 
bool FillProgramInfo (ProgramInfo &pginfo, const QString &playbackhost)
 
QStringList GetSGFileList (const QString &host, const QString &groupname, const QString &directory, bool fileNamesOnly)
 
QStringList GetSGFileQuery (const QString &host, const QString &groupname, const QString &filename)
 
QString GetFileHash (const QString &filename, const QString &storageGroup)
 
QStringList GetFindFile (const QString &host, const QString &filename, const QString &storageGroup, bool useRegex)
 
QStringList GenPreviewPixmap (const QString &token, const ProgramInfo *pginfo)
 
QStringList GenPreviewPixmap (const QString &token, const ProgramInfo *pginfo, std::chrono::seconds time, long long frame, const QString &outputFile, QSize outputSize)
 
QDateTime PixmapLastModified (const ProgramInfo *pginfo)
 
bool CheckFile (ProgramInfo *pginfo)
 
bool IsBusy (int capturecardnum, InputInfo *busy_input=nullptr, std::chrono::seconds time_buffer=5s)
 
int GetEncoderState (int capturecardnum)
 
long long GetMaxBitrate (int capturecardnum)
 
ProgramInfoGetRecording (uint cardid)
 Returns the ProgramInfo being used by any current recording. More...
 
bool EncoderIsRecording (int capturecardnum, const ProgramInfo *pginfo)
 
RecStatus::Type StartRecording (int capturecardnum, ProgramInfo *pginfo)
 
RecStatus::Type GetRecordingStatus (int capturecardnum)
 
void RecordPending (int capturecardnum, const ProgramInfo *pginfo, std::chrono::seconds secsleft, bool hasLater)
 
std::chrono::milliseconds SetSignalMonitoringRate (int capturecardnum, std::chrono::milliseconds rate, int notifyFrontend)
 
void SetNextLiveTVDir (int capturecardnum, const QString &dir)
 
void CancelNextRecording (int capturecardnum, bool cancel)
 
QStringList ForwardRequest (const QStringList &slist)
 
bool ReadStringList (QStringList &list)
 
bool AddChildInput (uint childid)
 Tells a slave to add a child input. More...
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Protected Member Functions

 ~PlaybackSock () override
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

Private Member Functions

bool SendReceiveStringList (QStringList &strlist, uint min_reply_length=0)
 

Private Attributes

MythSocketm_sock {nullptr}
 
QString m_hostname
 
QString m_ip
 
bool m_local {true}
 
PlaybackSockEventsMode m_eventsMode
 
bool m_blockshutdown {true}
 
bool m_backend {false}
 
bool m_mediaserver {false}
 
bool m_frontend {false}
 
QMutex m_sockLock
 
bool m_disconnected {false}
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Detailed Description

Definition at line 27 of file playbacksock.h.

Constructor & Destructor Documentation

◆ PlaybackSock()

PlaybackSock::PlaybackSock ( MythSocket lsock,
QString  lhostname,
PlaybackSockEventsMode  eventsMode 
)

Definition at line 22 of file playbacksock.cpp.

◆ ~PlaybackSock()

PlaybackSock::~PlaybackSock ( )
overrideprotected

Definition at line 35 of file playbacksock.cpp.

Member Function Documentation

◆ SetDisconnected()

void PlaybackSock::SetDisconnected ( void  )
inline

Definition at line 33 of file playbacksock.h.

◆ IsDisconnected()

bool PlaybackSock::IsDisconnected ( void  ) const
inline

Definition at line 34 of file playbacksock.h.

◆ getSocket()

MythSocket* PlaybackSock::getSocket ( void  ) const
inline

Definition at line 36 of file playbacksock.h.

Referenced by RenameThread::run().

◆ getHostname()

QString PlaybackSock::getHostname ( void  ) const
inline

Definition at line 37 of file playbacksock.h.

◆ isLocal()

bool PlaybackSock::isLocal ( void  ) const
inline

Definition at line 39 of file playbacksock.h.

◆ wantsEvents()

bool PlaybackSock::wantsEvents ( void  ) const

Definition at line 41 of file playbacksock.cpp.

◆ wantsNonSystemEvents()

bool PlaybackSock::wantsNonSystemEvents ( void  ) const

Definition at line 46 of file playbacksock.cpp.

◆ wantsSystemEvents()

bool PlaybackSock::wantsSystemEvents ( void  ) const

Definition at line 52 of file playbacksock.cpp.

◆ wantsOnlySystemEvents()

bool PlaybackSock::wantsOnlySystemEvents ( void  ) const

Definition at line 58 of file playbacksock.cpp.

◆ eventsMode()

PlaybackSockEventsMode PlaybackSock::eventsMode ( void  ) const

Definition at line 63 of file playbacksock.cpp.

◆ getBlockShutdown()

bool PlaybackSock::getBlockShutdown ( void  ) const
inline

Definition at line 46 of file playbacksock.h.

◆ setBlockShutdown()

void PlaybackSock::setBlockShutdown ( bool  value)
inline

Definition at line 47 of file playbacksock.h.

◆ IsFrontend()

bool PlaybackSock::IsFrontend ( void  ) const
inline

Definition at line 49 of file playbacksock.h.

◆ SetAsFrontend()

void PlaybackSock::SetAsFrontend ( void  )
inline

Definition at line 50 of file playbacksock.h.

◆ isSlaveBackend()

bool PlaybackSock::isSlaveBackend ( void  ) const
inline

Definition at line 53 of file playbacksock.h.

◆ setAsSlaveBackend()

void PlaybackSock::setAsSlaveBackend ( void  )
inline

Definition at line 54 of file playbacksock.h.

◆ isMediaServer()

bool PlaybackSock::isMediaServer ( void  ) const
inline

Definition at line 56 of file playbacksock.h.

◆ setAsMediaServer()

void PlaybackSock::setAsMediaServer ( void  )
inline

Definition at line 57 of file playbacksock.h.

◆ setIP()

void PlaybackSock::setIP ( const QString &  lip)
inline

Definition at line 59 of file playbacksock.h.

Referenced by V2Status::GetBackendStatus().

◆ getIP()

QString PlaybackSock::getIP ( void  ) const
inline

Definition at line 60 of file playbacksock.h.

Referenced by V2Status::GetBackendStatus().

◆ GoToSleep()

bool PlaybackSock::GoToSleep ( void  )

Tells a slave to go to sleep.

Definition at line 132 of file playbacksock.cpp.

Referenced by EncoderLink::GoToSleep().

◆ GetDiskSpace()

void PlaybackSock::GetDiskSpace ( QStringList &  o_strlist)

Appends host's dir's total and used space in kilobytes.

Definition at line 142 of file playbacksock.cpp.

Referenced by EncoderLink::GetDiskSpace().

◆ DeleteFile()

int PlaybackSock::DeleteFile ( const QString &  filename,
const QString &  sgroup 
)

Definition at line 163 of file playbacksock.cpp.

◆ StopRecording()

int PlaybackSock::StopRecording ( const ProgramInfo pginfo)

Definition at line 175 of file playbacksock.cpp.

Referenced by MainServer::DoHandleStopRecording().

◆ CheckRecordingActive()

int PlaybackSock::CheckRecordingActive ( const ProgramInfo pginfo)

Definition at line 152 of file playbacksock.cpp.

Referenced by MainServer::HandleCheckRecordingActive().

◆ DeleteRecording()

int PlaybackSock::DeleteRecording ( const ProgramInfo pginfo,
bool  forceMetadataDelete = false 
)

Definition at line 186 of file playbacksock.cpp.

Referenced by MainServer::DoHandleDeleteRecording().

◆ FillProgramInfo()

bool PlaybackSock::FillProgramInfo ( ProgramInfo pginfo,
const QString &  playbackhost 
)

Definition at line 204 of file playbacksock.cpp.

Referenced by MainServer::HandleQueryRecordings().

◆ GetSGFileList()

QStringList PlaybackSock::GetSGFileList ( const QString &  host,
const QString &  groupname,
const QString &  directory,
bool  fileNamesOnly 
)

Definition at line 224 of file playbacksock.cpp.

Referenced by MainServer::HandleSGGetFileList().

◆ GetSGFileQuery()

QStringList PlaybackSock::GetSGFileQuery ( const QString &  host,
const QString &  groupname,
const QString &  filename 
)

Definition at line 238 of file playbacksock.cpp.

Referenced by MainServer::HandleSGFileQuery().

◆ GetFileHash()

QString PlaybackSock::GetFileHash ( const QString &  filename,
const QString &  storageGroup 
)

Definition at line 251 of file playbacksock.cpp.

Referenced by MainServer::HandleQueryFileHash().

◆ GetFindFile()

QStringList PlaybackSock::GetFindFile ( const QString &  host,
const QString &  filename,
const QString &  storageGroup,
bool  useRegex 
)

Definition at line 261 of file playbacksock.cpp.

Referenced by MainServer::HandleQueryFindFile().

◆ GenPreviewPixmap() [1/2]

QStringList PlaybackSock::GenPreviewPixmap ( const QString &  token,
const ProgramInfo pginfo 
)

Definition at line 275 of file playbacksock.cpp.

Referenced by MainServer::HandleGenPreviewPixmap().

◆ GenPreviewPixmap() [2/2]

QStringList PlaybackSock::GenPreviewPixmap ( const QString &  token,
const ProgramInfo pginfo,
std::chrono::seconds  time,
long long  frame,
const QString &  outputFile,
QSize  outputSize 
)

Definition at line 287 of file playbacksock.cpp.

◆ PixmapLastModified()

QDateTime PlaybackSock::PixmapLastModified ( const ProgramInfo pginfo)

Definition at line 316 of file playbacksock.cpp.

Referenced by MainServer::HandlePixmapLastModified().

◆ CheckFile()

bool PlaybackSock::CheckFile ( ProgramInfo pginfo)

Definition at line 331 of file playbacksock.cpp.

Referenced by EncoderLink::CheckFile(), and MainServer::HandleQueryCheckFile().

◆ IsBusy()

bool PlaybackSock::IsBusy ( int  capturecardnum,
InputInfo busy_input = nullptr,
std::chrono::seconds  time_buffer = 5s 
)

Definition at line 346 of file playbacksock.cpp.

Referenced by EncoderLink::IsBusy().

◆ GetEncoderState()

int PlaybackSock::GetEncoderState ( int  capturecardnum)

Returns the maximum bits per second the recorder can produce.

Parameters
capturecardnumRecorder ID in the database.

Definition at line 389 of file playbacksock.cpp.

Referenced by EncoderLink::GetFlags(), and EncoderLink::GetState().

◆ GetMaxBitrate()

long long PlaybackSock::GetMaxBitrate ( int  capturecardnum)

Definition at line 406 of file playbacksock.cpp.

Referenced by EncoderLink::GetMaxBitrate().

◆ GetRecording()

ProgramInfo * PlaybackSock::GetRecording ( uint  cardid)

Returns the ProgramInfo being used by any current recording.

Caller is responsible for deleting the ProgramInfo when done with it.

Definition at line 421 of file playbacksock.cpp.

Referenced by EncoderLink::GetRecording().

◆ EncoderIsRecording()

bool PlaybackSock::EncoderIsRecording ( int  capturecardnum,
const ProgramInfo pginfo 
)

Definition at line 439 of file playbacksock.cpp.

Referenced by EncoderLink::MatchesRecording().

◆ StartRecording()

RecStatus::Type PlaybackSock::StartRecording ( int  capturecardnum,
ProgramInfo pginfo 
)

Definition at line 452 of file playbacksock.cpp.

Referenced by EncoderLink::StartRecording().

◆ GetRecordingStatus()

RecStatus::Type PlaybackSock::GetRecordingStatus ( int  capturecardnum)

Definition at line 470 of file playbacksock.cpp.

Referenced by EncoderLink::GetRecordingStatus().

◆ RecordPending()

void PlaybackSock::RecordPending ( int  capturecardnum,
const ProgramInfo pginfo,
std::chrono::seconds  secsleft,
bool  hasLater 
)

Definition at line 487 of file playbacksock.cpp.

Referenced by EncoderLink::RecordPending().

◆ SetSignalMonitoringRate()

std::chrono::milliseconds PlaybackSock::SetSignalMonitoringRate ( int  capturecardnum,
std::chrono::milliseconds  rate,
int  notifyFrontend 
)

Definition at line 499 of file playbacksock.cpp.

Referenced by EncoderLink::SetSignalMonitoringRate().

◆ SetNextLiveTVDir()

void PlaybackSock::SetNextLiveTVDir ( int  capturecardnum,
const QString &  dir 
)

Definition at line 513 of file playbacksock.cpp.

Referenced by EncoderLink::SetNextLiveTVDir().

◆ CancelNextRecording()

void PlaybackSock::CancelNextRecording ( int  capturecardnum,
bool  cancel 
)

Definition at line 522 of file playbacksock.cpp.

Referenced by EncoderLink::CancelNextRecording().

◆ ForwardRequest()

QStringList PlaybackSock::ForwardRequest ( const QStringList &  slist)

◆ ReadStringList()

bool PlaybackSock::ReadStringList ( QStringList &  list)

Definition at line 68 of file playbacksock.cpp.

◆ AddChildInput()

bool PlaybackSock::AddChildInput ( uint  childid)

Tells a slave to add a child input.

Definition at line 545 of file playbacksock.cpp.

Referenced by EncoderLink::AddChildInput().

◆ SendReceiveStringList()

bool PlaybackSock::SendReceiveStringList ( QStringList &  strlist,
uint  min_reply_length = 0 
)
private

Member Data Documentation

◆ m_sock

MythSocket* PlaybackSock::m_sock {nullptr}
private

Definition at line 117 of file playbacksock.h.

Referenced by getSocket(), ReadStringList(), SendReceiveStringList(), and ~PlaybackSock().

◆ m_hostname

QString PlaybackSock::m_hostname
private

Definition at line 118 of file playbacksock.h.

Referenced by getHostname(), and PlaybackSock().

◆ m_ip

QString PlaybackSock::m_ip
private

Definition at line 119 of file playbacksock.h.

Referenced by getIP(), and setIP().

◆ m_local

bool PlaybackSock::m_local {true}
private

Definition at line 121 of file playbacksock.h.

Referenced by isLocal(), and PlaybackSock().

◆ m_eventsMode

PlaybackSockEventsMode PlaybackSock::m_eventsMode
private

◆ m_blockshutdown

bool PlaybackSock::m_blockshutdown {true}
private

Definition at line 123 of file playbacksock.h.

Referenced by getBlockShutdown(), and setBlockShutdown().

◆ m_backend

bool PlaybackSock::m_backend {false}
private

Definition at line 124 of file playbacksock.h.

Referenced by isSlaveBackend(), and setAsSlaveBackend().

◆ m_mediaserver

bool PlaybackSock::m_mediaserver {false}
private

Definition at line 125 of file playbacksock.h.

Referenced by isMediaServer(), setAsMediaServer(), and setAsSlaveBackend().

◆ m_frontend

bool PlaybackSock::m_frontend {false}
private

Definition at line 126 of file playbacksock.h.

Referenced by IsFrontend(), and SetAsFrontend().

◆ m_sockLock

QMutex PlaybackSock::m_sockLock
private

Definition at line 128 of file playbacksock.h.

Referenced by ReadStringList(), and SendReceiveStringList().

◆ m_disconnected

bool PlaybackSock::m_disconnected {false}
private

Definition at line 130 of file playbacksock.h.

Referenced by IsDisconnected(), and SetDisconnected().


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