MythTV  0.25-pre
Public Member Functions | Private Member Functions | Private Attributes
RemoteEncoder Class Reference

#include <remoteencoder.h>

List of all members.

Public Member Functions

 RemoteEncoder (int num, const QString &host, short port)
 ~RemoteEncoder (void)
bool Setup (void)
bool IsValidRecorder (void) const
int GetRecorderNumber (void) const
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

Detailed Description

Definition at line 19 of file remoteencoder.h.


Constructor & Destructor Documentation

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

Definition at line 19 of file remoteencoder.cpp.

Definition at line 26 of file remoteencoder.cpp.


Member Function Documentation

Definition at line 32 of file remoteencoder.cpp.

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

Definition at line 66 of file remoteencoder.cpp.

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

Definition at line 141 of file remoteencoder.cpp.

Definition at line 121 of file remoteencoder.cpp.

Referenced by TV::StartRecorder().

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 163 of file remoteencoder.cpp.

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 198 of file remoteencoder.cpp.

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

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().

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 219 of file remoteencoder.cpp.

Returns the maximum bits per second this recorder can produce.

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

Definition at line 234 of file remoteencoder.cpp.

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 252 of file remoteencoder.cpp.

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

Definition at line 264 of file remoteencoder.cpp.

Referenced by MythPlayer::PosMapFromEnc().

Tells TVRec to stop streaming a recording to the frontend.

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

Definition at line 312 of file remoteencoder.cpp.

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

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 341 of file remoteencoder.cpp.

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

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 354 of file remoteencoder.cpp.

Referenced by TV::PauseLiveTV().

Definition at line 363 of file remoteencoder.cpp.

Referenced by TV::FinishRecording().

Definition at line 300 of file remoteencoder.cpp.

Referenced by TV::HandleStateChange().

Definition at line 291 of file remoteencoder.cpp.

Referenced by TV::HandleOSDAskAllow().

Definition at line 371 of file remoteencoder.cpp.

Referenced by TV::ToggleRecord().

QString RemoteEncoder::SetInput ( QString  input)

Definition at line 397 of file remoteencoder.cpp.

Referenced by TV::ToggleInputs().

Definition at line 512 of file remoteencoder.cpp.

Referenced by TV::DoTogglePictureAttribute().

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 540 of file remoteencoder.cpp.

Referenced by TV::DoChangePictureAttribute().

void RemoteEncoder::ChangeChannel ( int  channeldirection)

Definition at line 422 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

Definition at line 565 of file remoteencoder.cpp.

void RemoteEncoder::ToggleChannelFavorite ( QString  changroupname)

Definition at line 413 of file remoteencoder.cpp.

Referenced by TV::ToggleChannelFavorite().

void RemoteEncoder::SetChannel ( QString  channel)

Definition at line 435 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:
rateThe update rate to use in milliseconds, use 0 to disable.
notifyFrontendIf true, SIGNAL messages will be sent to the frontend using this recorder.
Returns:
Previous update rate

Definition at line 464 of file remoteencoder.cpp.

Referenced by TV::ActiveHandleAction().

bool RemoteEncoder::CheckChannel ( QString  channel)

Checks if named channel exists on current tuner.

Parameters:
channelChannel 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 583 of file remoteencoder.cpp.

Referenced by TV::ChangeChannel().

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

This only works on local recorders.

Parameters:
channelidchannel 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 604 of file remoteencoder.cpp.

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

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 625 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 665 of file remoteencoder.cpp.

Referenced by TVBrowseHelper::GetNextProgram().

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

Definition at line 716 of file remoteencoder.cpp.

Referenced by TV::HandleOSDChannelEdit().

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends