RemoteEncoder Class Reference

#include <remoteencoder.h>

List of all members.


Detailed Description

Definition at line 19 of file remoteencoder.h.


Public Member Functions

 RemoteEncoder (int num, const QString &host, short port)
 ~RemoteEncoder (void)
bool Setup (void)
bool IsValidRecorder (void)
int GetRecorderNumber (void)
ProgramInfoGetRecording (void)
bool IsRecording (bool *ok=NULL)
float GetFrameRate (void)
 Returns recordering frame rate set by nvr.
long long GetFramesWritten (void)
 Returns number of frames written to disk by TVRec's RecorderBase instance.
long long GetCachedFramesWritten (void) const
 Return value last returned by GetFramesWritten().
long long GetFilePosition (void)
 Returns total number of bytes written by TVRec's RingBuffer.
long long GetFreeDiskSpace ()
long long GetMaxBitrate ()
 Returns the maximum bits per second this recorder can produce.
int64_t GetKeyframePosition (uint64_t desired)
 Returns byte position in RingBuffer of a keyframe.
void FillPositionMap (long long start, long long end, QMap< long long, long long > &positionMap)
void StopPlaying (void)
 Tells TVRec to stop streaming a recording to the frontend.
void SpawnLiveTV (QString chainid, bool pip, QString startchan)
 Tells TVRec to Spawn a "Live TV" recorder.
void StopLiveTV (void)
 Tells TVRec to stop a "Live TV" recorder.
void PauseRecorder (void)
 Tells TVRec to pause a recorder, used for channel and input changes.
void FinishRecording (void)
void FrontendReady (void)
void CancelNextRecording (bool cancel)
void SetLiveRecording (bool recording)
QString GetInput (void)
QString SetInput (QString)
int GetPictureAttribute (PictureAttribute attr)
int ChangePictureAttribute (PictureAdjustType type, PictureAttribute attr, bool up)
 Changes brightness/contrast/colour/hue of a recording.
void ChangeChannel (int channeldirection)
void ChangeDeinterlacer (int deint_mode)
void ToggleChannelFavorite (QString)
void SetChannel (QString channel)
int SetSignalMonitoringRate (int msec, bool notifyFrontend=true)
 Sets the signal monitoring rate.
uint GetSignalLockTimeout (QString input)
bool CheckChannel (QString channel)
 Checks if named channel exists on current tuner.
bool ShouldSwitchToAnotherCard (QString channelid)
 Checks if named channel exists on current tuner, or another tuner.
bool CheckChannelPrefix (const QString &, uint &, bool &, QString &)
 Checks a prefix against the channels in the DB.
void GetNextProgram (int direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channelname, QString &chanid, QString &seriesid, QString &programid)
 Returns information about the program that would be seen if we changed the channel using ChangeChannel(int) with "direction".
void GetChannelInfo (QHash< QString, QString > &infoMap, uint chanid=0)
bool SetChannelInfo (const QHash< QString, QString > &infoMap)
bool GetErrorStatus (void)

Private Member Functions

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

Private Attributes

int recordernum
MythSocketcontrolSock
QMutex lock
QString remotehost
short remoteport
QString lastchannel
QString lastinput
bool backendError
long long cachedFramesWritten
QMap< QString, uintcachedTimeout

Constructor & Destructor Documentation

RemoteEncoder::RemoteEncoder ( int  num,
const QString &  host,
short  port 
)

Definition at line 22 of file remoteencoder.cpp.

RemoteEncoder::~RemoteEncoder ( void   ) 

Definition at line 29 of file remoteencoder.cpp.


Member Function Documentation

bool RemoteEncoder::Setup ( void   ) 

bool RemoteEncoder::IsValidRecorder ( void   ) 

int RemoteEncoder::GetRecorderNumber ( void   ) 

Definition at line 70 of file remoteencoder.cpp.

Referenced by FlagCommercials(), PlayerContext::SetRecorder(), and TV::SwitchCards().

ProgramInfo * RemoteEncoder::GetRecording ( void   ) 

Definition at line 147 of file remoteencoder.cpp.

Referenced by TV::timerEvent().

bool RemoteEncoder::IsRecording ( bool ok = NULL  ) 

Definition at line 127 of file remoteencoder.cpp.

Referenced by TV::StartRecorder(), and TV::timerEvent().

float RemoteEncoder::GetFrameRate ( void   ) 

Returns recordering frame rate set by nvr.

See also:
TVRec::GetFramerate(void), EncoderLink::GetFramerate(void), RecorderBase::GetFrameRate(void)
Returns:
Frames per second if query succeeds -1 otherwise.

Definition at line 169 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange(), and TV::SwitchCards().

long long RemoteEncoder::GetFramesWritten ( void   ) 

Returns number of frames written to disk by TVRec's RecorderBase instance.

See also:
TVRec::GetFramesWritten(void), EncoderLink::GetFramesWritten(void)
Returns:
Number of frames if query succeeds, -1 otherwise.

Definition at line 204 of file remoteencoder.cpp.

Referenced by MythPlayer::CalcMaxFFTime(), MythPlayer::calcSliderPos(), MythPlayer::GetSecondsBehind(), MythPlayer::GetStatusbarPos(), and MythPlayer::IsNearEnd().

long long RemoteEncoder::GetCachedFramesWritten ( void   )  const [inline]

Return value last returned by GetFramesWritten().

Definition at line 34 of file remoteencoder.h.

Referenced by MythPlayer::IsNearEnd().

long long RemoteEncoder::GetFilePosition ( void   ) 

Returns total number of bytes written by TVRec's RingBuffer.

See also:
TVRec::GetFilePosition(void), EncoderLink::GetFilePosition(void)
Returns:
Bytes written if query succeeds, -1 otherwise.

Definition at line 233 of file remoteencoder.cpp.

long long RemoteEncoder::GetFreeDiskSpace (  ) 

long long RemoteEncoder::GetMaxBitrate ( void   ) 

Returns the maximum bits per second this recorder can produce.

See also:
TVRec::GetMaxBitrate(void), EncoderLink::GetMaxBitrate(void)

Definition at line 248 of file remoteencoder.cpp.

int64_t RemoteEncoder::GetKeyframePosition ( uint64_t  desired  ) 

Returns byte position in RingBuffer of a keyframe.

See also:
TVRec::GetKeyframePosition(uint64_t), EncoderLink::GetKeyframePosition(uint64_t)
Returns:
Byte position of keyframe if query succeeds, -1 otherwise.

Definition at line 266 of file remoteencoder.cpp.

void RemoteEncoder::FillPositionMap ( long long  start,
long long  end,
QMap< long long, long long > &  positionMap 
)

Definition at line 278 of file remoteencoder.cpp.

Referenced by MythPlayer::PosMapFromEnc().

void RemoteEncoder::StopPlaying ( void   ) 

Tells TVRec to stop streaming a recording to the frontend.

See also:
TVRec::StopPlaying(void), EncoderLink::StopPlaying(void)

Definition at line 326 of file remoteencoder.cpp.

void RemoteEncoder::SpawnLiveTV ( QString  chainid,
bool  pip,
QString  startchan 
)

void RemoteEncoder::StopLiveTV ( void   ) 

Tells TVRec to stop a "Live TV" recorder.

This only works on local recorders.

See also:
TVRec::StopLiveTV(void), EncoderLink::StopLiveTV(void)

Definition at line 355 of file remoteencoder.cpp.

Referenced by TV::StopStuff(), and TV::SwitchCards().

void RemoteEncoder::PauseRecorder ( void   ) 

Tells TVRec to pause a recorder, used for channel and input changes.

See also:
TVRec::PauseRecorder(void), EncoderLink::PauseRecorder(void), RecorderBase::Pause(void)

Definition at line 368 of file remoteencoder.cpp.

Referenced by TV::PauseLiveTV().

void RemoteEncoder::FinishRecording ( void   ) 

Definition at line 377 of file remoteencoder.cpp.

Referenced by TV::FinishRecording().

void RemoteEncoder::FrontendReady ( void   ) 

Definition at line 314 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange().

void RemoteEncoder::CancelNextRecording ( bool  cancel  ) 

Definition at line 305 of file remoteencoder.cpp.

Referenced by TV::HandleOSDAskAllow().

void RemoteEncoder::SetLiveRecording ( bool  recording  ) 

Definition at line 385 of file remoteencoder.cpp.

Referenced by TV::ToggleRecord().

QString RemoteEncoder::GetInput ( void   ) 

QString RemoteEncoder::SetInput ( QString  input  ) 

Definition at line 411 of file remoteencoder.cpp.

Referenced by TV::ToggleInputs().

int RemoteEncoder::GetPictureAttribute ( PictureAttribute  attr  ) 

Definition at line 526 of file remoteencoder.cpp.

Referenced by TV::DoTogglePictureAttribute().

int RemoteEncoder::ChangePictureAttribute ( PictureAdjustType  type,
PictureAttribute  attr,
bool  up 
)

Changes brightness/contrast/colour/hue of a recording.

Note: In practice this only works with frame grabbing recorders.

Returns:
contrast if it succeeds, -1 otherwise.

Definition at line 554 of file remoteencoder.cpp.

Referenced by TV::DoChangePictureAttribute().

void RemoteEncoder::ChangeChannel ( int  channeldirection  ) 

Definition at line 436 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

void RemoteEncoder::ChangeDeinterlacer ( int  deint_mode  ) 

Definition at line 579 of file remoteencoder.cpp.

void RemoteEncoder::ToggleChannelFavorite ( QString  changroupname  ) 

Definition at line 427 of file remoteencoder.cpp.

Referenced by TV::ToggleChannelFavorite().

void RemoteEncoder::SetChannel ( QString  channel  ) 

Definition at line 449 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

int RemoteEncoder::SetSignalMonitoringRate ( int  msec,
bool  notifyFrontend = true 
)

Sets the signal monitoring rate.

This will actually call SetupSignalMonitor() and TeardownSignalMonitor(bool) as needed, so it can be used directly, without worrying about the SignalMonitor instance.

See also:
TVRec::SetSignalMonitoringRate(int,int), EncoderLink::SetSignalMonitoringRate(int,bool)
Parameters:
rate The update rate to use in milliseconds, use 0 to disable.
notifyFrontend If true, SIGNAL messages will be sent to the frontend using this recorder.
Returns:
Previous update rate

Definition at line 478 of file remoteencoder.cpp.

Referenced by TV::ActiveHandleAction().

uint RemoteEncoder::GetSignalLockTimeout ( QString  input  ) 

bool RemoteEncoder::CheckChannel ( QString  channel  ) 

Checks if named channel exists on current tuner.

Parameters:
channel Channel to verify against current tuner.
Returns:
true if it succeeds, false otherwise.
See also:
TVRec::CheckChannel(QString), EncoderLink::CheckChannel(const QString&), ShouldSwitchToAnotherCard(QString)

Definition at line 597 of file remoteencoder.cpp.

Referenced by TV::BrowseChannel(), and TV::ChangeChannel().

bool RemoteEncoder::ShouldSwitchToAnotherCard ( QString  channelid  ) 

Checks if named channel exists on current tuner, or another tuner.

This only works on local recorders.

Parameters:
channelid channel to verify against tuners.
Returns:
true if the channel on another tuner and not current tuner, false otherwise.
See also:
CheckChannel(const QString&)

Definition at line 618 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

bool RemoteEncoder::CheckChannelPrefix ( const QString &  prefix,
uint is_complete_valid_channel_on_rec,
bool is_extra_char_useful,
QString &  needed_spacer 
)

Checks a prefix against the channels in the DB.

See also:
TVRec::CheckChannelPrefix(const QString&,uint&,bool&,QString&) for details.

Definition at line 639 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel(), and TV::ProcessSmartChannel().

void RemoteEncoder::GetNextProgram ( int  direction,
QString &  title,
QString &  subtitle,
QString &  desc,
QString &  category,
QString &  starttime,
QString &  endtime,
QString &  callsign,
QString &  iconpath,
QString &  channelname,
QString &  chanid,
QString &  seriesid,
QString &  programid 
)

Returns information about the program that would be seen if we changed the channel using ChangeChannel(int) with "direction".

See also:
TVRec::GetNextProgram(int,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&), EncoderLink::GetNextProgram(int,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&)

Definition at line 679 of file remoteencoder.cpp.

Referenced by TV::GetNextProgram().

void RemoteEncoder::GetChannelInfo ( QHash< QString, QString > &  infoMap,
uint  chanid = 0 
)

bool RemoteEncoder::SetChannelInfo ( const QHash< QString, QString > &  infoMap  ) 

Definition at line 730 of file remoteencoder.cpp.

Referenced by TV::HandleOSDChannelEdit().

bool RemoteEncoder::GetErrorStatus ( void   )  [inline]

Definition at line 72 of file remoteencoder.h.

Referenced by PlayerContext::IsRecorderErrored().

bool RemoteEncoder::SendReceiveStringList ( QStringList &  strlist,
uint  min_reply_length = 0 
) [private]


Member Data Documentation

Definition at line 80 of file remoteencoder.h.

Referenced by SendReceiveStringList(), Setup(), and ~RemoteEncoder().

QMutex RemoteEncoder::lock [private]

Definition at line 81 of file remoteencoder.h.

Referenced by GetSignalLockTimeout(), and SendReceiveStringList().

QString RemoteEncoder::remotehost [private]

Definition at line 83 of file remoteencoder.h.

Referenced by Setup().

short RemoteEncoder::remoteport [private]

Definition at line 84 of file remoteencoder.h.

Referenced by Setup().

QString RemoteEncoder::lastchannel [private]

Definition at line 86 of file remoteencoder.h.

Referenced by ChangeChannel(), SetChannel(), and SetInput().

QString RemoteEncoder::lastinput [private]

Definition at line 87 of file remoteencoder.h.

Referenced by ChangeChannel(), GetInput(), PauseRecorder(), SetChannel(), and SetInput().

Definition at line 89 of file remoteencoder.h.

Referenced by SendReceiveStringList().

Definition at line 90 of file remoteencoder.h.

Referenced by GetFramesWritten().

QMap<QString,uint> RemoteEncoder::cachedTimeout [private]

Definition at line 91 of file remoteencoder.h.

Referenced by GetSignalLockTimeout().


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

Generated on Mon Sep 6 06:39:50 2010 for MythTV by  doxygen 1.5.5