-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathckartinaads.h
61 lines (51 loc) · 1.28 KB
/
ckartinaads.h
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
#ifndef CKARTINAADS_H
#define CKARTINAADS_H
#include <QTimer>
#include <QNetworkAccessManager>
#include <QMap>
#include "cplayer.h"
namespace ads
{
///
/// \brief The SChanAds struct
///
struct SChanAds
{
int mShowTime; ///< show ad for x seconds
int mStartPause; ///< show ad x seconds after start / pause
int mPause; ///< pause between ads
};
typedef QMap<int, SChanAds> AddChanMap;
///
/// \brief actions for Ads
///
enum EActions
{
ADS_POLICY,
ADS_GET ,
ADS_UNKNOWN
};
}
//------------------------------------------------------------------------------
//! @brief Class for kartina ads.
//------------------------------------------------------------------------------
class CKartinaAds : public QNetworkAccessManager
{
Q_OBJECT
public:
CKartinaAds(QObject *parent = 0);
virtual ~CKartinaAds();
void setPlayer(CPlayer *pPlay);
void setLogin(const QString& s);
public slots:
void channelChanged(int cid);
private:
CPlayer* mpPlayer;
QTimer mTick;
int mCacheTime;
QString mLogin;
ads::AddChanMap mAddChanMap;
int mCurrentCid;
int mAdCounter;
};
#endif // CKARTINAADS_H