CPPMyth
Library to interoperate with MythTV server
mythfileplayback.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 MYTHFILEPLAYBACK_H
23 #define MYTHFILEPLAYBACK_H
24 
25 #include "proto/mythprotoplayback.h"
26 #include "proto/mythprototransfer.h"
27 #include "mythstream.h"
28 
29 namespace Myth
30 {
31 
32  class FilePlayback : private ProtoPlayback, public Stream
33  {
34  public:
35  FilePlayback(const std::string& server, unsigned port);
36  ~FilePlayback();
37 
38  bool Open();
39  void Close();
40  bool IsOpen() { return ProtoPlayback::IsOpen(); }
41  bool OpenTransfer(const std::string& pathname, const std::string& sgname);
42  void CloseTransfer();
43  bool TransferIsOpen();
44 
45  // Implement Stream
46  int64_t GetSize() const;
47  int Read(void *buffer, unsigned n);
48  int64_t Seek(int64_t offset, WHENCE_t whence);
49  int64_t GetPosition() const;
50 
51  private:
52  ProtoTransferPtr m_transfer;
53  };
54 
55 }
56 
57 #endif /* MYTHFILEPLAYBACK_H */
This is the main namespace that encloses all public classes.
Definition: mythcontrol.h:29