CPPMyth
Library to interoperate with MythTV server
Loading...
Searching...
No Matches
Myth::LiveTVPlayback Class Reference
Inheritance diagram for Myth::LiveTVPlayback:
Collaboration diagram for Myth::LiveTVPlayback:

Public Member Functions

 LiveTVPlayback (EventHandler &handler)
 LiveTVPlayback (const std::string &server, unsigned port)
bool Open ()
void Close ()
bool IsOpen ()
void SetTuneDelay (unsigned delay)
void SetLimitTuneAttempts (bool limit)
bool SpawnLiveTV (const std::string &chanNum, const ChannelList &channels)
bool SpawnLiveTV (const ChannelPtr &thisChannel)
void StopLiveTV ()
void SetChunk (unsigned size)
int64_t GetSize () const
int Read (void *buffer, unsigned n)
int64_t Seek (int64_t offset, WHENCE_t whence)
int64_t GetPosition () const
bool IsPlaying () const
bool IsLiveRecording () const
bool KeepLiveRecording (bool keep)
ProgramPtr GetPlayedProgram () const
time_t GetLiveTimeStart () const
unsigned GetChainedCount () const
ProgramPtr GetChainedProgram (unsigned sequence) const
uint32_t GetCardId () const
SignalStatusPtr GetSignal () const
void HandleBackendMessage (EventMessagePtr msg)

Private Types

typedef std::vector< std::pair< ProtoTransferPtr, ProgramPtr > > chained_t
typedef std::multimap< unsigned, std::pair< CardInputPtr, ChannelPtr > > preferredCards_t
Private Types inherited from Myth::ProtoBase
enum  ERROR_t { ERROR_NO_ERROR = 0 , ERROR_SERVER_UNREACHABLE , ERROR_SOCKET_ERROR , ERROR_UNKNOWN_VERSION }

Private Member Functions

void InitChain ()
void ClearChain ()
bool IsChained (const Program &program)
void HandleChainUpdate ()
bool SwitchChain (unsigned sequence)
bool SwitchChainLast ()
preferredCards_t FindTunableCardIds (const std::string &chanNum, const ChannelList &channels)
int _read (void *buffer, unsigned n)
int64_t _seek (int64_t offset, WHENCE_t whence)
Private Member Functions inherited from Myth::ProtoMonitor
 ProtoMonitor (const std::string &server, unsigned port)
 ProtoMonitor (const std::string &server, unsigned port, bool frontend)
ProtoRecorderPtr GetRecorderFromNum (int rnum)
bool QueryFreeSpaceSummary (int64_t *total, int64_t *used)
std::string GetSetting (const std::string &hostname, const std::string &setting)
bool SetSetting (const std::string &hostname, const std::string &setting, const std::string &value)
bool QueryGenpixmap (const Program &program)
bool DeleteRecording (const Program &program, bool force=false, bool forget=false)
bool UndeleteRecording (const Program &program)
bool StopRecording (const Program &program)
bool CancelNextRecording (int rnum, bool cancel)
StorageGroupFilePtr QuerySGFile (const std::string &hostname, const std::string &sgname, const std::string &filename)
MarkListPtr GetCutList (const Program &program)
MarkListPtr GetCommBreakList (const Program &program)
bool BlockShutdown ()
bool AllowShutdown ()
CardInputListPtr GetFreeInputs (int rnum=0)
 Asks the backend for a list of free inputs. A free input is one that is connected but not busy, not in a busy input group or is locked.
Private Member Functions inherited from Myth::ProtoBase
 ProtoBase (const std::string &server, unsigned port)
virtual unsigned GetProtoVersion () const
virtual std::string GetServer () const
virtual unsigned GetPort () const
virtual int GetSocketErrNo () const
virtual int GetSocket () const
virtual bool HasHanging () const
virtual void CleanHanging ()
virtual ERROR_t GetProtoError () const
bool OpenConnection (int rcvbuf)
void HangException ()
bool SendCommand (const char *cmd, bool feedback=true)
size_t GetMessageLength () const
bool ReadField (std::string &field)
bool IsMessageOK (const std::string &field) const
size_t FlushMessage ()
bool RcvMessageLength ()
ProgramPtr RcvProgramInfo ()
void MakeProgramInfo (const Program &program, std::string &msg)

Private Attributes

EventHandler m_eventHandler
unsigned m_eventSubscriberId
unsigned m_tuneDelay
bool m_limitTuneAttempts
ProtoRecorderPtr m_recorder
SignalStatusPtr m_signal
struct { 
   std::string   UID 
   chained_t   chained 
   ProtoTransferPtr   currentTransfer 
   unsigned   currentSequence 
   unsigned   lastSequence 
   volatile bool   watch 
   volatile bool   switchOnCreate 
m_chain
unsigned m_chunk
struct { 
   RingBuffer *   rbuf 
   RingBufferPacket *   packet 
   int   consumed 
m_buffer
Private Attributes inherited from Myth::ProtoBase
OS::Latch * m_latch
TcpSocket * m_socket
unsigned m_protoVersion
std::string m_server
unsigned m_port
bool m_hang
 Connection hang: while true allow retry.
bool m_tainted
 Connection has hung since last reset.
size_t m_msgLength
size_t m_msgConsumed

Detailed Description

Definition at line 44 of file mythlivetvplayback.h.

Member Typedef Documentation

◆ chained_t

typedef std::vector<std::pair<ProtoTransferPtr, ProgramPtr> > Myth::LiveTVPlayback::chained_t
private

Definition at line 90 of file mythlivetvplayback.h.

◆ preferredCards_t

typedef std::multimap<unsigned, std::pair<CardInputPtr, ChannelPtr> > Myth::LiveTVPlayback::preferredCards_t
private

Definition at line 108 of file mythlivetvplayback.h.

Constructor & Destructor Documentation

◆ LiveTVPlayback() [1/2]

LiveTVPlayback::LiveTVPlayback ( EventHandler & handler)

Definition at line 49 of file mythlivetvplayback.cpp.

◆ LiveTVPlayback() [2/2]

LiveTVPlayback::LiveTVPlayback ( const std::string & server,
unsigned port )

Definition at line 73 of file mythlivetvplayback.cpp.

◆ ~LiveTVPlayback()

LiveTVPlayback::~LiveTVPlayback ( )

Definition at line 97 of file mythlivetvplayback.cpp.

Member Function Documentation

◆ _read()

int LiveTVPlayback::_read ( void * buffer,
unsigned n )
private

Definition at line 553 of file mythlivetvplayback.cpp.

◆ _seek()

int64_t LiveTVPlayback::_seek ( int64_t offset,
WHENCE_t whence )
private

Definition at line 652 of file mythlivetvplayback.cpp.

◆ ClearChain()

void LiveTVPlayback::ClearChain ( )
private

Definition at line 252 of file mythlivetvplayback.cpp.

◆ Close()

void LiveTVPlayback::Close ( )
virtual

Reimplemented from Myth::ProtoMonitor.

Definition at line 134 of file mythlivetvplayback.cpp.

◆ FindTunableCardIds()

LiveTVPlayback::preferredCards_t LiveTVPlayback::FindTunableCardIds ( const std::string & chanNum,
const ChannelList & channels )
private

Definition at line 825 of file mythlivetvplayback.cpp.

◆ GetCardId()

uint32_t LiveTVPlayback::GetCardId ( ) const

Definition at line 813 of file mythlivetvplayback.cpp.

◆ GetChainedCount()

unsigned LiveTVPlayback::GetChainedCount ( ) const

Definition at line 799 of file mythlivetvplayback.cpp.

◆ GetChainedProgram()

ProgramPtr LiveTVPlayback::GetChainedProgram ( unsigned sequence) const

Definition at line 805 of file mythlivetvplayback.cpp.

◆ GetLiveTimeStart()

time_t LiveTVPlayback::GetLiveTimeStart ( ) const

Definition at line 791 of file mythlivetvplayback.cpp.

◆ GetPlayedProgram()

ProgramPtr LiveTVPlayback::GetPlayedProgram ( ) const

Definition at line 783 of file mythlivetvplayback.cpp.

◆ GetPosition()

int64_t LiveTVPlayback::GetPosition ( ) const
virtual

Implements Myth::Stream.

Definition at line 728 of file mythlivetvplayback.cpp.

◆ GetSignal()

SignalStatusPtr LiveTVPlayback::GetSignal ( ) const

Definition at line 819 of file mythlivetvplayback.cpp.

◆ GetSize()

int64_t LiveTVPlayback::GetSize ( ) const
virtual

Implements Myth::Stream.

Definition at line 503 of file mythlivetvplayback.cpp.

◆ HandleBackendMessage()

void LiveTVPlayback::HandleBackendMessage ( EventMessagePtr msg)
virtual

Implements Myth::EventSubscriber.

Definition at line 339 of file mythlivetvplayback.cpp.

◆ HandleChainUpdate()

void LiveTVPlayback::HandleChainUpdate ( )
private

Definition at line 275 of file mythlivetvplayback.cpp.

◆ InitChain()

void LiveTVPlayback::InitChain ( )
private

Definition at line 236 of file mythlivetvplayback.cpp.

◆ IsChained()

bool LiveTVPlayback::IsChained ( const Program & program)
private

Definition at line 264 of file mythlivetvplayback.cpp.

◆ IsLiveRecording()

bool LiveTVPlayback::IsLiveRecording ( ) const

Definition at line 750 of file mythlivetvplayback.cpp.

◆ IsOpen()

bool Myth::LiveTVPlayback::IsOpen ( )
inlinevirtual

Reimplemented from Myth::ProtoMonitor.

Definition at line 53 of file mythlivetvplayback.h.

◆ IsPlaying()

bool LiveTVPlayback::IsPlaying ( ) const

Definition at line 744 of file mythlivetvplayback.cpp.

◆ KeepLiveRecording()

bool LiveTVPlayback::KeepLiveRecording ( bool keep)

Definition at line 756 of file mythlivetvplayback.cpp.

◆ Open()

bool LiveTVPlayback::Open ( )
virtual

Reimplemented from Myth::ProtoMonitor.

Definition at line 107 of file mythlivetvplayback.cpp.

◆ Read()

int LiveTVPlayback::Read ( void * buffer,
unsigned n )
virtual

Implements Myth::Stream.

Definition at line 512 of file mythlivetvplayback.cpp.

◆ Seek()

int64_t LiveTVPlayback::Seek ( int64_t offset,
WHENCE_t whence )
virtual

Implements Myth::Stream.

Definition at line 626 of file mythlivetvplayback.cpp.

◆ SetChunk()

void LiveTVPlayback::SetChunk ( unsigned size)

Definition at line 494 of file mythlivetvplayback.cpp.

◆ SetLimitTuneAttempts()

void LiveTVPlayback::SetLimitTuneAttempts ( bool limit)

Definition at line 152 of file mythlivetvplayback.cpp.

◆ SetTuneDelay()

void LiveTVPlayback::SetTuneDelay ( unsigned delay)

Definition at line 142 of file mythlivetvplayback.cpp.

◆ SpawnLiveTV() [1/2]

bool LiveTVPlayback::SpawnLiveTV ( const ChannelPtr & thisChannel)

Definition at line 215 of file mythlivetvplayback.cpp.

◆ SpawnLiveTV() [2/2]

bool LiveTVPlayback::SpawnLiveTV ( const std::string & chanNum,
const ChannelList & channels )

Definition at line 159 of file mythlivetvplayback.cpp.

◆ StopLiveTV()

void LiveTVPlayback::StopLiveTV ( )

Definition at line 222 of file mythlivetvplayback.cpp.

◆ SwitchChain()

bool LiveTVPlayback::SwitchChain ( unsigned sequence)
private

Definition at line 311 of file mythlivetvplayback.cpp.

◆ SwitchChainLast()

bool LiveTVPlayback::SwitchChainLast ( )
private

Definition at line 327 of file mythlivetvplayback.cpp.

Field Documentation

◆ chained

chained_t Myth::LiveTVPlayback::chained

Definition at line 93 of file mythlivetvplayback.h.

◆ consumed

int Myth::LiveTVPlayback::consumed

Definition at line 115 of file mythlivetvplayback.h.

◆ currentSequence

unsigned Myth::LiveTVPlayback::currentSequence

Definition at line 95 of file mythlivetvplayback.h.

◆ currentTransfer

ProtoTransferPtr Myth::LiveTVPlayback::currentTransfer

Definition at line 94 of file mythlivetvplayback.h.

◆ lastSequence

unsigned Myth::LiveTVPlayback::lastSequence

Definition at line 96 of file mythlivetvplayback.h.

◆ m_chunk

unsigned Myth::LiveTVPlayback::m_chunk
private

Definition at line 114 of file mythlivetvplayback.h.

◆ m_eventHandler

EventHandler Myth::LiveTVPlayback::m_eventHandler
private

Definition at line 82 of file mythlivetvplayback.h.

◆ m_eventSubscriberId

unsigned Myth::LiveTVPlayback::m_eventSubscriberId
private

Definition at line 83 of file mythlivetvplayback.h.

◆ m_limitTuneAttempts

bool Myth::LiveTVPlayback::m_limitTuneAttempts
private

Definition at line 86 of file mythlivetvplayback.h.

◆ m_recorder

ProtoRecorderPtr Myth::LiveTVPlayback::m_recorder
private

Definition at line 87 of file mythlivetvplayback.h.

◆ m_signal

SignalStatusPtr Myth::LiveTVPlayback::m_signal
private

Definition at line 88 of file mythlivetvplayback.h.

◆ m_tuneDelay

unsigned Myth::LiveTVPlayback::m_tuneDelay
private

Definition at line 85 of file mythlivetvplayback.h.

◆ packet

RingBufferPacket* Myth::LiveTVPlayback::packet

Definition at line 115 of file mythlivetvplayback.h.

◆ rbuf

RingBuffer* Myth::LiveTVPlayback::rbuf

Definition at line 115 of file mythlivetvplayback.h.

◆ switchOnCreate

volatile bool Myth::LiveTVPlayback::switchOnCreate

Definition at line 98 of file mythlivetvplayback.h.

◆ UID

std::string Myth::LiveTVPlayback::UID

Definition at line 92 of file mythlivetvplayback.h.

◆ watch

volatile bool Myth::LiveTVPlayback::watch

Definition at line 97 of file mythlivetvplayback.h.


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