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  {
449  LOG(VB_GENERAL, LOG_ERR,
450  QString("Wanted to start recording on recorder %1,\n\t\t\t"
451  "but the backend is not there anymore\n")
452  .arg(m_inputid));
453  }
454 
455  if (retval != RecStatus::Recording &&
456  retval != RecStatus::Tuning &&
457  retval != RecStatus::Failing)
458  {
459  m_endRecordingTime = MythDate::current().addDays(-2);
461  m_chanid = 0;
462  }
463 
464  return retval;
465 }
466 
468 {
470 
471  if (m_local)
472  retval = m_tv->GetRecordingStatus();
473  else if (HasSockAndIncrRef())
474  {
475  ReferenceLocker rlocker(m_sock);
477  }
478  else
479  {
480  LOG(VB_GENERAL, LOG_ERR,
481  QString("Wanted to get status on recorder %1,\n\t\t\t"
482  "but the backend is not there anymore\n")
483  .arg(m_inputid));
484  }
485 
486  if (retval != RecStatus::Recording &&
487  retval != RecStatus::Tuning &&
488  retval != RecStatus::Failing)
489  {
490  m_endRecordingTime = MythDate::current().addDays(-2);
492  m_chanid = 0;
493  }
494 
495  return retval;
496 }
497 
505 {
506  ProgramInfo *info = nullptr;
507 
508  if (m_local)
509  info = m_tv->GetRecording();
510  else if (HasSockAndIncrRef())
511  {
512  ReferenceLocker rlocker(m_sock);
513  info = m_sock->GetRecording(m_inputid);
514  }
515 
516  return info;
517 }
518 
524 void EncoderLink::StopRecording(bool killFile)
525 {
526  m_endRecordingTime = MythDate::current().addDays(-2);
528  m_chanid = 0;
529 
530  if (m_local)
531  {
532  m_tv->StopRecording(killFile);
533  return;
534  }
535 }
536 
543 {
544  if (m_local)
545  {
547  return;
548  }
549  m_endRecordingTime = MythDate::current().addDays(-2);
550 }
551 
558 {
559  if (m_local)
560  return m_tv->IsReallyRecording();
561 
562  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
563  return false;
564 }
565 
574 {
575  if (m_local)
576  return m_tv->GetFramerate();
577 
578  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
579  return -1;
580 }
581 
590 {
591  if (m_local)
592  return m_tv->GetFramesWritten();
593 
594  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
595  return -1;
596 }
597 
605 {
606  if (m_local)
607  return m_tv->GetFilePosition();
608 
609  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
610  return -1;
611 }
612 
619 int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
620 {
621  if (m_local)
622  return m_tv->GetKeyframePosition(desired);
623 
624  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
625  return -1;
626 }
627 
629  int64_t start, int64_t end, frm_pos_map_t &map)
630 {
631  if (!m_local)
632  {
633  LOG(VB_GENERAL, LOG_ERR,
634  "Should be local only query: GetKeyframePositions");
635  return false;
636  }
637 
638  return m_tv->GetKeyframePositions(start, end, map);
639 }
640 
642  int64_t start, int64_t end, frm_pos_map_t &map)
643 {
644  if (!m_local)
645  {
646  LOG(VB_GENERAL, LOG_ERR,
647  "Should be local only query: GetKeyframeDurations");
648  return false;
649  }
650 
651  return m_tv->GetKeyframeDurations(start, end, map);
652 }
653 
660 {
661  if (m_local)
662  m_tv->FrontendReady();
663  else
664  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
665 }
666 
676 {
677  if (m_local)
678  m_tv->CancelNextRecording(cancel);
679  else if (HasSockAndIncrRef())
680  {
681  ReferenceLocker rlocker(m_sock);
683  }
684 }
685 
697 void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
698 {
699  if (m_local)
700  m_tv->SpawnLiveTV(chain, pip, std::move(startchan));
701  else
702  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
703 }
704 
709 {
710  if (m_local)
711  return m_tv->GetChainID();
712 
713  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
714  return "";
715 }
716 
723 {
724  if (m_local)
725  m_tv->StopLiveTV();
726  else
727  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
728 }
729 
737 {
738  if (m_local)
739  m_tv->PauseRecorder();
740  else
741  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
742 }
743 
749 void EncoderLink::SetLiveRecording(int recording)
750 {
751  if (m_local)
752  m_tv->SetLiveRecording(recording);
753  else
754  LOG(VB_GENERAL, LOG_ERR,
755  "Should be local only query: SetLiveRecording");
756 }
757 
761 void EncoderLink::SetNextLiveTVDir(const QString& dir)
762 {
763  if (m_local)
764  m_tv->SetNextLiveTVDir(dir);
765  else if (HasSockAndIncrRef())
766  {
767  ReferenceLocker rlocker(m_sock);
769  }
770 }
771 
778 QString EncoderLink::GetInput(void) const
779 {
780  if (m_local)
781  return m_tv->GetInput();
782 
783  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
784  return QString();
785 }
786 
797 QString EncoderLink::SetInput(QString input)
798 {
799  if (m_local)
800  return m_tv->SetInput(std::move(input));
801 
802  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
803  return QString();
804 }
805 
811 void EncoderLink::ToggleChannelFavorite(const QString& changroup)
812 {
813  if (m_local)
814  m_tv->ToggleChannelFavorite(changroup);
815  else
816  LOG(VB_GENERAL, LOG_ERR,
817  "Should be local only query: ToggleChannelFavorite");
818 }
819 
827 {
828  if (m_local)
829  m_tv->ChangeChannel(channeldirection);
830  else
831  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
832 }
833 
841 void EncoderLink::SetChannel(const QString &name)
842 {
843  if (m_local)
844  m_tv->SetChannel(name);
845  else
846  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
847 }
848 
858 {
859  if (!m_local)
860  {
861  LOG(VB_GENERAL, LOG_ERR,
862  "Should be local only query: GetPictureAttribute");
863  return -1;
864  }
865 
866  return m_tv->GetPictureAttribute(attr);
867 }
868 
878  PictureAttribute attr,
879  bool direction)
880 {
881  if (!m_local)
882  {
883  LOG(VB_GENERAL, LOG_ERR,
884  "Should be local only query: ChangePictureAttribute");
885  return -1;
886  }
887 
888  return m_tv->ChangePictureAttribute(type, attr, direction);
889 }
890 
900 bool EncoderLink::CheckChannel(const QString &name)
901 {
902  if (m_local)
903  return m_tv->CheckChannel(name);
904 
905  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
906  return false;
907 }
908 
918 bool EncoderLink::ShouldSwitchToAnotherInput(const QString &channelid)
919 {
920  if (m_local)
921  return m_tv->ShouldSwitchToAnotherInput(channelid);
922 
923  LOG(VB_GENERAL, LOG_ERR,
924  "Should be local only query: ShouldSwitchToAnotherInput");
925  return false;
926 }
927 
936  const QString &prefix,
937  uint &complete_valid_channel_on_rec,
938  bool &is_extra_char_useful,
939  QString &needed_spacer)
940 {
941  if (m_local)
942  {
943  return m_tv->CheckChannelPrefix(
944  prefix, complete_valid_channel_on_rec,
945  is_extra_char_useful, needed_spacer);
946  }
947 
948  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
949  complete_valid_channel_on_rec = 0;
950  is_extra_char_useful = false;
951  needed_spacer = "";
952  return false;
953 }
954 
961  QString &title, QString &subtitle,
962  QString &desc, QString &category,
963  QString &starttime, QString &endtime,
964  QString &callsign, QString &iconpath,
965  QString &channelname, uint &_chanid,
966  QString &seriesid, QString &programid)
967 {
968  if (m_local)
969  {
970  m_tv->GetNextProgram(direction,
971  title, subtitle, desc, category, starttime,
972  endtime, callsign, iconpath, channelname,
973  _chanid, seriesid, programid);
974  }
975  else
976  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
977 }
978 
979 bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
980  QString &callsign, QString &channum,
981  QString &channame, QString &xmltv) const
982 {
983  if (!m_local)
984  {
985  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
986  return false;
987  }
988 
989  return m_tv->GetChannelInfo(chanid, sourceid,
990  callsign, channum, channame, xmltv);
991 }
992 
993 bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
994  const QString& oldchannum,
995  const QString& callsign, const QString& channum,
996  const QString& channame, const QString& xmltv)
997 {
998  if (!m_local)
999  {
1000  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
1001  return false;
1002  }
1003 
1004  return m_tv->SetChannelInfo(chanid, sourceid, oldchannum,
1005  callsign, channum,
1006  channame, xmltv);
1007 }
1008 
1010 {
1011  if (m_local)
1012  {
1013  LOG(VB_GENERAL, LOG_ERR, LOC + "Called on local recorder");
1014  return false;
1015  }
1016 
1017  bool retval = m_sock->AddChildInput(childid);
1018  return retval;
1019 }
1020 
1021 /* vim: set expandtab tabstop=4 shiftwidth=4: */
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:705
bool GetKeyframeDurations(int64_t start, int64_t end, frm_pos_map_t &map) const
Definition: tv_rec.cpp:2623
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:3018
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
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:2564
QString GetInput(void) const
Returns current input.
Definition: tv_rec.cpp:3034
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 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:2177
bool IsBusy(int capturecardnum, InputInfo *busy_input=nullptr, int time_buffer=5)
void ToggleChannelFavorite(const QString &changroupname)
Toggles whether the current channel should be on our favorites list.
Definition: tv_rec.cpp:2951
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:2480
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:3059
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
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:206
void FrontendReady(void)
Tells TVRec that the frontend's TV class is ready for messages.
Definition: tv_rec.h:164
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:2267
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
long long GetMaxBitrate(void) const
Returns the maximum bits per second this recorder can produce.
Definition: tv_rec.cpp:2639
Holds information on recordings and videos.
Definition: programinfo.h:67
void FinishRecording(void)
Tells TVRec to finish the current recording as soon as possible.
Definition: tv_rec.h:161
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:2697
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
void SpawnLiveTV(LiveTVChain *newchain, bool pip, QString startchan)
Tells TVRec to spawn a "Live TV" recorder.
Definition: tv_rec.cpp:2667
long long GetFilePosition(void)
Returns total number of bytes written by RingBuffer.
Definition: tv_rec.cpp:2579
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:2123
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
bool IsLocal(void) const
Definition: programinfo.h:345
float GetFramerate(void)
Returns recordering frame rate from the recorder.
Definition: tv_rec.cpp:2549
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:2923
PictureAttribute
Definition: videoouttypes.h:87
unsigned int uint
Definition: compat.h:140
void CancelNextRecording(bool cancel)
Tells TVRec to cancel the upcoming recording.
Definition: tv_rec.cpp:347
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:2595
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)
BrowseDirection
Used to request ProgramInfo for channel browsing.
Definition: tv.h:37
uint GetFlags(void) const
Definition: tv_rec.h:245
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
bool IsSameRecording(const ProgramInfo &other) const
Definition: programinfo.h:326
int GetPictureAttribute(PictureAttribute attr)
Definition: tv_rec.cpp:3000
PictureAdjustType
Definition: tv.h:120
bool GetKeyframePositions(int64_t start, int64_t end, frm_pos_map_t &map) const
Returns byte position in RingBuffer of a keyframes according to recorder.
Definition: tv_rec.cpp:2612
void SetNextLiveTVDir(QString dir)
Definition: tv_rec.cpp:4532
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:3327
RecStatus::Type GetRecordingStatus(void) const
Definition: tv_rec.cpp:669
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:366
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:3160
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:398
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:406
bool CheckChannelPrefix(const QString &prefix, uint &complete_valid_channel_on_rec, bool &is_extra_char_useful, QString &needed_spacer)
Checks a prefix against the channels in the DB.
Definition: tv_rec.cpp:2313
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:3286
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:2828
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: tv_rec.cpp:2876
void SetChannel(const QString &name, uint requestType=kFlagDetect)
Changes to a named channel on the current tuner.
Definition: tv_rec.cpp:3085
bool IsReallyRecording(void)
Returns true if frontend can consider the recorder started.
Definition: tv_rec.cpp:2469
void SetPathname(const QString &pn)
void SetNextLiveTVDir(int capturecardnum, const QString &dir)