MythTV  master
libs/libmythprotoserver/sockethandler/filetransfer.h
Go to the documentation of this file.
1 #ifndef FILETRANSFER_H_
2 #define FILETRANSFER_H_
3 
4 // C++ headers
5 #include <cstdint>
6 #include <vector>
7 
8 #include <QMutex>
9 #include <QString>
10 #include <QWaitCondition>
11 
12 #include "libmythbase/mythsocket.h"
14 
15 class ProgramInfo;
16 class MythMediaBuffer;
17 
19 {
20  public:
21  FileTransfer(QString &filename, MythSocket *remote,
22  MythSocketManager *parent,
23  bool usereadahead, std::chrono::milliseconds timeout);
24  FileTransfer(QString &filename, MythSocket *remote,
25  MythSocketManager *parent, bool write);
26 
27  bool isOpen(void);
28  bool ReOpen(const QString& newFilename = "");
29 
30  void Stop(void);
31 
32  void Pause(void);
33  void Unpause(void);
34  int RequestBlock(int size);
35  int WriteBlock(int size);
36 
37  long long Seek(long long curpos, long long pos, int whence);
38 
39  uint64_t GetFileSize(void);
40  QString GetFileName(void);
41 
42  void SetTimeout(bool fast);
43 
44  private:
45  ~FileTransfer() override;
46 
47  volatile bool m_readthreadlive {true};
48  bool m_readsLocked {false};
49  QWaitCondition m_readsUnlockedCond;
50 
51  ProgramInfo *m_pginfo {nullptr};
53  bool m_ateof {false};
54 
55  std::vector<char> m_requestBuffer;
56 
57  QMutex m_lock;
58 
59  bool m_writemode {false};
60 };
61 
62 #endif
FileTransfer::Pause
void Pause(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:89
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
FileTransfer::Stop
void Stop(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:71
FileTransfer::m_lock
QMutex m_lock
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:57
FileTransfer::m_readthreadlive
volatile bool m_readthreadlive
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:47
mythburn.write
def write(text, progress=True)
Definition: mythburn.py:308
FileTransfer::GetFileName
QString GetFileName(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:255
MythMediaBuffer
Definition: mythmediabuffer.h:50
FileTransfer::~FileTransfer
~FileTransfer() override
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:38
FileTransfer::WriteBlock
int WriteBlock(int size)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:154
FileTransfer
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:18
MythSocketManager
Definition: mythsocketmanager.h:21
FileTransfer::m_readsLocked
bool m_readsLocked
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:48
MythSocket
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:25
FileTransfer::m_rbuffer
MythMediaBuffer * m_rbuffer
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:52
FileTransfer::m_readsUnlockedCond
QWaitCondition m_readsUnlockedCond
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:49
sockethandler.h
FileTransfer::Seek
long long Seek(long long curpos, long long pos, int whence)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:215
FileTransfer::m_writemode
bool m_writemode
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:59
FileTransfer::ReOpen
bool ReOpen(const QString &newFilename="")
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:60
FileTransfer::m_pginfo
ProgramInfo * m_pginfo
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:51
FileTransfer::Unpause
void Unpause(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:100
FileTransfer::RequestBlock
int RequestBlock(int size)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:114
FileTransfer::FileTransfer
FileTransfer(QString &filename, MythSocket *remote, MythSocketManager *parent, bool usereadahead, std::chrono::milliseconds timeout)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:12
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
FileTransfer::GetFileSize
uint64_t GetFileSize(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:247
SocketHandler
Definition: sockethandler.h:16
FileTransfer::m_requestBuffer
std::vector< char > m_requestBuffer
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:55
FileTransfer::SetTimeout
void SetTimeout(bool fast)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:263
build_compdb.filename
filename
Definition: build_compdb.py:21
FileTransfer::m_ateof
bool m_ateof
Definition: libs/libmythprotoserver/sockethandler/filetransfer.h:53
mythsocket.h
FileTransfer::isOpen
bool isOpen(void)
Definition: libs/libmythprotoserver/sockethandler/filetransfer.cpp:55