MythTV  master
encoderlink.cpp
Go to the documentation of this file.
1 // ANSI C++ headers
2 #include <chrono> // for milliseconds
3 #include <thread> // for sleep_for
4 
5 // QT headers
6 #include <QMap> // for QMap
7 #include <utility>
8 
9 // MythTV headers
10 #include "mythcorecontext.h"
11 #include "encoderlink.h"
12 #include "playbacksock.h"
13 #include "tv_rec.h"
14 #include "mythdate.h"
16 #include "compat.h"
17 #include "referencecounter.h"
18 #include "inputinfo.h" // for InputInfo
19 #include "mythlogging.h" // for LOG
20 #include "programinfo.h" // for ProgramInfo
21 
22 #define LOC QString("EncoderLink(%1): ").arg(m_inputid)
23 #define LOC_ERR QString("EncoderLink(%1) Error: ").arg(m_inputid)
24 
44  QString lhostname)
45  : m_inputid(inputid), m_sock(lsock), m_hostname(std::move(lhostname))
46 {
47  m_endRecordingTime = MythDate::current().addDays(-2);
49 
53 
55 }
56 
60 EncoderLink::EncoderLink(int inputid, TVRec *ltv)
61  : m_inputid(inputid), m_tv(ltv), m_local(true)
62 {
63  m_endRecordingTime = MythDate::current().addDays(-2);
65 
69 }
70 
76 {
77  if (m_tv)
78  {
79  delete m_tv;
80  m_tv = nullptr;
81  }
82  SetSocket(nullptr);
83 }
84 
89 {
90  QMutexLocker locker(&m_sockLock);
91  if (m_sock)
92  {
93  m_sock->IncrRef();
94  return true;
95  }
96  return false;
97 }
98 
103 {
104  QMutexLocker locker(&m_sockLock);
105  if (m_sock)
106  {
107  m_sock->DecrRef();
108  return true;
109  }
110  return false;
111 }
112 
119 {
120  if (lsock)
121  {
122  lsock->IncrRef();
123 
124  if (gCoreContext->GetSettingOnHost("SleepCommand", m_hostname).isEmpty())
126  else
128  }
129  else
130  {
131  if (IsFallingAsleep())
133  else
135  }
136 
138  m_sock = lsock;
139 }
140 
145 {
146  m_sleepStatus = newStatus;
148 }
149 
155 bool EncoderLink::IsBusy(InputInfo *busy_input, int time_buffer)
156 {
157  if (m_local)
158  return m_tv->IsBusy(busy_input, time_buffer);
159 
160  if (HasSockAndIncrRef())
161  {
162  ReferenceLocker rlocker(m_sock);
163  return m_sock->IsBusy(m_inputid, busy_input, time_buffer);
164  }
165 
166  return false;
167 }
168 
178 {
179  bool retval = false;
180 
181  TVState state = GetState();
182 
183  if (state == kState_RecordingOnly || state == kState_WatchingRecording ||
184  state == kState_WatchingLiveTV)
185  {
186  retval = true;
187  }
188 
189  return retval;
190 }
191 
197 {
198  TVState retval = kState_Error;
199 
200  if (!IsConnected())
201  return retval;
202 
203  if (m_local)
204  retval = m_tv->GetState();
205  else if (HasSockAndIncrRef())
206  {
207  ReferenceLocker rlocker(m_sock);
209  }
210  else
211  LOG(VB_GENERAL, LOG_ERR, QString("Broken for input: %1")
212  .arg(m_inputid));
213 
214  return retval;
215 }
216 
222 {
223  uint retval = 0;
224 
225  if (!IsConnected())
226  return retval;
227 
228  if (m_local)
229  retval = m_tv->GetFlags();
230  else if (HasSockAndIncrRef())
231  {
232  ReferenceLocker rlocker(m_sock);
233  retval = m_sock->GetEncoderState(m_inputid);
234  }
235  else
236  LOG(VB_GENERAL, LOG_ERR, LOC + "GetFlags failed");
237 
238  return retval;
239 }
240 
247 {
248  return (rec->GetChanID() == m_chanid &&
250 }
251 
261 {
262  bool retval = false;
263  ProgramInfo *tvrec = nullptr;
264 
265  if (m_local)
266  {
267  while (kState_ChangingState == GetState())
268  std::this_thread::sleep_for(std::chrono::microseconds(100));
269 
270  if (IsBusyRecording())
271  tvrec = m_tv->GetRecording();
272 
273  if (tvrec)
274  {
275  retval = tvrec->IsSameRecording(*rec);
276  delete tvrec;
277  }
278  }
279  else
280  {
281  if (HasSockAndIncrRef())
282  {
283  ReferenceLocker rlocker(m_sock);
284  retval = m_sock->EncoderIsRecording(m_inputid, rec);
285  }
286  }
287 
288  return retval;
289 }
290 
299 void EncoderLink::RecordPending(const ProgramInfo *rec, int secsleft,
300  bool hasLater)
301 {
302  if (m_local)
303  m_tv->RecordPending(rec, secsleft, hasLater);
304  else if (HasSockAndIncrRef())
305  {
306  ReferenceLocker rlocker(m_sock);
307  m_sock->RecordPending(m_inputid, rec, secsleft, hasLater);
308  }
309 }
310 
317 {
318  if (!IsConnected())
319  return true;
320 
322  return true;
323 
324  return false;
325 }
326 
329 {
330  if (HasSockAndIncrRef())
331  {
332  ReferenceLocker rlocker(m_sock);
333  return m_sock->CheckFile(pginfo);
334  }
335 
336  pginfo->SetPathname(GetPlaybackURL(pginfo));
337  return pginfo->IsLocal();
338 }
339 
345 void EncoderLink::GetDiskSpace(QStringList &o_strlist)
346 {
347  if (HasSockAndIncrRef())
348  {
349  ReferenceLocker rlocker(m_sock);
350  m_sock->GetDiskSpace(o_strlist);
351  }
352 }
353 
361 {
362  if (m_local)
363  return m_tv->GetMaxBitrate();
364  if (HasSockAndIncrRef())
365  {
366  ReferenceLocker rlocker(m_sock);
367  return m_sock->GetMaxBitrate(m_inputid);
368  }
369 
370  return -1;
371 }
372 
387 int EncoderLink::SetSignalMonitoringRate(int rate, int notifyFrontend)
388 {
389  if (m_local)
390  return m_tv->SetSignalMonitoringRate(rate, notifyFrontend);
391  if (HasSockAndIncrRef())
392  {
393  ReferenceLocker rlocker(m_sock);
395  notifyFrontend);
396  }
397  return -1;
398 }
399 
403 {
404  if (IsLocal() || !HasSockAndIncrRef())
405  return false;
406  ReferenceLocker rlocker(m_sock);
407 
409 
410  return m_sock->GoToSleep();
411 }
412 
418 {
419  if (m_locked)
420  return -2;
421 
422  m_locked = true;
423  return m_inputid;
424 }
425 
433 {
435 
438  m_chanid = rec->GetChanID();
439 
440  if (m_local)
441  retval = m_tv->StartRecording(rec);
442  else if (HasSockAndIncrRef())
443  {
444  ReferenceLocker rlocker(m_sock);
445  retval = m_sock->StartRecording(m_inputid, rec);
446  }
447  else
448  LOG(VB_GENERAL, LOG_ERR,
449  QString("Wanted to start recording on recorder %1,\n\t\t\t"
450  "but the backend is not there anymore\n")
451  .arg(m_inputid));
452 
453  if (retval != RecStatus::Recording &&
454  retval != RecStatus::Tuning &&
455  retval != RecStatus::Failing)
456  {
457  m_endRecordingTime = MythDate::current().addDays(-2);
459  m_chanid = 0;
460  }
461 
462  return retval;
463 }
464 
466 {
468 
469  if (m_local)
470  retval = m_tv->GetRecordingStatus();
471  else if (HasSockAndIncrRef())
472  {
473  ReferenceLocker rlocker(m_sock);
475  }
476  else
477  LOG(VB_GENERAL, LOG_ERR,
478  QString("Wanted to get status on recorder %1,\n\t\t\t"
479  "but the backend is not there anymore\n")
480  .arg(m_inputid));
481 
482  if (retval != RecStatus::Recording &&
483  retval != RecStatus::Tuning &&
484  retval != RecStatus::Failing)
485  {
486  m_endRecordingTime = MythDate::current().addDays(-2);
488  m_chanid = 0;
489  }
490 
491  return retval;
492 }
493 
501 {
502  ProgramInfo *info = nullptr;
503 
504  if (m_local)
505  info = m_tv->GetRecording();
506  else if (HasSockAndIncrRef())
507  {
508  ReferenceLocker rlocker(m_sock);
509  info = m_sock->GetRecording(m_inputid);
510  }
511 
512  return info;
513 }
514 
520 void EncoderLink::StopRecording(bool killFile)
521 {
522  m_endRecordingTime = MythDate::current().addDays(-2);
524  m_chanid = 0;
525 
526  if (m_local)
527  {
528  m_tv->StopRecording(killFile);
529  return;
530  }
531 }
532 
539 {
540  if (m_local)
541  {
543  return;
544  }
545  m_endRecordingTime = MythDate::current().addDays(-2);
546 }
547 
554 {
555  if (m_local)
556  return m_tv->IsReallyRecording();
557 
558  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
559  return false;
560 }
561 
570 {
571  if (m_local)
572  return m_tv->GetFramerate();
573 
574  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
575  return -1;
576 }
577 
586 {
587  if (m_local)
588  return m_tv->GetFramesWritten();
589 
590  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
591  return -1;
592 }
593 
601 {
602  if (m_local)
603  return m_tv->GetFilePosition();
604 
605  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
606  return -1;
607 }
608 
615 int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
616 {
617  if (m_local)
618  return m_tv->GetKeyframePosition(desired);
619 
620  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
621  return -1;
622 }
623 
625  int64_t start, int64_t end, frm_pos_map_t &map)
626 {
627  if (!m_local)
628  {
629  LOG(VB_GENERAL, LOG_ERR,
630  "Should be local only query: GetKeyframePositions");
631  return false;
632  }
633 
634  return m_tv->GetKeyframePositions(start, end, map);
635 }
636 
638  int64_t start, int64_t end, frm_pos_map_t &map)
639 {
640  if (!m_local)
641  {
642  LOG(VB_GENERAL, LOG_ERR,
643  "Should be local only query: GetKeyframeDurations");
644  return false;
645  }
646 
647  return m_tv->GetKeyframeDurations(start, end, map);
648 }
649 
656 {
657  if (m_local)
658  m_tv->FrontendReady();
659  else
660  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
661 }
662 
672 {
673  if (m_local)
674  m_tv->CancelNextRecording(cancel);
675  else if (HasSockAndIncrRef())
676  {
677  ReferenceLocker rlocker(m_sock);
679  }
680 }
681 
693 void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
694 {
695  if (m_local)
696  m_tv->SpawnLiveTV(chain, pip, std::move(startchan));
697  else
698  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
699 }
700 
705 {
706  if (m_local)
707  return m_tv->GetChainID();
708 
709  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
710  return "";
711 }
712 
719 {
720  if (m_local)
721  m_tv->StopLiveTV();
722  else
723  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
724 }
725 
733 {
734  if (m_local)
735  m_tv->PauseRecorder();
736  else
737  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
738 }
739 
745 void EncoderLink::SetLiveRecording(int recording)
746 {
747  if (m_local)
748  m_tv->SetLiveRecording(recording);
749  else
750  LOG(VB_GENERAL, LOG_ERR,
751  "Should be local only query: SetLiveRecording");
752 }
753 
757 void EncoderLink::SetNextLiveTVDir(const QString& dir)
758 {
759  if (m_local)
760  m_tv->SetNextLiveTVDir(dir);
761  else if (HasSockAndIncrRef())
762  {
763  ReferenceLocker rlocker(m_sock);
765  }
766 }
767 
774 QString EncoderLink::GetInput(void) const
775 {
776  if (m_local)
777  return m_tv->GetInput();
778 
779  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
780  return QString();
781 }
782 
793 QString EncoderLink::SetInput(QString input)
794 {
795  if (m_local)
796  return m_tv->SetInput(std::move(input));
797 
798  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
799  return QString();
800 }
801 
807 void EncoderLink::ToggleChannelFavorite(QString changroup)
808 {
809  if (m_local)
810  m_tv->ToggleChannelFavorite(std::move(changroup));
811  else
812  LOG(VB_GENERAL, LOG_ERR,
813  "Should be local only query: ToggleChannelFavorite");
814 }
815 
823 {
824  if (m_local)
825  m_tv->ChangeChannel(channeldirection);
826  else
827  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
828 }
829 
837 void EncoderLink::SetChannel(const QString &name)
838 {
839  if (m_local)
840  m_tv->SetChannel(name);
841  else
842  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
843 }
844 
854 {
855  if (!m_local)
856  {
857  LOG(VB_GENERAL, LOG_ERR,
858  "Should be local only query: GetPictureAttribute");
859  return -1;
860  }
861 
862  return m_tv->GetPictureAttribute(attr);
863 }
864 
874  PictureAttribute attr,
875  bool direction)
876 {
877  if (!m_local)
878  {
879  LOG(VB_GENERAL, LOG_ERR,
880  "Should be local only query: ChangePictureAttribute");
881  return -1;
882  }
883 
884  return m_tv->ChangePictureAttribute(type, attr, direction);
885 }
886 
896 bool EncoderLink::CheckChannel(const QString &name)
897 {
898  if (m_local)
899  return m_tv->CheckChannel(name);
900 
901  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
902  return false;
903 }
904 
914 bool EncoderLink::ShouldSwitchToAnotherInput(const QString &channelid)
915 {
916  if (m_local)
917  return m_tv->ShouldSwitchToAnotherInput(channelid);
918 
919  LOG(VB_GENERAL, LOG_ERR,
920  "Should be local only query: ShouldSwitchToAnotherInput");
921  return false;
922 }
923 
932  const QString &prefix,
933  uint &complete_valid_channel_on_rec,
934  bool &is_extra_char_useful,
935  QString &needed_spacer)
936 {
937  if (m_local)
938  {
939  return m_tv->CheckChannelPrefix(
940  prefix, complete_valid_channel_on_rec,
941  is_extra_char_useful, needed_spacer);
942  }
943 
944  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
945  complete_valid_channel_on_rec = 0;
946  is_extra_char_useful = false;
947  needed_spacer = "";
948  return false;
949 }
950 
957  QString &title, QString &subtitle,
958  QString &desc, QString &category,
959  QString &starttime, QString &endtime,
960  QString &callsign, QString &iconpath,
961  QString &channelname, uint &_chanid,
962  QString &seriesid, QString &programid)
963 {
964  if (m_local)
965  {
966  m_tv->GetNextProgram(direction,
967  title, subtitle, desc, category, starttime,
968  endtime, callsign, iconpath, channelname,
969  _chanid, seriesid, programid);
970  }
971  else
972  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
973 }
974 
975 bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
976  QString &callsign, QString &channum,
977  QString &channame, QString &xmltv) const
978 {
979  if (!m_local)
980  {
981  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
982  return false;
983  }
984 
985  return m_tv->GetChannelInfo(chanid, sourceid,
986  callsign, channum, channame, xmltv);
987 }
988 
989 bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
990  QString oldchannum,
991  QString callsign, QString channum,
992  QString channame, QString xmltv)
993 {
994  if (!m_local)
995  {
996  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
997  return false;
998  }
999 
1000  return m_tv->SetChannelInfo(chanid, sourceid, std::move(oldchannum),
1001  std::move(callsign), std::move(channum),
1002  std::move(channame), std::move(xmltv));
1003 }
1004 
1006 {
1007  if (m_local)
1008  {
1009  LOG(VB_GENERAL, LOG_ERR, LOC + "Called on local recorder");
1010  return false;
1011  }
1012 
1013  bool retval = m_sock->AddChildInput(childid);
1014  return retval;
1015 }
1016 
1017 /* vim: set expandtab tabstop=4 shiftwidth=4: */
bool GetKeyframeDurations(int64_t start, int64_t end, frm_pos_map_t &) const
Definition: tv_rec.cpp:2618
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:54
RecStatus::Type GetRecordingStatus(int capturecardnum)
void StopRecording(bool killFile=false)
Changes from a recording state to kState_None.
Definition: tv_rec.cpp:702
bool GoToSleep(void)
Tells a slave to go to sleep.
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
int ChangePictureAttribute(PictureAdjustType type, PictureAttribute attr, bool direction)
Returns current value [0,100] if it succeeds, -1 otherwise.
Definition: tv_rec.cpp:3006
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
Definition: tv.h:28
long long GetFramesWritten(void)
Returns number of frames written to disk by recorder.
Definition: tv_rec.cpp:2559
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
QString GetInput(void) const
Returns current input.
Definition: tv_rec.cpp:3022
long long GetMaxBitrate(int capturecardnum)
ProgramInfo * GetRecording(uint cardid)
Returns the ProgramInfo being used by any current recording.
bool AddChildInput(uint childid)
Tells a slave to add a child input.
void SetPathname(const QString &) const
void RecordPending(const ProgramInfo *rcinfo, int secsleft, bool hasLater)
Tells TVRec "rcinfo" is the next pending recording.
Definition: tv_rec.cpp:271
bool ShouldSwitchToAnotherInput(const QString &chanid)
Checks if named channel exists on current tuner, or another tuner.
Definition: tv_rec.cpp:2176
bool IsBusy(int capturecardnum, InputInfo *busy_input=nullptr, int time_buffer=5)
bool GetKeyframePositions(int64_t start, int64_t end, frm_pos_map_t &) const
Returns byte position in RingBuffer of a keyframes according to recorder.
Definition: tv_rec.cpp:2607
bool IsBusy(InputInfo *busy_input=nullptr, int time_buffer=5) const
Returns true if the recorder is busy, or will be within the next time_buffer seconds.
Definition: tv_rec.cpp:2476
void GetDiskSpace(QStringList &o_strlist)
Appends host's dir's total and used space in kilobytes.
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
QString SetInput(QString input)
Changes to the specified input.
Definition: tv_rec.cpp:3047
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
This decrements the reference on destruction.
void ChangeChannel(ChannelChangeDirection dir)
Changes to a channel in the 'dir' channel change direction.
Definition: tv_rec.h:214
void FrontendReady(void)
Tells TVRec that the frontend's TV class is ready for messages.
Definition: tv_rec.h:172
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:50
int GetEncoderState(int capturecardnum)
Returns the maximum bits per second the recorder can produce.
bool CheckChannel(const QString &name) const
Checks if named channel exists on current tuner.
Definition: tv_rec.cpp:2264
long long GetMaxBitrate(void) const
Returns the maximum bits per second this recorder can produce.
Definition: tv_rec.cpp:2634
enum BrowseDirections BrowseDirection
Used to request ProgramInfo for channel browsing.
void ToggleChannelFavorite(const QString &)
Toggles whether the current channel should be on our favorites list.
Definition: tv_rec.cpp:2938
Holds information on recordings and videos.
Definition: programinfo.h:66
void FinishRecording(void)
Tells TVRec to finish the current recording as soon as possible.
Definition: tv_rec.h:169
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
virtual int IncrRef(void)
Increments reference count.
QString GetChainID(void)
Get the chainid of the livetv instance.
Definition: tv_rec.cpp:2684
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:150
void SpawnLiveTV(LiveTVChain *newchain, bool pip, QString startchan)
Tells TVRec to spawn a "Live TV" recorder.
Definition: tv_rec.cpp:2654
long long GetFilePosition(void)
Returns total number of bytes written by RingBuffer.
Definition: tv_rec.cpp:2574
ProgramInfo * GetRecording(void)
Allocates and returns a ProgramInfo for the current recording.
Definition: tv_rec.cpp:239
RecStatus::Type StartRecording(int capturecardnum, ProgramInfo *pginfo)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
int SetSignalMonitoringRate(int rate, int notifyFrontend=1)
Sets the signal monitoring rate.
Definition: tv_rec.cpp:2122
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
bool IsLocal(void) const
Definition: programinfo.h:343
float GetFramerate(void)
Returns recordering frame rate from the recorder.
Definition: tv_rec.cpp:2544
A slave is awake when it is connected to the master.
Definition: tv.h:100
bool CheckFile(ProgramInfo *pginfo)
SleepStatus
SleepStatus is an enumeration of the awake/sleep status of a slave.
Definition: tv.h:97
void PauseRecorder(void)
Tells "recorder" to pause, used for channel and input changes.
Definition: tv_rec.cpp:2910
PictureAttribute
Definition: videoouttypes.h:89
void CancelNextRecording(bool cancel)
Tells TVRec to cancel the upcoming recording.
Definition: tv_rec.cpp:347
const char * name
Definition: ParseText.cpp:328
void RecordPending(int capturecardnum, const ProgramInfo *pginfo, int secsleft, bool hasLater)
int64_t GetKeyframePosition(uint64_t desired) const
Returns byte position in RingBuffer of a keyframe according to recorder.
Definition: tv_rec.cpp:2590
TVState GetState(void) const
Returns the TVState of the recorder.
Definition: tv_rec.cpp:225
A slave is considered asleep when it is not awake and not undefined.
Definition: tv.h:104
void CancelNextRecording(int capturecardnum, bool cancel)
uint GetFlags(void) const
Definition: tv_rec.h:252
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
bool IsSameRecording(const ProgramInfo &other) const
Definition: programinfo.h:324
int GetPictureAttribute(PictureAttribute attr)
Definition: tv_rec.cpp:2988
PictureAdjustType
Definition: tv.h:120
void SetNextLiveTVDir(QString dir)
Definition: tv_rec.cpp:4517
This is a placeholder state which we never actually enter, but is returned by GetState() when we are ...
Definition: tv.h:89
bool SetChannelInfo(uint chanid, uint sourceid, const QString &oldchannum, const QString &callsign, const QString &channum, const QString &channame, const QString &xmltvid)
Definition: tv_rec.cpp:3312
RecStatus::Type GetRecordingStatus(void) const
Definition: tv_rec.cpp:666
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:364
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath)
A slave's sleep status is undefined when it has never connected to the master backend or is not able ...
Definition: tv.h:117
void GetNextProgram(BrowseDirection direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channum, uint &chanid, QString &seriesid, QString &programid)
Definition: tv_rec.cpp:3148
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:396
bool EncoderIsRecording(int capturecardnum, const ProgramInfo *pginfo)
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:404
RecStatus::Type StartRecording(ProgramInfo *pginfo)
Tells TVRec to Start recording the program "rcinfo" as soon as possible.
Definition: tv_rec.cpp:397
bool GetChannelInfo(uint &chanid, uint &sourceid, QString &callsign, QString &channum, QString &channame, QString &xmltvid) const
Definition: tv_rec.cpp:3271
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
int SetSignalMonitoringRate(int capturecardnum, int rate, int notifyFrontend)
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:31
void SetLiveRecording(int recording)
Tells the Scheduler about changes to the recording status of the LiveTV recording.
Definition: tv_rec.cpp:2815
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: tv_rec.cpp:2863
void SetChannel(const QString &name, uint requestType=kFlagDetect)
Changes to a named channel on the current tuner.
Definition: tv_rec.cpp:3073
bool IsReallyRecording(void)
Returns true if frontend can consider the recorder started.
Definition: tv_rec.cpp:2465
bool CheckChannelPrefix(const QString &, uint &, bool &, QString &)
Checks a prefix against the channels in the DB.
Definition: tv_rec.cpp:2310
void SetNextLiveTVDir(int capturecardnum, const QString &dir)