MythTV master
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
14
15class ProgramInfo;
16class 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
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
bool m_readsLocked
Definition: filetransfer.h:48
int WriteBlock(int size)
FileTransfer(QString &filename, MythSocket *remote, MythSocketManager *parent, bool usereadahead, std::chrono::milliseconds timeout)
void Pause(void)
void Stop(void)
~FileTransfer() override
long long Seek(long long curpos, long long pos, int whence)
QString GetFileName(void)
MythMediaBuffer * m_rbuffer
Definition: filetransfer.h:52
bool ReOpen(const QString &newFilename="")
QWaitCondition m_readsUnlockedCond
Definition: filetransfer.h:49
bool isOpen(void)
std::vector< char > m_requestBuffer
Definition: filetransfer.h:55
uint64_t GetFileSize(void)
void SetTimeout(bool fast)
void Unpause(void)
volatile bool m_readthreadlive
Definition: filetransfer.h:47
int RequestBlock(int size)
ProgramInfo * m_pginfo
Definition: filetransfer.h:51
bool m_writemode
Definition: filetransfer.h:59
QMutex m_lock
Definition: filetransfer.h:57
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:26
Holds information on recordings and videos.
Definition: programinfo.h:68
def write(text, progress=True)
Definition: mythburn.py:307