pans
2016-12-15 87e3ee273b2f84081ac45926be9d8e5be3166eaa
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 * Copyright(C) 2010,Custom Co., Ltd 
 *    FileName: realplay.h
 * Description: ÊµÊ±Ô¤ÀÀ
 *     Version: 1.0
 *      Author: wanggongpu
 * Create Date: 2009-11,12
 * Modification History£º
 *    2010-6-25 panyadong ¸ø²¥·Å´°¿Ú¼Ó±ß¿ò
 */
#ifndef REALPLAY_H
#define REALPLAY_H
 
#include <QtGui/QWidget>
#include <QModelIndex>
#include "ui_realplay.h"
#include <QFrame>
#include <QMenu>
#include <QList>
 
#include "channeldata.h"
#include "devicedata.h"
#include "DemoPublic.h"
#include "ptzcruise.h"
#include "ptzpreset.h"
#include "common.h"
#include "logtable.h"
#include "treemodel.h"
#include "realplay.h"
#include "FramePlayWnd.h"
 
//ÒÔºóͨ¹ý²ÎÊýÅäÖÃÄ£¿é¶Ôʵʱ¼Ïñ´æ´¢Â·¾¶½øÐÐÉèÖã¬ÕâÀï×÷ΪĬÈÏ
#define SAVE_REALDATA_FILEPATH "./REALPLAY_DOWNLOAD_FILE/"
 
//Max num of windows used to preview.
#define REALPLAY_MAX_NUM 36
  
class RealPlay : public QWidget
{
    Q_OBJECT
 
public:
    friend class QtClientDemo;
    
    RealPlay(TreeModel**  model, const QModelIndex * index, QList<DeviceData>* tree,
        int* userid, NET_DVR_DEVICEINFO_V30* devinfo, int* channelnum,  
        int* channelmode, LogTable * table, QWidget *parent = 0);
    ~RealPlay();
    void DrawAreaInit();
    
    void startRealPlay(int index);
    void stopRealPlay();
    int  realPlayEncapseInterface(int devicerow, int channelrow, NET_DVR_CLIENTINFO *clientinfo);
    void stopRealPlayEncapseInterface();
 
 
    void setVideoEffect();
    void getVideoEffect();
    void ptzControlRealPlay(int command,int flag);
 
protected:
    void resizeEvent(QResizeEvent *event);
 
private slots:
    //(combox changed)
    void comboWinNumChanged(int iWindowNumIndex);
 
    //click play windows.
    void OnSingleClickPlayWindow();
 
    void RealPlayContextResponse(const QPoint &pos);
    void RealPlayFullFrameRep();
    void RealPlayFullScreenRep();
    void RealPlayNormalFrameRep();
 
    void on_comboBox_windowsnum_currentIndexChanged (int  index);
    void on_comboBox_qualitydemand_currentIndexChanged (int  index);
    void on_comboBox_ptzspeed_currentIndexChanged (int  index);
    void on_comboBox_ptzcruisepoint_currentIndexChanged (int  index);
    void on_comboBox_ptzcruisepath_currentIndexChanged (int  index);
    //play
    void on_pushButton_realplay_clicked();
    void on_pushButton_savefile_clicked();
    void on_pushButton_scrashPic_clicked();
    void on_pushButton_forceIframe_clicked();
    void on_pushButton_up_clicked();
    void on_pushButton_down_clicked();
    void on_pushButton_left_clicked();
    void on_pushButton_right_clicked();
    void on_pushButton_narrowfocus_clicked();
    void on_pushButton_expandfocus_clicked();
    void on_pushButton_nearfocus_clicked();    
    void on_pushButton_farfocus_clicked();
    void on_pushButton_largeaperture_clicked();
    void on_pushButton_smallaperture_clicked();
    void on_pushButton_ptzcruisepointcall_clicked();
    void on_pushButton_ptzcruisepointset_clicked();
    void on_pushButton_ptzcruisepathcall_clicked();
    void on_pushButton_ptzcruisepathset_clicked();
    void on_pushButton_trackmemorystart_clicked();  
    void on_pushButton_trackmemorystop_clicked();
    void on_pushButton_trackmemoryrun_clicked();
    void on_horizontalSlider_bright_valueChanged ( int value);  
    void on_horizontalSlider_contrast_valueChanged ( int value); 
    void on_horizontalSlider_saturation_valueChanged ( int value);
    void on_horizontalSlider_hue_valueChanged ( int value);
    void on_horizontalSlider_volume_valueChanged ( int value);
    void on_pushButton_defaultparameter_clicked();
 
private:
    Ui::RealPlayClass ui;
    
    QFrame *m_pframePlay;    //Window which is used to contain playWnd or is used to play.
    CFramePlayWnd *m_pSelectedPlayWnd;
    CFramePlayWnd *m_framePlayWnd[REALPLAY_MAX_NUM]; //playWnd
 
    LogTable * m_rplogtable;
    QList<DeviceData>* m_qlistdevicetree;
    int *m_rpuserid;
    NET_DVR_DEVICEINFO_V30* m_rpdeviceinfo;
    int* m_rpchannelnum;
    int *m_channellinkmode;
    //set viedeo quality
    int m_rpcurrentrealhandle;
    
#ifdef __linux__
    //draw area initial
    INITINFO m_rpinitinfo;  
#endif
 
    QMenu * m_rpmenu;
    //after begin value is 1 while stop is 0
    int m_rpstartstopflag;
    int m_rpsavestopflag;
    //realplay window num equal (index+1)*(index+1)
    int m_rpwindownumindex;
    int m_rpwindownumindexbackup;
    //vedio parameter
    int m_rpbrightvalue;
    int m_rpcontrastvalue;
    int m_rpsaturationvalue;
    int m_rphuevalue;
    int m_rpvolumvalue;
    //PTZ module
    int m_rpptzspeed;
    int m_ptzupswitch;
    int m_ptzdownswitch;
    int m_ptzrghtswitch;
    int m_ptzleftswitch;
    int m_ptznarrowswitch;
    int m_ptzexpandswitch;
    int m_ptzfarswitch;
    int m_ptznearswitch;
    int m_ptzbigswitch;
    int m_ptzsmallswitch;
 
    int m_ptzpresetpointindex;
    int m_ptzcruisepathindex;
    PtzPreset * m_ptzpreset;
    PtzCruise * m_ptzcruise;
    int m_ptzcruiserunning;
    //when set slider min/max value no messagebox
    int m_rpsliderflag;
    const QModelIndex * m_rpmodelindex;
    //used to close realplay handle point to device
    TreeModel**  m_rpmodel;
    int m_rpuseridbackup;
    int m_rpfirstrealhandle;
    //int m_rperrorflag;
};
#endif // REALPLAY_H