xref: /OK3568_Linux_fs/app/forlinx/flapp/src/plugins/allwinner/MediaUI/player/videoplayer.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*!
2  * @file videoplayer.h
3  * Copyright (c) 2018
4  * @brief des
5  * detailed des
6  *
7  * @date 2018
8  * @author lee
9  */
10 #ifndef VIDEOPLAYER_H
11 #define VIDEOPLAYER_H
12 
13 #include <QWidget>
14 #include <QTimer>
15 #include "videoplaylist.h"
16 #include "commonfunction.h"
17 #include "searchfiledialog.h"
18 #include "xmetadataretriever.h"
19 
20 
21 namespace Ui {
22 class VideoPlayer;
23 }
24 extern int autCb_func(int msgType, void *user,void* data,int len);
25 
26 class VideoPlayer : public QWidget
27 {
28     Q_OBJECT
29 
30 public:
31     static VideoPlayer *Instance(QWidget *parent = 0);//create window by this interface
32 
33     ~VideoPlayer();
34 
35     void initAutPlayer();
36 
37     void startPlay();
38 
39     void updateDurationInfo(qint64 currentInfo);
40 
41     static int autVideoCb_func(int msgType, void* user,void* data,int len);
42 
43     void getNumOfAudioAndSubtitle(int&,int&);
44 
45 private slots:
46     void on_return_btn_clicked();
47 
48     void on_fullScreenButton_clicked();
49 
50     void on_preVideoButton_clicked();
51 
52     //void on_playListButton_clicked();
53 
54     void on_subtitleSelectButton_clicked();
55 
56     void on_searchButton_clicked();
57 
58     void on_playButton_clicked();
59 
60     void on_nextVideoButton_clicked();
61 
62     void on_notifyVideoPlayerToPlay(QList<QFileInfo>,int);
63 
64     void on_notifyVideoPlayerListChanged(QList<QFileInfo>);
65 
66     void timerUpdate();
67 
68     void onProgressSliderMoved(int);
69 
70     void onProgressSliderReleased();
71 
72     void on_UnFullscreenButton_clicked();
73 
74     void setSubtitleNum(QAction*);
75 
76     void setAudioNum(QAction*);
77 
78     void stopPlay();
79 
80     void doMsgCmd(int msgType,void* user,void* data,int len);
81 
82     void on_notifyVideoPlayerAddFile(QString strpath);
83 
84     void on_notifyVideoCancelSearch();
85 
86 signals:
87     void msgSignal(int msgType,void* user,void* data,int len);
88 
89     void hideSearchFileDialog();
90 
91     void showSearchFileDialog();
92 
93     void hidePlayList();
94 
95     void showPlayList();
96 
97 private:
98 
99     Ui::VideoPlayer *ui;
100     explicit VideoPlayer(QWidget *parent = 0);
101     static VideoPlayer* self;//this  is for single instance
102 
103     CommonFunction* m_commonFunction;
104     searchFileDialog *m_pSearchDialog;
105     bool m_bSearchDialogOpen;//for open is 1;close is 0
106 
107     //VideoPlayList* m_pVideoPlayList;
108     bool m_bVideoListOpen;//for open is 1;close is 0
109 
110     QList<QFileInfo> m_playList;
111     QString m_curVideoFilePath;
112     QString m_curVideoFileName;
113     QString str_SelectPath;
114     int m_curVideoFileCount;
115 
116     AUTPlayer* ap;
117     qint64 m_totalDuration;
118     qint64 m_curDuration;
119     qint64 m_pretime;
120     QTimer* progressSliderTimer;
121     PLAYSTATE m_bPlayState;//ENUM of state
122 
123     int m_subtitleNow;
124     int m_audioNow;
125 
126 };
127 
128 static VideoPlayer *pStaticVideoPlayer=NULL;
129 
130 #endif // VIDEOPLAYER_H
131