-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcstreamloader.h
More file actions
84 lines (74 loc) · 2.34 KB
/
cstreamloader.h
File metadata and controls
84 lines (74 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*=============================================================================\
| $HeadURL$
|
| Author: Jo2003
|
| last changed by: $Author$
|
| Begin: 4.12.2010 / 18:55
|
| $Id$
|
\=============================================================================*/
#ifndef __20101214185500_CSTREAMLOADER_H
#define __20101214185500_CSTREAMLOADER_H
#include <QHttp>
#include <QString>
#include <QMessageBox>
#include <QTemporaryFile>
#include <QtNetwork>
#include <QFile>
#include <QTimer>
#include <QTime>
#include <QUrl>
#include "defdef.h"
/*=============================================================================\
| Class: CStreamLoader
|
| Author: Jo2003
|
| Begin: 14.12.2010 / 18:55
|
| Description: a class to download streams from streamserver
|
\=============================================================================*/
class CStreamLoader : public QHttp
{
Q_OBJECT
public:
CStreamLoader();
virtual ~CStreamLoader();
private:
QString sHost;
QFile fStream;
int iReq;
QTimer tFileCheck;
QTime m_tmDwn;
int iCache;
bool bUseTimerRec;
bool m_bSpeedTest;
QTemporaryFile *m_pTmpFile;
int m_iSize;
public slots:
void downloadStream (const QString &sUrl, const QString &sFileName, int iCacheTime, bool bTimerRec = false);
void speedTest (const QString &sUrl, int iSize);
void endSpeedTest();
void stopDownload (int id);
private slots:
void handleEndRequest (int id, bool err);
void slotStreamDataAvailable();
signals:
void sigStreamRequested (int iReqId);
void sigStreamDownload (int iReqId, QString sFileName);
void sigStreamDwnTimer (int iReqId, QString sFileName);
void sigError (QString str);
void sigBufferPercent (int percent);
void sigDwnSpeed (int ms, int bytes);
void sigSpeedTestEnd ();
};
#endif // __20101214185500_CSTREAMLOADER_H
/*=============================================================================\
| History:
| ---------------------------------------------------------------------------
| 14.12.2010: - a download class for streams sent from kartina.tv
\=============================================================================*/