MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
TVRec Class Reference

This is the coordinating class of the Recorder Subsystem. More...

#include <tv_rec.h>

Inheritance diagram for TVRec:
Inheritance graph
[legend]
Collaboration diagram for TVRec:
Collaboration graph
[legend]

Public Member Functions

 TVRec (int capturecardnum)
 Performs instance initialiation not requiring access to database.
 ~TVRec (void)
 Stops the event and scanning threads and deletes any ChannelBase, RingBuffer, and RecorderBase instances.
bool Init (void)
 Performs instance initialization, returns true on success.
void RecordPending (const ProgramInfo *rcinfo, int secsleft, bool hasLater)
 Tells TVRec "rcinfo" is the next pending recording.
RecStatusType StartRecording (const ProgramInfo *rcinfo)
 Tells TVRec to Start recording the program "rcinfo" as soon as possible.
RecStatusType GetRecordingStatus (void) const
void StopRecording (bool killFile=false)
 Changes from a recording state to kState_None.
void FinishRecording (void)
 Tells TVRec to finish the current recording as soon as possible.
void FrontendReady (void)
 Tells TVRec that the frontend's TV class is ready for messages.
void CancelNextRecording (bool cancel)
 Tells TVRec to cancel the upcoming recording.
ProgramInfoGetRecording (void)
 Allocates and returns a ProgramInfo for the current recording.
bool IsRunning (void) const
 Returns true if event loop has not been told to shut down.
void Stop (void)
 Tells TVRec to stop event loop.
TVState GetState (void) const
 Returns the TVState of the recorder.
bool IsPlaying (void)
 Returns "state == kState_RecordingPreRecorded".
bool IsRecording (void)
 Returns "state == kState_RecordingRecordedOnly".
bool SetVideoFiltersForChannel (uint sourceid, const QString &channum)
bool IsBusy (TunedInputInfo *busy_input=NULL, int time_buffer=5) const
 Returns true if the recorder is busy, or will be within the next time_buffer seconds.
bool IsReallyRecording (void)
 Returns true if frontend can consider the recorder started.
float GetFramerate (void)
 Returns recordering frame rate from the recorder.
long long GetFramesWritten (void)
 Returns number of frames written to disk by recorder.
long long GetFilePosition (void)
 Returns total number of bytes written by RingBuffer.
long long GetMaxBitrate (void) const
 Returns the maximum bits per second this recorder can produce.
int64_t GetKeyframePosition (uint64_t desired) const
 Returns byte position in RingBuffer of a keyframe according to recorder.
bool GetKeyframePositions (int64_t start, int64_t end, frm_pos_map_t &) const
 Returns byte position in RingBuffer of a keyframes according to recorder.
bool GetKeyframeDurations (int64_t start, int64_t end, frm_pos_map_t &) const
void SpawnLiveTV (LiveTVChain *newchain, bool pip, QString startchan)
 Tells TVRec to spawn a "Live TV" recorder.
QString GetChainID (void)
 Get the chainid of the livetv instance.
void StopLiveTV (void)
 Tells TVRec to stop a "Live TV" recorder.
void PauseRecorder (void)
 Tells "recorder" to pause, used for channel and input changes.
void ToggleChannelFavorite (QString)
 Toggles whether the current channel should be on our favorites list.
void SetLiveRecording (int recording)
 Tells the Scheduler about changes to the recording status of the LiveTV recording.
vector< InputInfoGetFreeInputs (const vector< uint > &excluded_cards) const
 Returns the recorder's available inputs.
QString GetInput (void) const
 Returns current input.
uint GetSourceID (void) const
 Returns current source id.
QString SetInput (QString input, uint requestType=kFlagDetect)
 Changes to the specified input.
void ChangeChannel (ChannelChangeDirection dir)
 Changes to a channel in the 'dir' channel change direction.
void SetChannel (QString name, uint requestType=kFlagDetect)
 Changes to a named channel on the current tuner.
bool QueueEITChannelChange (const QString &name)
 Queues up a channel change for the EITScanner.
int SetSignalMonitoringRate (int msec, int notifyFrontend=1)
 Sets the signal monitoring rate.
int GetPictureAttribute (PictureAttribute attr)
int ChangePictureAttribute (PictureAdjustType type, PictureAttribute attr, bool direction)
 Returns current value [0,100] if it succeeds, -1 otherwise.
bool CheckChannel (QString name) const
 Checks if named channel exists on current tuner.
bool ShouldSwitchToAnotherCard (QString chanid)
 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 (BrowseDirection direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channelname, uint &chanid, QString &seriesid, QString &programid)
bool GetChannelInfo (uint &chanid, uint &sourceid, QString &callsign, QString &channum, QString &channame, QString &xmltvid) const
bool SetChannelInfo (uint chanid, uint sourceid, QString oldchannum, QString callsign, QString channum, QString channame, QString xmltvid)
uint GetCaptureCardNum (void)
 Returns the caputure card number.
bool IsErrored (void) const
 Returns true is "errored" is true, false otherwise.
void RingBufferChanged (RingBuffer *, RecordingInfo *, RecordingQuality *)
void RecorderPaused (void)
 This is a callback, called by the "recorder" instance when it has actually paused.
void SetNextLiveTVDir (QString dir)
uint GetFlags (void) const
virtual void AllGood (void)
 Signal to be sent when you have a lock on all values.
virtual void StatusChannelTuned (const SignalMonitorValue &)
 Signal to be sent with change change status.
virtual void StatusSignalLock (const SignalMonitorValue &)
 Signal to be sent as true when it is safe to begin or continue recording, and false if it may not be safe.
virtual void StatusSignalStrength (const SignalMonitorValue &)
 Signal to be sent with an actual signal value.

Static Public Member Functions

static TVRecGetTVRec (uint cardid)

Static Public Attributes

static QMutex cardsLock
static QMap< uint, TVRec * > cards
static const uint kSignalMonitoringRate = 50
 How many milliseconds the signal monitor should wait between checks.
static const uint kFlagFrontendReady = 0x00000001
static const uint kFlagRunMainLoop = 0x00000002
static const uint kFlagExitPlayer = 0x00000004
static const uint kFlagFinishRecording = 0x00000008
static const uint kFlagErrored = 0x00000010
static const uint kFlagCancelNextRecording = 0x00000020
static const uint kFlagLiveTV = 0x00000100
 final result desired is LiveTV recording
static const uint kFlagRecording = 0x00000200
 final result desired is a timed recording
static const uint kFlagAntennaAdjust = 0x00000400
 antenna adjusting mode (LiveTV without recording).
static const uint kFlagRec = 0x00000F00
static const uint kFlagEITScan = 0x00001000
 final result desired is an EIT Scan
static const uint kFlagCloseRec = 0x00002000
 close recorder, keep recording
static const uint kFlagKillRec = 0x00004000
 close recorder, discard recording
static const uint kFlagNoRec = 0x0000F000
static const uint kFlagKillRingBuffer = 0x00010000
static const uint kFlagWaitingForRecPause = 0x00100000
static const uint kFlagWaitingForSignal = 0x00200000
static const uint kFlagNeedToStartRecorder = 0x00800000
static const uint kFlagPendingActions = 0x00F00000
static const uint kFlagSignalMonitorRunning = 0x01000000
static const uint kFlagEITScannerRunning = 0x04000000
static const uint kFlagDummyRecorderRunning = 0x10000000
static const uint kFlagRecorderRunning = 0x20000000
static const uint kFlagAnyRecRunning = 0x30000000
static const uint kFlagAnyRunning = 0x3F000000
static const uint kFlagRingBufferReady = 0x40000000
static const uint kFlagDetect = 0x80000000

Protected Member Functions

virtual void run (void)
 Event handling method, contains event loop.
bool WaitForEventThreadSleep (bool wake=true, ulong time=ULONG_MAX)
 You MUST HAVE the stateChange-lock locked when you call this method!
- Protected Member Functions inherited from SignalMonitorListener
virtual ~SignalMonitorListener ()

Private Types

enum  AutoRunInitType { kAutoRunProfile, kAutoRunNone }

Private Member Functions

void SetRingBuffer (RingBuffer *)
 Sets "ringBuffer", deleting any existing RingBuffer.
void SetPseudoLiveTVRecording (RecordingInfo *)
 Sets the pseudo LiveTV RecordingInfo.
void TeardownAll (void)
void WakeEventLoop (void)
void TeardownRecorder (uint request_flags)
 Tears down the recorder.
DTVRecorderGetDTVRecorder (void)
bool CreateChannel (const QString &startChanNum, bool enter_power_save_mode)
void CloseChannel (void)
DTVChannelGetDTVChannel (void)
V4LChannelGetV4LChannel (void)
bool SetupSignalMonitor (bool enable_table_monitoring, bool EITscan, bool notify)
 This creates a SignalMonitor instance and begins signal monitoring.
bool SetupDTVSignalMonitor (bool EITscan)
 Tells DTVSignalMonitor what channel to look for.
void TeardownSignalMonitor (void)
 If a SignalMonitor instance exists, the monitoring thread is stopped and the instance is deleted.
DTVSignalMonitorGetDTVSignalMonitor (void)
bool HasFlags (uint f) const
void SetFlags (uint f)
void ClearFlags (uint f)
void HandleTuning (void)
 Handles all tuning events.
void TuningShutdowns (const TuningRequest &)
 This shuts down anything that needs to be shut down before handling the passed in tuning request.
void TuningFrequency (const TuningRequest &)
 Performs initial tuning required for any tuning event.
MPEGStreamDataTuningSignalCheck (void)
 This checks if we have a channel lock.
void TuningNewRecorder (MPEGStreamData *)
 Creates a recorder instance.
void TuningRestartRecorder (void)
 Restarts a stopped recorder or unpauses a paused recorder.
QString TuningGetChanNum (const TuningRequest &, QString &input) const
uint TuningCheckForHWChange (const TuningRequest &, QString &channum, QString &inputname)
 Returns cardid for device info row in capturecard if it changes.
bool TuningOnSameMultiplex (TuningRequest &request)
void HandleStateChange (void)
 Changes the internalState to the desiredNextState if possible.
void ChangeState (TVState nextState)
 Puts a state change on the nextState queue.
bool StateIsRecording (TVState state)
 Returns true if "state" is kState_RecordingOnly, or kState_WatchingLiveTV.
bool StateIsPlaying (TVState state)
 Returns true if we are in any state associated with a player.
TVState RemovePlaying (TVState state)
 Returns TVState that would remove the playing, but potentially keep recording if we are watching an in progress recording.
TVState RemoveRecording (TVState state)
 If "state" is kState_RecordingOnly or kState_WatchingLiveTV, returns a kState_None, otherwise returns kState_Error.
void HandlePendingRecordings (void)
bool WaitForNextLiveTVDir (void)
bool GetProgramRingBufferForLiveTV (RecordingInfo **pginfo, RingBuffer **rb, const QString &channum, int inputID)
bool CreateLiveTVRingBuffer (const QString &channum)
bool SwitchLiveTVRingBuffer (const QString &channum, bool discont, bool set_rec)
RecordingInfoSwitchRecordingRingBuffer (const RecordingInfo &rcinfo)
void StartedRecording (RecordingInfo *)
 Inserts a "curRec" into the database.
void FinishedRecording (RecordingInfo *, RecordingQuality *)
 If not a premature stop, adds program to history of recorded programs.
QDateTime GetRecordEndTime (const ProgramInfo *) const
 Returns recording end time with proper post-roll.
void CheckForRecGroupChange (void)
 Check if frontend changed the recording group.
void NotifySchedulerOfRecording (RecordingInfo *)
 Tell scheduler about the recording.
void InitAutoRunJobs (RecordingInfo *, AutoRunInitType, RecordingProfile *, int line)
void SetRecordingStatus (RecStatusType new_status, int line, bool have_lock=false)

Static Private Member Functions

static bool GetDevices (uint cardid, GeneralDBOptions &general_opts, DVBDBOptions &dvb_opts, FireWireDBOptions &firewire_opts)
static QString GetStartChannel (uint cardid, const QString &startinput)
static QString FlagToString (uint)

Private Attributes

RecorderBaserecorder
ChannelBasechannel
SignalMonitorsignalMonitor
EITScannerscanner
MThreadeventThread
 Event processing thread, runs TVRec::run().
MThreadrecorderThread
 Recorder thread, runs RecorderBase::run().
bool transcodeFirst
bool earlyCommFlag
bool runJobOnHostOnly
int eitCrawlIdleStart
int eitTransportTimeout
int audioSampleRateDB
int overRecordSecNrml
int overRecordSecCat
QString overRecordCategory
InputGroupMap igrp
uint cardid
bool ispip
GeneralDBOptions genOpt
DVBDBOptions dvbOpt
FireWireDBOptions fwOpt
QMutex setChannelLock
QMutex stateChangeLock
QMutex pendingRecLock
TVState internalState
TVState desiredNextState
bool changeState
bool pauseNotify
uint stateFlags
TuningQueue tuningRequests
TuningRequest lastTuningRequest
QDateTime eitScanStartTime
QMutex triggerEventLoopLock
QWaitCondition triggerEventLoopWait
bool triggerEventLoopSignal
QMutex triggerEventSleepLock
QWaitCondition triggerEventSleepWait
bool triggerEventSleepSignal
volatile bool switchingBuffer
RecStatusType m_recStatus
RecordingInfocurRecording
QDateTime recordEndTime
QHash< QString, intautoRunJobs
int overrecordseconds
PendingMap pendingRecordings
RecordingInfopseudoLiveTVRecording
QString nextLiveTVDir
QMutex nextLiveTVDirLock
QWaitCondition triggerLiveTVDir
QString LiveTVStartChannel
LiveTVChaintvchain
RingBufferringBuffer
QString rbFileExt

Friends

class TuningRequest
class TVRecRecordThread

Detailed Description

This is the coordinating class of the Recorder Subsystem.

TVRec is used by EncoderLink, which in turn is used by RemoteEncoder which allows the TV class on the frontend to communicate with TVRec and is used by MainServer to implement portions of the MythTV Network Protocol on the backend.

TVRec contains an instance of RecorderBase, which actually handles the recording of a program. It also contains an instance of RingBuffer, which in this case is used to either stream an existing recording to the frontend, or to save a stream from the RecorderBase to disk. Finally, if there is a tuner on the hardware RecorderBase is implementing then TVRec contains a channel instance for that hardware, and possibly a SignalMonitor instance which monitors the signal quality on a tuners current input.

Definition at line 139 of file tv_rec.h.

Member Enumeration Documentation

enum TVRec::AutoRunInitType
private
Enumerator:
kAutoRunProfile 
kAutoRunNone 

Definition at line 318 of file tv_rec.h.

Constructor & Destructor Documentation

TVRec::TVRec ( int  capturecardnum)

Performs instance initialiation not requiring access to database.

See Also
Init()
Parameters
capturecardnumCapture card number

Definition at line 83 of file tv_rec.cpp.

TVRec::~TVRec ( void  )

Stops the event and scanning threads and deletes any ChannelBase, RingBuffer, and RecorderBase instances.

Definition at line 185 of file tv_rec.cpp.

Member Function Documentation

bool TVRec::Init ( void  )

Performs instance initialization, returns true on success.

Returns
Returns true on success, false on failure.

Definition at line 147 of file tv_rec.cpp.

Referenced by SetupSignalMonitor(), and setupTVs().

void TVRec::RecordPending ( const ProgramInfo rcinfo,
int  secsleft,
bool  hasLater 
)

Tells TVRec "rcinfo" is the next pending recording.

When there is a pending recording and the frontend is in "Live TV" mode the TVRec event loop will send a "ASK_RECORDING" message to it. Depending on what that query returns, the recording will be started or not started.

See Also
TV::AskAllowRecording(const QStringList&, int, bool)
Parameters
rcinfoProgramInfo on pending program.
secsleftSeconds left until pending recording begins. Set to -1 to revoke the current pending recording.
hasLaterIf true, a later non-conflicting showing is available.

Definition at line 280 of file tv_rec.cpp.

Referenced by CancelNextRecording(), EncoderLink::RecordPending(), and RemoteRecordPending().

RecStatusType TVRec::StartRecording ( const ProgramInfo rcinfo)

Tells TVRec to Start recording the program "rcinfo" as soon as possible.

See Also
EncoderLink::StartRecording(const ProgramInfo*) RecordPending(const ProgramInfo*, int, bool), StopRecording()

Definition at line 407 of file tv_rec.cpp.

Referenced by EncoderLink::StartRecording().

RecStatusType TVRec::GetRecordingStatus ( void  ) const

Definition at line 672 of file tv_rec.cpp.

Referenced by EncoderLink::GetRecordingStatus(), and StartRecording().

void TVRec::StopRecording ( bool  killFile = false)

Changes from a recording state to kState_None.

Note
For the sake of recording quality measurements this is treated as the desired end point of the recording.
See Also
StartRecording(const ProgramInfo *rec), FinishRecording()

Definition at line 708 of file tv_rec.cpp.

Referenced by RemoteStopRecording(), StartRecording(), and EncoderLink::StopRecording().

void TVRec::FinishRecording ( void  )
inline

Tells TVRec to finish the current recording as soon as possible.

Definition at line 156 of file tv_rec.h.

Referenced by EncoderLink::FinishRecording().

void TVRec::FrontendReady ( void  )
inline

Tells TVRec that the frontend's TV class is ready for messages.

Definition at line 158 of file tv_rec.h.

Referenced by EncoderLink::FrontendReady().

void TVRec::CancelNextRecording ( bool  cancel)

Tells TVRec to cancel the upcoming recording.

See Also
RecordPending(const ProgramInfo*, int, bool), TV::AskAllowRecording(const QStringList&, int, bool)

Definition at line 357 of file tv_rec.cpp.

Referenced by EncoderLink::CancelNextRecording(), and StartRecording().

ProgramInfo * TVRec::GetRecording ( void  )

Allocates and returns a ProgramInfo for the current recording.

Note: The user of this function must free the ProgramInfo this returns.

Returns
ProgramInfo for the current recording, if it exists, blank ProgramInfo otherwise.

Definition at line 248 of file tv_rec.cpp.

Referenced by EncoderLink::GetRecording(), and EncoderLink::MatchesRecording().

bool TVRec::IsRunning ( void  ) const
inline

Returns true if event loop has not been told to shut down.

Definition at line 163 of file tv_rec.h.

void TVRec::Stop ( void  )
inline

Tells TVRec to stop event loop.

Definition at line 165 of file tv_rec.h.

TVState TVRec::GetState ( void  ) const

Returns the TVState of the recorder.

If there is a pending state change kState_ChangingState is returned.

See Also
EncoderLink::GetState(), Recorder Subsystem

Definition at line 234 of file tv_rec.cpp.

Referenced by EncoderLink::GetState(), HandlePendingRecordings(), IsBusy(), RemoteGetState(), run(), SetSignalMonitoringRate(), StartRecording(), and StopRecording().

bool TVRec::IsPlaying ( void  )
inline

Returns "state == kState_RecordingPreRecorded".

Definition at line 169 of file tv_rec.h.

bool TVRec::IsRecording ( void  )
inline

Returns "state == kState_RecordingRecordedOnly".

See Also
IsReallyRecording()

Definition at line 172 of file tv_rec.h.

bool TVRec::SetVideoFiltersForChannel ( uint  sourceid,
const QString &  channum 
)

Definition at line 2391 of file tv_rec.cpp.

Referenced by DTVChannel::SetChannelByString(), and TuningNewRecorder().

bool TVRec::IsBusy ( TunedInputInfo busy_input = NULL,
int  time_buffer = 5 
) const

Returns true if the recorder is busy, or will be within the next time_buffer seconds.

See Also
EncoderLink::IsBusy(TunedInputInfo*, int time_buffer)

Definition at line 2422 of file tv_rec.cpp.

Referenced by ChannelBase::GetFreeInputs(), EncoderLink::IsBusy(), ChannelBase::IsInputAvailable(), and RemoteIsBusy().

bool TVRec::IsReallyRecording ( void  )

Returns true if frontend can consider the recorder started.

See Also
IsRecording()

Definition at line 2411 of file tv_rec.cpp.

Referenced by EncoderLink::IsReallyRecording().

float TVRec::GetFramerate ( void  )

Returns recordering frame rate from the recorder.

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

Definition at line 2491 of file tv_rec.cpp.

Referenced by EncoderLink::GetFramerate().

long long TVRec::GetFramesWritten ( void  )

Returns number of frames written to disk by recorder.

See Also
EncoderLink::GetFramesWritten(), RemoteEncoder::GetFramesWritten()
Returns
Number of frames if query succeeds, -1 otherwise.

Definition at line 2506 of file tv_rec.cpp.

Referenced by FinishedRecording(), and EncoderLink::GetFramesWritten().

long long TVRec::GetFilePosition ( void  )

Returns total number of bytes written by RingBuffer.

See Also
EncoderLink::GetFilePosition(), RemoteEncoder::GetFilePosition()
Returns
Bytes written if query succeeds, -1 otherwise.

Definition at line 2521 of file tv_rec.cpp.

Referenced by EncoderLink::GetFilePosition().

long long TVRec::GetMaxBitrate ( void  ) const

Returns the maximum bits per second this recorder can produce.

See Also
EncoderLink::GetMaxBitrate(void), RemoteEncoder::GetMaxBitrate(void)

Definition at line 2581 of file tv_rec.cpp.

Referenced by EncoderLink::GetMaxBitrate().

int64_t TVRec::GetKeyframePosition ( uint64_t  desired) const

Returns byte position in RingBuffer of a keyframe according to recorder.

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

Definition at line 2537 of file tv_rec.cpp.

Referenced by EncoderLink::GetKeyframePosition().

bool TVRec::GetKeyframePositions ( int64_t  start,
int64_t  end,
frm_pos_map_t map 
) const

Returns byte position in RingBuffer of a keyframes according to recorder.

See Also
EncoderLink::GetKeyframePositions(int64_t, int64_t, frm_pos_map_t&), RemoteEncoder::GetKeyframePositions(int64_t, int64_t, frm_pos_map_t&)
Returns
Byte position of keyframe if query succeeds, -1 otherwise.

Definition at line 2554 of file tv_rec.cpp.

Referenced by EncoderLink::GetKeyframePositions().

bool TVRec::GetKeyframeDurations ( int64_t  start,
int64_t  end,
frm_pos_map_t map 
) const

Definition at line 2565 of file tv_rec.cpp.

Referenced by EncoderLink::GetKeyframeDurations().

void TVRec::SpawnLiveTV ( LiveTVChain newchain,
bool  pip,
QString  startchan 
)

Tells TVRec to spawn a "Live TV" recorder.

See Also
EncoderLink::SpawnLiveTV(LiveTVChain*,bool,QString), RemoteEncoder::SpawnLiveTV(QString,bool,QSting)

Definition at line 2601 of file tv_rec.cpp.

Referenced by EncoderLink::SpawnLiveTV().

QString TVRec::GetChainID ( void  )

Get the chainid of the livetv instance.

Definition at line 2630 of file tv_rec.cpp.

Referenced by EncoderLink::GetChainID().

void TVRec::StopLiveTV ( void  )

Tells TVRec to stop a "Live TV" recorder.

See Also
EncoderLink::StopLiveTV(), RemoteEncoder::StopLiveTV()

Definition at line 2831 of file tv_rec.cpp.

Referenced by RemoteStopLiveTV(), and EncoderLink::StopLiveTV().

void TVRec::PauseRecorder ( void  )

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

When the RecorderBase instance has paused it calls RecorderPaused(void)

See Also
EncoderLink::PauseRecorder(void), RemoteEncoder::PauseRecorder(void), RecorderBase::Pause(void)

Definition at line 2874 of file tv_rec.cpp.

Referenced by EncoderLink::PauseRecorder().

void TVRec::ToggleChannelFavorite ( QString  changroupname)

Toggles whether the current channel should be on our favorites list.

Definition at line 2902 of file tv_rec.cpp.

Referenced by EncoderLink::ToggleChannelFavorite().

void TVRec::SetLiveRecording ( int  recording)

Tells the Scheduler about changes to the recording status of the LiveTV recording.

NOTE: Currently the 'recording' parameter is ignored and decisions are based on the recording group alone.

Parameters
recordingSet to 1 to mark as rsRecording, set to 0 to mark as rsCancelled, and set to -1 to base the decision of the recording group.

Definition at line 2783 of file tv_rec.cpp.

Referenced by EncoderLink::SetLiveRecording().

vector< InputInfo > TVRec::GetFreeInputs ( const vector< uint > &  excluded_cards) const

Returns the recorder's available inputs.

This filters out the connected inputs that belong to an input group which is busy. Recorders in the excluded cardids will not be considered busy for the sake of determining free inputs.

Definition at line 2991 of file tv_rec.cpp.

Referenced by EncoderLink::GetFreeInputs().

QString TVRec::GetInput ( void  ) const

Returns current input.

Definition at line 3003 of file tv_rec.cpp.

Referenced by EncoderLink::GetInput(), and SetInput().

uint TVRec::GetSourceID ( void  ) const

Returns current source id.

Definition at line 3013 of file tv_rec.cpp.

Referenced by EITScanner::run().

QString TVRec::SetInput ( QString  input,
uint  requestType = kFlagDetect 
)

Changes to the specified input.

You must call PauseRecorder(void) before calling this.

Parameters
inputInput to switch to, or "SwitchToNextInput".
Returns
input we have switched to

Definition at line 3028 of file tv_rec.cpp.

Referenced by EncoderLink::SetInput().

void TVRec::ChangeChannel ( ChannelChangeDirection  dir)
inline

Changes to a channel in the 'dir' channel change direction.

Definition at line 200 of file tv_rec.h.

Referenced by EncoderLink::ChangeChannel().

void TVRec::SetChannel ( QString  name,
uint  requestType = kFlagDetect 
)

Changes to a named channel on the current tuner.

You must call PauseRecorder() before calling this.

Parameters
namechannum of channel to change to
requestTypetells us what kind of request to actually send to the tuning thread, kFlagDetect is usually sufficient

Definition at line 3087 of file tv_rec.cpp.

Referenced by EncoderLink::SetChannel().

bool TVRec::QueueEITChannelChange ( const QString &  name)

Queues up a channel change for the EITScanner.

Unlike the normal SetChannel() this does not block until the channel change occurs to avoid a deadlock if EITScanner::StopActiveScan() is called with the stateChangeLock held while the EITScanner is calling TVRec::SetChannel().

Definition at line 3136 of file tv_rec.cpp.

Referenced by EITScanner::run().

int TVRec::SetSignalMonitoringRate ( int  msec,
int  notifyFrontend = 1 
)

Sets the signal monitoring rate.

See Also
EncoderLink::SetSignalMonitoringRate(int,int), RemoteEncoder::SetSignalMonitoringRate(int,int)
Parameters
rateThe update rate to use in milliseconds, use 0 to disable signal monitoring.
notifyFrontendIf 1, SIGNAL messages will be sent to the frontend using this recorder.
Returns
1 if it signal monitoring is turned on, 0 otherwise.

Definition at line 2065 of file tv_rec.cpp.

Referenced by EncoderLink::SetSignalMonitoringRate().

int TVRec::GetPictureAttribute ( PictureAttribute  attr)

Definition at line 2952 of file tv_rec.cpp.

Referenced by EncoderLink::GetPictureAttribute().

int TVRec::ChangePictureAttribute ( PictureAdjustType  type,
PictureAttribute  attr,
bool  direction 
)

Returns current value [0,100] if it succeeds, -1 otherwise.

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

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

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

Returns
current value [0,100] if it succeeds, -1 otherwise.

Definition at line 2970 of file tv_rec.cpp.

Referenced by EncoderLink::ChangePictureAttribute().

bool TVRec::CheckChannel ( QString  name) const

Checks if named channel exists on current tuner.

Parameters
namechannel to verify against current tuner.
Returns
true if it succeeds, false otherwise.
See Also
EncoderLink::CheckChannel(const QString&), RemoteEncoder::CheckChannel(QString), CheckChannel(ChannelBase*,const QString&,QString&), ShouldSwitchToAnotherCard(QString)

Definition at line 2207 of file tv_rec.cpp.

Referenced by EncoderLink::CheckChannel().

bool TVRec::ShouldSwitchToAnotherCard ( QString  chanid)

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

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

Definition at line 2119 of file tv_rec.cpp.

Referenced by EncoderLink::ShouldSwitchToAnotherCard().

bool TVRec::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.

If the prefix matches a channel on any recorder this function returns true, otherwise it returns false.

If the prefix matches any channel entirely (i.e. prefix == channum), then the cardid of the recorder it matches is returned in 'is_complete_valid_channel_on_rec'; if it matches multiple recorders, and one of them is this recorder, this recorder is returned in 'is_complete_valid_channel_on_rec'; if it isn't complete for any channel on any recorder 'is_complete_valid_channel_on_rec' is set to zero.

If adding another character could reduce the number of channels the prefix matches 'is_extra_char_useful' is set to true, otherwise it is set to false.

Finally, if in order for the prefix to match a channel, a spacer needs to be added, the first matching spacer is returned in needed_spacer. If there is more than one spacer that might be employed and one of them is used for the current recorder, and others are used for other recorders, then the one for the current recorder is returned. The spacer must be inserted before the last character of the prefix for anything else returned from the function to be valid.

Returns
true if this is a valid prefix for a channel, false otherwise

Definition at line 2255 of file tv_rec.cpp.

Referenced by EncoderLink::CheckChannelPrefix().

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

Definition at line 3162 of file tv_rec.cpp.

Referenced by EncoderLink::GetNextProgram().

bool TVRec::GetChannelInfo ( uint chanid,
uint sourceid,
QString &  callsign,
QString &  channum,
QString &  channame,
QString &  xmltvid 
) const

Definition at line 3285 of file tv_rec.cpp.

Referenced by EncoderLink::GetChannelInfo().

bool TVRec::SetChannelInfo ( uint  chanid,
uint  sourceid,
QString  oldchannum,
QString  callsign,
QString  channum,
QString  channame,
QString  xmltvid 
)

Definition at line 3326 of file tv_rec.cpp.

Referenced by EncoderLink::SetChannelInfo().

uint TVRec::GetCaptureCardNum ( void  )
inline
bool TVRec::IsErrored ( void  ) const
inline

Returns true is "errored" is true, false otherwise.

Definition at line 229 of file tv_rec.h.

Referenced by run().

void TVRec::RingBufferChanged ( RingBuffer rb,
RecordingInfo pginfo,
RecordingQuality recq 
)

Definition at line 3382 of file tv_rec.cpp.

Referenced by RecorderBase::CheckForRingBufferSwitch().

void TVRec::RecorderPaused ( void  )
void TVRec::SetNextLiveTVDir ( QString  dir)

Definition at line 4378 of file tv_rec.cpp.

Referenced by EncoderLink::SetNextLiveTVDir().

uint TVRec::GetFlags ( void  ) const
inline

Definition at line 236 of file tv_rec.h.

Referenced by EncoderLink::GetFlags(), HandleStateChange(), and RemoteGetFlags().

TVRec * TVRec::GetTVRec ( uint  cardid)
static
virtual void TVRec::AllGood ( void  )
inlinevirtual

Signal to be sent when you have a lock on all values.

Note: Signals are only sent once the monitoring thread has been started.

Implements SignalMonitorListener.

Definition at line 240 of file tv_rec.h.

virtual void TVRec::StatusChannelTuned ( const SignalMonitorValue )
inlinevirtual

Signal to be sent with change change status.

Note: Signals are only sent once the monitoring thread has been started.

Implements SignalMonitorListener.

Definition at line 241 of file tv_rec.h.

virtual void TVRec::StatusSignalLock ( const SignalMonitorValue )
inlinevirtual

Signal to be sent as true when it is safe to begin or continue recording, and false if it may not be safe.

Note: Signals are only sent once the monitoring thread has been started.

Implements SignalMonitorListener.

Definition at line 242 of file tv_rec.h.

virtual void TVRec::StatusSignalStrength ( const SignalMonitorValue )
inlinevirtual

Signal to be sent with an actual signal value.

Note: Signals are only sent once the monitoring thread has been started.

Implements SignalMonitorListener.

Definition at line 243 of file tv_rec.h.

void TVRec::run ( void  )
protectedvirtual

Event handling method, contains event loop.

Definition at line 1252 of file tv_rec.cpp.

bool TVRec::WaitForEventThreadSleep ( bool  wake = true,
ulong  time = ULONG_MAX 
)
protected

You MUST HAVE the stateChange-lock locked when you call this method!

Definition at line 1466 of file tv_rec.cpp.

Referenced by Init(), SetChannel(), SetInput(), SetSignalMonitoringRate(), SpawnLiveTV(), StartRecording(), StopLiveTV(), and StopRecording().

void TVRec::SetRingBuffer ( RingBuffer rb)
private

Sets "ringBuffer", deleting any existing RingBuffer.

Definition at line 3365 of file tv_rec.cpp.

Referenced by CreateLiveTVRingBuffer(), RingBufferChanged(), SwitchLiveTVRingBuffer(), TeardownAll(), TuningNewRecorder(), and TuningShutdowns().

void TVRec::SetPseudoLiveTVRecording ( RecordingInfo pi)
private

Sets the pseudo LiveTV RecordingInfo.

Definition at line 333 of file tv_rec.cpp.

Referenced by CheckForRecGroupChange(), HandleStateChange(), run(), and StartRecording().

void TVRec::TeardownAll ( void  )
private

Definition at line 192 of file tv_rec.cpp.

Referenced by ~TVRec().

void TVRec::WakeEventLoop ( void  )
private
bool TVRec::GetDevices ( uint  cardid,
GeneralDBOptions general_opts,
DVBDBOptions dvb_opts,
FireWireDBOptions firewire_opts 
)
staticprivate

Definition at line 1573 of file tv_rec.cpp.

Referenced by Init(), and TuningShutdowns().

QString TVRec::GetStartChannel ( uint  cardid,
const QString &  startinput 
)
staticprivate

Definition at line 1656 of file tv_rec.cpp.

Referenced by Init(), TuningCheckForHWChange(), and TuningGetChanNum().

void TVRec::TeardownRecorder ( uint  request_flags)
private

Tears down the recorder.

If a "recorder" exists, RecorderBase::StopRecording() is called. We then wait for "recorder_thread" to exit, and finally we delete "recorder".

If a RingBuffer instance exists, RingBuffer::StopReads() is called.

If request_flags include kFlagKillRec we mark the recording as being damaged.

Finally, if there was a recording and it was not damaged, schedule any post-processing jobs.

Definition at line 1092 of file tv_rec.cpp.

Referenced by TeardownAll(), TuningNewRecorder(), and TuningShutdowns().

DTVRecorder * TVRec::GetDTVRecorder ( void  )
private
bool TVRec::CreateChannel ( const QString &  startChanNum,
bool  enter_power_save_mode 
)
private

Definition at line 126 of file tv_rec.cpp.

Referenced by Init(), and TuningShutdowns().

void TVRec::CloseChannel ( void  )
private

Definition at line 1148 of file tv_rec.cpp.

Referenced by TuningNewRecorder(), and TuningShutdowns().

DTVChannel * TVRec::GetDTVChannel ( void  )
private
V4LChannel * TVRec::GetV4LChannel ( void  )
private

Definition at line 1163 of file tv_rec.cpp.

Referenced by TeardownRecorder(), TuningNewRecorder(), and TuningRestartRecorder().

bool TVRec::SetupSignalMonitor ( bool  enable_table_monitoring,
bool  EITscan,
bool  notify 
)
private

This creates a SignalMonitor instance and begins signal monitoring.

If the channel exists and there is something to monitor a SignalMonitor instance is created and SignalMonitor::Start() is called to start the signal monitoring thread.

Parameters
tablemonIf set we enable table monitoring
notifyIf set we notify the frontend of the signal values
Returns
true on success, false on failure

Definition at line 1974 of file tv_rec.cpp.

Referenced by TuningFrequency().

bool TVRec::SetupDTVSignalMonitor ( bool  EITscan)
private

Tells DTVSignalMonitor what channel to look for.

If the major and minor channels are set we tell the signal monitor to look for those in the VCT.

Otherwise, we tell the signal monitor to look for the MPEG program number in the PAT.

This method also grabs the ATSCStreamData() from the recorder if possible, or creates one if needed.

Parameters
EITscanif set we never look for video streams and we lock on encrypted streams even if we can't decode them.

Definition at line 1795 of file tv_rec.cpp.

Referenced by SetupSignalMonitor().

void TVRec::TeardownSignalMonitor ( void  )
private

If a SignalMonitor instance exists, the monitoring thread is stopped and the instance is deleted.

Definition at line 2027 of file tv_rec.cpp.

Referenced by TeardownAll(), TuningShutdowns(), and TuningSignalCheck().

DTVSignalMonitor * TVRec::GetDTVSignalMonitor ( void  )
private
bool TVRec::HasFlags ( uint  f) const
inlineprivate
void TVRec::SetFlags ( uint  f)
private
void TVRec::ClearFlags ( uint  f)
private
QString TVRec::FlagToString ( uint  f)
staticprivate

Definition at line 4284 of file tv_rec.cpp.

Referenced by ClearFlags(), SetFlags(), and TuningRequest::toString().

void TVRec::HandleTuning ( void  )
private

Handles all tuning events.

This method pops tuning events off the tuningState queue and does what needs to be done, mostly by calling one of the Tuning... methods.

Definition at line 3493 of file tv_rec.cpp.

Referenced by run().

void TVRec::TuningShutdowns ( const TuningRequest request)
private

This shuts down anything that needs to be shut down before handling the passed in tuning request.

Definition at line 3605 of file tv_rec.cpp.

Referenced by HandleTuning().

void TVRec::TuningFrequency ( const TuningRequest request)
private

Performs initial tuning required for any tuning event.

This figures out the channel name, and possibly the input name we need to pass to "channel" and then calls channel appropriately.

Then it adds any filters and sets any video capture attributes that need to be set.

The signal monitoring is started if possible. If it is started the kFlagWaitForSignal flag is set.

The kFlagNeedToStartRecorder flag is ald set if this isn't an EIT scan so that the recorder is started or restarted a appropriate.

Definition at line 3703 of file tv_rec.cpp.

Referenced by HandleTuning().

MPEGStreamData * TVRec::TuningSignalCheck ( void  )
private

This checks if we have a channel lock.

If we have a channel lock this shuts down the signal monitoring.

Returns
MPEGStreamData pointer if we have a complete lock, NULL otherwise

Definition at line 3888 of file tv_rec.cpp.

Referenced by HandleTuning().

void TVRec::TuningNewRecorder ( MPEGStreamData streamData)
private

Creates a recorder instance.

Definition at line 4041 of file tv_rec.cpp.

Referenced by HandleTuning().

void TVRec::TuningRestartRecorder ( void  )
private

Restarts a stopped recorder or unpauses a paused recorder.

Definition at line 4201 of file tv_rec.cpp.

Referenced by HandleTuning().

QString TVRec::TuningGetChanNum ( const TuningRequest request,
QString &  input 
) const
private

Definition at line 3404 of file tv_rec.cpp.

Referenced by HandleTuning().

uint TVRec::TuningCheckForHWChange ( const TuningRequest request,
QString &  channum,
QString &  inputname 
)
private

Returns cardid for device info row in capturecard if it changes.

Definition at line 3564 of file tv_rec.cpp.

Referenced by TuningShutdowns().

bool TVRec::TuningOnSameMultiplex ( TuningRequest request)
private

Definition at line 3442 of file tv_rec.cpp.

Referenced by HandleTuning().

void TVRec::HandleStateChange ( void  )
private

Changes the internalState to the desiredNextState if possible.

Note: There must exist a state transition from any state we can enter to the kState_None state, as this is used to shutdown TV in RunTV.

Definition at line 990 of file tv_rec.cpp.

Referenced by run().

void TVRec::ChangeState ( TVState  nextState)
private

Puts a state change on the nextState queue.

Definition at line 1070 of file tv_rec.cpp.

Referenced by CreateLiveTVRingBuffer(), run(), SpawnLiveTV(), StartRecording(), StopLiveTV(), StopRecording(), SwitchLiveTVRingBuffer(), TuningFrequency(), and TuningNewRecorder().

bool TVRec::StateIsRecording ( TVState  state)
private

Returns true if "state" is kState_RecordingOnly, or kState_WatchingLiveTV.

Parameters
stateTVState to check.

Definition at line 735 of file tv_rec.cpp.

Referenced by RemoveRecording(), and StopRecording().

bool TVRec::StateIsPlaying ( TVState  state)
private

Returns true if we are in any state associated with a player.

Parameters
stateTVState to check.

Definition at line 745 of file tv_rec.cpp.

Referenced by RemovePlaying(), and run().

TVState TVRec::RemovePlaying ( TVState  state)
private

Returns TVState that would remove the playing, but potentially keep recording if we are watching an in progress recording.

Parameters
stateTVState to check.

Definition at line 771 of file tv_rec.cpp.

Referenced by run().

TVState TVRec::RemoveRecording ( TVState  state)
private

If "state" is kState_RecordingOnly or kState_WatchingLiveTV, returns a kState_None, otherwise returns kState_Error.

Parameters
stateTVState to check.

Definition at line 755 of file tv_rec.cpp.

Referenced by StopRecording().

void TVRec::HandlePendingRecordings ( void  )
private

Definition at line 1503 of file tv_rec.cpp.

Referenced by run().

bool TVRec::WaitForNextLiveTVDir ( void  )
private

Definition at line 4365 of file tv_rec.cpp.

Referenced by GetProgramRingBufferForLiveTV().

bool TVRec::GetProgramRingBufferForLiveTV ( RecordingInfo **  pginfo,
RingBuffer **  rb,
const QString &  channum,
int  inputID 
)
private

Definition at line 4386 of file tv_rec.cpp.

Referenced by CreateLiveTVRingBuffer(), and SwitchLiveTVRingBuffer().

bool TVRec::CreateLiveTVRingBuffer ( const QString &  channum)
private

Definition at line 4485 of file tv_rec.cpp.

Referenced by TuningFrequency(), and TuningNewRecorder().

bool TVRec::SwitchLiveTVRingBuffer ( const QString &  channum,
bool  discont,
bool  set_rec 
)
private

Definition at line 4536 of file tv_rec.cpp.

Referenced by run(), TuningFrequency(), TuningNewRecorder(), and TuningRestartRecorder().

RecordingInfo * TVRec::SwitchRecordingRingBuffer ( const RecordingInfo rcinfo)
private

Definition at line 4605 of file tv_rec.cpp.

Referenced by StartRecording().

void TVRec::StartedRecording ( RecordingInfo curRec)
private

Inserts a "curRec" into the database.

Parameters
curRecRecording to add to database.
See Also
ProgramInfo::StartedRecording(const QString&)

Definition at line 791 of file tv_rec.cpp.

Referenced by GetProgramRingBufferForLiveTV(), StartRecording(), and SwitchRecordingRingBuffer().

void TVRec::FinishedRecording ( RecordingInfo curRec,
RecordingQuality recq 
)
private

If not a premature stop, adds program to history of recorded programs.

If the recording type is kOneRecord this find is removed.

See Also
ProgramInfo::FinishedRecording(bool prematurestop)
Parameters
curRecRecordingInfo or recording to mark as done

Definition at line 816 of file tv_rec.cpp.

Referenced by RingBufferChanged(), SwitchLiveTVRingBuffer(), SwitchRecordingRingBuffer(), TeardownRecorder(), TuningNewRecorder(), TuningRestartRecorder(), and TuningShutdowns().

QDateTime TVRec::GetRecordEndTime ( const ProgramInfo pi) const
private

Returns recording end time with proper post-roll.

Definition at line 344 of file tv_rec.cpp.

Referenced by RingBufferChanged(), SetLiveRecording(), StartRecording(), StopLiveTV(), and SwitchRecordingRingBuffer().

void TVRec::CheckForRecGroupChange ( void  )
private

Check if frontend changed the recording group.

This is needed because the frontend may toggle whether something should be kept as a recording in the frontend, but this class may not find out about it in time unless we check the DB when this information is important.

Definition at line 2645 of file tv_rec.cpp.

Referenced by HandlePendingRecordings(), SetLiveRecording(), and StopLiveTV().

void TVRec::NotifySchedulerOfRecording ( RecordingInfo rec)
private

Tell scheduler about the recording.

This is needed if the frontend has marked the LiveTV buffer for recording after we exit LiveTV. In this case the scheduler needs to know about the recording so it can properly take overrecord into account, and to properly reschedule other recordings around to avoid this recording.

Definition at line 2700 of file tv_rec.cpp.

Referenced by SetLiveRecording(), and StopLiveTV().

void TVRec::InitAutoRunJobs ( RecordingInfo rec,
AutoRunInitType  t,
RecordingProfile recpro,
int  line 
)
private
void TVRec::SetRecordingStatus ( RecStatusType  new_status,
int  line,
bool  have_lock = false 
)
private

Definition at line 678 of file tv_rec.cpp.

Referenced by Init(), StartRecording(), StopRecording(), and TuningSignalCheck().

Friends And Related Function Documentation

friend class TuningRequest
friend
friend class TVRecRecordThread
friend

Definition at line 142 of file tv_rec.h.

Member Data Documentation

RecorderBase* TVRec::recorder
private
ChannelBase* TVRec::channel
private

Definition at line 327 of file tv_rec.h.

Referenced by ChangePictureAttribute(), CheckChannel(), CloseChannel(), CreateChannel(), CreateLiveTVRingBuffer(), nv_python_libs.mashups.mashups_api.Videos::displayTreeView(), nv_python_libs.hulu.hulu_api.Videos::displayTreeView(), nv_python_libs.bbciplayer.bbciplayer_api.Videos::displayTreeView(), nv_python_libs.thewb.thewb_api.Videos::displayTreeView(), nv_python_libs.youtube.youtube_api.Videos::displayTreeView(), nv_python_libs.rev3.rev3_api.Videos::displayTreeView(), nv_python_libs.dailymotion.dailymotion_api.Videos::displayTreeView(), nv_python_libs.vimeo.vimeo_api.Videos::displayTreeView(), GetChannelInfo(), GetDTVChannel(), GetFreeInputs(), GetInput(), GetNextProgram(), GetPictureAttribute(), GetProgramRingBufferForLiveTV(), GetSourceID(), nv_python_libs.vimeo.vimeo_api.Videos::getTreeVideos(), GetV4LChannel(), nv_python_libs.mtv.mtv_api.Videos::getVideosForURL(), nv_python_libs.youtube.youtube_api.Videos::getVideosForURL(), HandleTuning(), IsBusy(), NotifySchedulerOfRecording(), run(), nv_python_libs.mnvsearch.mnvsearch_api.Videos::searchForVideos(), nv_python_libs.mashups.mashups_api.Videos::searchForVideos(), nv_python_libs.tedtalks.tedtalks_api.Videos::searchForVideos(), nv_python_libs.hulu.hulu_api.Videos::searchForVideos(), nv_python_libs.bbciplayer.bbciplayer_api.Videos::searchForVideos(), nv_python_libs.thewb.thewb_api.Videos::searchForVideos(), nv_python_libs.rev3.rev3_api.Videos::searchForVideos(), nv_python_libs.mnvsearch.mnvsearch_api.Videos::searchTitle(), nv_python_libs.hulu.hulu_api.Videos::searchTitle(), nv_python_libs.bbciplayer.bbciplayer_api.Videos::searchTitle(), nv_python_libs.thewb.thewb_api.Videos::searchTitle(), nv_python_libs.youtube.youtube_api.Videos::searchTitle(), nv_python_libs.rev3.rev3_api.Videos::searchTitle(), nv_python_libs.vimeo.vimeo_api.Videos::searchTitle(), SetChannelInfo(), SetInput(), SetSignalMonitoringRate(), SetupDTVSignalMonitor(), SetupSignalMonitor(), SwitchLiveTVRingBuffer(), TeardownAll(), TeardownRecorder(), ToggleChannelFavorite(), TuningCheckForHWChange(), TuningFrequency(), TuningGetChanNum(), TuningNewRecorder(), TuningOnSameMultiplex(), TuningRestartRecorder(), TuningShutdowns(), and TuningSignalCheck().

SignalMonitor* TVRec::signalMonitor
private
EITScanner* TVRec::scanner
private

Definition at line 329 of file tv_rec.h.

Referenced by HandleStateChange(), run(), TeardownAll(), TuningShutdowns(), and TuningSignalCheck().

MThread* TVRec::eventThread
private

Event processing thread, runs TVRec::run().

Definition at line 333 of file tv_rec.h.

Referenced by Init(), and TeardownAll().

MThread* TVRec::recorderThread
private

Recorder thread, runs RecorderBase::run().

Definition at line 335 of file tv_rec.h.

Referenced by TeardownRecorder(), and TuningNewRecorder().

bool TVRec::transcodeFirst
private

Definition at line 338 of file tv_rec.h.

Referenced by Init(), and InitAutoRunJobs().

bool TVRec::earlyCommFlag
private

Definition at line 339 of file tv_rec.h.

Referenced by Init(), and InitAutoRunJobs().

bool TVRec::runJobOnHostOnly
private

Definition at line 340 of file tv_rec.h.

Referenced by Init(), and InitAutoRunJobs().

int TVRec::eitCrawlIdleStart
private

Definition at line 341 of file tv_rec.h.

Referenced by HandleStateChange(), Init(), and run().

int TVRec::eitTransportTimeout
private

Definition at line 342 of file tv_rec.h.

Referenced by HandleStateChange(), Init(), and run().

int TVRec::audioSampleRateDB
private

Definition at line 343 of file tv_rec.h.

Referenced by Init().

int TVRec::overRecordSecNrml
private

Definition at line 344 of file tv_rec.h.

Referenced by GetRecordEndTime(), and Init().

int TVRec::overRecordSecCat
private

Definition at line 345 of file tv_rec.h.

Referenced by GetRecordEndTime(), and Init().

QString TVRec::overRecordCategory
private

Definition at line 346 of file tv_rec.h.

Referenced by GetRecordEndTime(), and Init().

InputGroupMap TVRec::igrp
private

Definition at line 347 of file tv_rec.h.

Referenced by StartRecording().

uint TVRec::cardid
private
bool TVRec::ispip
private

Definition at line 351 of file tv_rec.h.

Referenced by SpawnLiveTV(), and TeardownRecorder().

GeneralDBOptions TVRec::genOpt
private
DVBDBOptions TVRec::dvbOpt
private

Definition at line 355 of file tv_rec.h.

Referenced by CloseChannel(), CreateChannel(), Init(), run(), TuningNewRecorder(), and TuningShutdowns().

FireWireDBOptions TVRec::fwOpt
private

Definition at line 356 of file tv_rec.h.

Referenced by CreateChannel(), Init(), and TuningShutdowns().

QMutex TVRec::setChannelLock
mutableprivate

Definition at line 359 of file tv_rec.h.

Referenced by QueueEITChannelChange(), and SetChannel().

QMutex TVRec::stateChangeLock
mutableprivate
QMutex TVRec::pendingRecLock
mutableprivate
TVState TVRec::internalState
private
TVState TVRec::desiredNextState
private

Definition at line 363 of file tv_rec.h.

Referenced by ChangeState(), and HandleStateChange().

bool TVRec::changeState
private
bool TVRec::pauseNotify
private

Definition at line 365 of file tv_rec.h.

Referenced by RecorderPaused(), and TeardownRecorder().

uint TVRec::stateFlags
private

Definition at line 366 of file tv_rec.h.

Referenced by ClearFlags(), and SetFlags().

TuningQueue TVRec::tuningRequests
private
TuningRequest TVRec::lastTuningRequest
private
QDateTime TVRec::eitScanStartTime
private

Definition at line 369 of file tv_rec.h.

Referenced by HandleStateChange(), and run().

QMutex TVRec::triggerEventLoopLock
mutableprivate

Definition at line 370 of file tv_rec.h.

Referenced by run(), and WakeEventLoop().

QWaitCondition TVRec::triggerEventLoopWait
private

Definition at line 371 of file tv_rec.h.

Referenced by run(), and WakeEventLoop().

bool TVRec::triggerEventLoopSignal
private

Definition at line 372 of file tv_rec.h.

Referenced by run(), and WakeEventLoop().

QMutex TVRec::triggerEventSleepLock
mutableprivate

Definition at line 373 of file tv_rec.h.

Referenced by run(), and WaitForEventThreadSleep().

QWaitCondition TVRec::triggerEventSleepWait
private

Definition at line 374 of file tv_rec.h.

Referenced by run(), and WaitForEventThreadSleep().

bool TVRec::triggerEventSleepSignal
private

Definition at line 375 of file tv_rec.h.

Referenced by run(), and WaitForEventThreadSleep().

volatile bool TVRec::switchingBuffer
private

Definition at line 376 of file tv_rec.h.

Referenced by run(), SetRingBuffer(), and SwitchRecordingRingBuffer().

RecStatusType TVRec::m_recStatus
private

Definition at line 377 of file tv_rec.h.

Referenced by GetRecordingStatus(), SetRecordingStatus(), and StartRecording().

RecordingInfo* TVRec::curRecording
private
QDateTime TVRec::recordEndTime
private
QHash<QString,int> TVRec::autoRunJobs
private

Definition at line 382 of file tv_rec.h.

Referenced by FinishedRecording(), and InitAutoRunJobs().

int TVRec::overrecordseconds
private

Definition at line 383 of file tv_rec.h.

PendingMap TVRec::pendingRecordings
private
RecordingInfo* TVRec::pseudoLiveTVRecording
private
QString TVRec::nextLiveTVDir
private

Definition at line 390 of file tv_rec.h.

Referenced by GetProgramRingBufferForLiveTV(), SetNextLiveTVDir(), and WaitForNextLiveTVDir().

QMutex TVRec::nextLiveTVDirLock
private

Definition at line 391 of file tv_rec.h.

Referenced by GetProgramRingBufferForLiveTV(), SetNextLiveTVDir(), and WaitForNextLiveTVDir().

QWaitCondition TVRec::triggerLiveTVDir
private

Definition at line 392 of file tv_rec.h.

Referenced by SetNextLiveTVDir(), and WaitForNextLiveTVDir().

QString TVRec::LiveTVStartChannel
private

Definition at line 393 of file tv_rec.h.

Referenced by SpawnLiveTV(), and TuningGetChanNum().

LiveTVChain* TVRec::tvchain
private
RingBuffer* TVRec::ringBuffer
private
QString TVRec::rbFileExt
private

Definition at line 400 of file tv_rec.h.

Referenced by CreateChannel(), and StartedRecording().

QMutex TVRec::cardsLock
static

Definition at line 403 of file tv_rec.h.

Referenced by GetTVRec(), TVRec(), and ~TVRec().

QMap< uint, TVRec * > TVRec::cards
static

Definition at line 404 of file tv_rec.h.

Referenced by cleanup(), GetTVRec(), TVRec(), and ~TVRec().

const uint TVRec::kSignalMonitoringRate = 50
static

How many milliseconds the signal monitor should wait between checks.

Definition at line 407 of file tv_rec.h.

Referenced by SetupSignalMonitor().

const uint TVRec::kFlagFrontendReady = 0x00000001
static

Definition at line 410 of file tv_rec.h.

Referenced by FlagToString(), and run().

const uint TVRec::kFlagRunMainLoop = 0x00000002
static

Definition at line 411 of file tv_rec.h.

Referenced by FlagToString(), run(), and TeardownAll().

const uint TVRec::kFlagExitPlayer = 0x00000004
static

Definition at line 412 of file tv_rec.h.

Referenced by FlagToString(), and run().

const uint TVRec::kFlagFinishRecording = 0x00000008
static

Definition at line 413 of file tv_rec.h.

Referenced by FlagToString(), and run().

const uint TVRec::kFlagErrored = 0x00000010
static

Definition at line 414 of file tv_rec.h.

Referenced by CreateChannel(), and FlagToString().

const uint TVRec::kFlagCancelNextRecording = 0x00000020
static
const uint TVRec::kFlagLiveTV = 0x00000100
static

final result desired is LiveTV recording

Definition at line 419 of file tv_rec.h.

Referenced by FlagToString(), HandleStateChange(), HandleTuning(), SetSignalMonitoringRate(), TuningFrequency(), TuningGetChanNum(), and TuningNewRecorder().

const uint TVRec::kFlagRecording = 0x00000200
static

final result desired is a timed recording

Definition at line 421 of file tv_rec.h.

Referenced by FlagToString(), HandleStateChange(), HandleTuning(), and TuningNewRecorder().

const uint TVRec::kFlagAntennaAdjust = 0x00000400
static

antenna adjusting mode (LiveTV without recording).

Definition at line 423 of file tv_rec.h.

Referenced by FlagToString(), HandleTuning(), SetSignalMonitoringRate(), TuningFrequency(), and TuningOnSameMultiplex().

const uint TVRec::kFlagRec = 0x00000F00
static

Definition at line 424 of file tv_rec.h.

Referenced by FlagToString(), SetChannel(), SetInput(), and TuningFrequency().

const uint TVRec::kFlagEITScan = 0x00001000
static

final result desired is an EIT Scan

Definition at line 428 of file tv_rec.h.

Referenced by FlagToString(), HandleTuning(), QueueEITChannelChange(), SetChannel(), TuningFrequency(), and TuningShutdowns().

const uint TVRec::kFlagCloseRec = 0x00002000
static

close recorder, keep recording

Definition at line 430 of file tv_rec.h.

Referenced by FlagToString(), and HandleStateChange().

const uint TVRec::kFlagKillRec = 0x00004000
static

close recorder, discard recording

Definition at line 432 of file tv_rec.h.

Referenced by FlagToString(), HandleStateChange(), StopRecording(), TeardownAll(), TeardownRecorder(), TuningFrequency(), and TuningNewRecorder().

const uint TVRec::kFlagNoRec = 0x0000F000
static

Definition at line 434 of file tv_rec.h.

Referenced by FlagToString(), SetChannel(), SetInput(), and TuningShutdowns().

const uint TVRec::kFlagKillRingBuffer = 0x00010000
static

Definition at line 435 of file tv_rec.h.

Referenced by FlagToString(), HandleStateChange(), and TuningShutdowns().

const uint TVRec::kFlagWaitingForRecPause = 0x00100000
static

Definition at line 438 of file tv_rec.h.

Referenced by FlagToString(), and HandleTuning().

const uint TVRec::kFlagWaitingForSignal = 0x00200000
static
const uint TVRec::kFlagNeedToStartRecorder = 0x00800000
static
const uint TVRec::kFlagPendingActions = 0x00F00000
static

Definition at line 441 of file tv_rec.h.

Referenced by CreateLiveTVRingBuffer(), FlagToString(), TuningNewRecorder(), and TuningShutdowns().

const uint TVRec::kFlagSignalMonitorRunning = 0x01000000
static

Definition at line 444 of file tv_rec.h.

Referenced by FlagToString(), TuningFrequency(), TuningShutdowns(), and TuningSignalCheck().

const uint TVRec::kFlagEITScannerRunning = 0x04000000
static
const uint TVRec::kFlagDummyRecorderRunning = 0x10000000
static
const uint TVRec::kFlagRecorderRunning = 0x20000000
static

Definition at line 448 of file tv_rec.h.

Referenced by FlagToString(), TeardownRecorder(), TuningNewRecorder(), and TuningShutdowns().

const uint TVRec::kFlagAnyRecRunning = 0x30000000
static

Definition at line 449 of file tv_rec.h.

Referenced by FlagToString().

const uint TVRec::kFlagAnyRunning = 0x3F000000
static

Definition at line 450 of file tv_rec.h.

Referenced by FlagToString().

const uint TVRec::kFlagRingBufferReady = 0x40000000
static
const uint TVRec::kFlagDetect = 0x80000000
static

Definition at line 454 of file tv_rec.h.

Referenced by SetChannel(), and SetInput().


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