CPPMyth
Library to interoperate with MythTV server
mythprotorecorder.h
1 /*
2  * Copyright (C) 2014 Jean-Luc Barriere
3  *
4  * This Program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  * This Program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; see the file COPYING. If not, write to
16  * the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  * http://www.gnu.org/copyleft/gpl.html
19  *
20  */
21 
22 #ifndef MYTHPROTORECORDER_H
23 #define MYTHPROTORECORDER_H
24 
25 #include "mythprotoplayback.h"
26 
27 namespace Myth
28 {
29 
30  class ProtoRecorder;
31  typedef MYTH_SHARED_PTR<ProtoRecorder> ProtoRecorderPtr;
32 
34  {
35  public:
36  ProtoRecorder(int num, const std::string& server, unsigned port);
37  virtual ~ProtoRecorder();
38 
39  int GetNum() const;
40  bool IsPlaying() const;
41  bool IsTunable(const Channel& channel);
42  void DoneRecordingCallback();
43 
44  bool SpawnLiveTV(const std::string& chainid, const std::string& channum)
45  {
46  return SpawnLiveTV75(chainid, channum);
47  }
48  bool StopLiveTV()
49  {
50  return StopLiveTV75();
51  }
52  bool CheckChannel(const std::string& channum)
53  {
54  return CheckChannel75(channum);
55  }
56  ProgramPtr GetCurrentRecording()
57  {
58  return GetCurrentRecording75();
59  }
60  int64_t GetFilePosition()
61  {
62  return GetFilePosition75();
63  }
64  CardInputListPtr GetFreeInputs()
65  {
66  if (m_protoVersion >= 91) return GetFreeInputs91();
67  if (m_protoVersion >= 90) return GetFreeInputs90();
68  if (m_protoVersion >= 89) return GetFreeInputs89();
69  if (m_protoVersion >= 87) return GetFreeInputs87();
70  if (m_protoVersion >= 81) return GetFreeInputs81();
71  if (m_protoVersion >= 79) return GetFreeInputs79();
72  return GetFreeInputs75();
73  }
74  bool IsLiveRecording();
75  bool SetLiveRecording(bool keep)
76  {
77  bool ret = SetLiveRecording75(keep);
78  if (keep && ret)
79  m_liveRecording = keep; // Hold status for this showing
80  return ret;
81  }
82  bool FinishRecording()
83  {
84  return FinishRecording75();
85  }
86 
87  private:
88  int m_num;
89  volatile bool m_playing;
90  volatile bool m_liveRecording;
91 
92  bool SpawnLiveTV75(const std::string& chainid, const std::string& channum);
93  bool StopLiveTV75();
94  bool CheckChannel75(const std::string& channum);
95  ProgramPtr GetCurrentRecording75();
96  int64_t GetFilePosition75();
97  CardInputListPtr GetFreeInputs75();
98  CardInputListPtr GetFreeInputs79();
99  CardInputListPtr GetFreeInputs81();
100  CardInputListPtr GetFreeInputs87();
101  CardInputListPtr GetFreeInputs89();
102  CardInputListPtr GetFreeInputs90();
103  CardInputListPtr GetFreeInputs91();
104  bool SetLiveRecording75(bool keep);
105  bool FinishRecording75();
106  };
107 
108 }
109 
110 #endif /* MYTHPROTORECORDER_H */
This is the main namespace that encloses all public classes.
Definition: mythcontrol.h:29