Rabbit Remote Control 0.1.0-bate16
Loading...
Searching...
No Matches
FrmPlayer.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef FRMPLAYER_H
4#define FRMPLAYER_H
5
6#include <QVideoWidget>
7#include <QToolBar>
8#include <QSlider>
9#include <QProgressBar>
10#include <QLabel>
11#include <QTimer>
12#include <QMargins>
13#include "ParameterPlayer.h"
14
15#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
16 // 在 wayland 下,QVideoWidget 会覆盖顶层窗口(例如:全屏工具条)
17 #undef HAVE_QVideoWidget
18#endif
19#ifndef HAVE_QVideoWidget
20 class QGraphicsVideoItem;
21 class CVideoGraphicsView;
22#endif
23
24class CFrmPlayer : public QWidget
25{
26 Q_OBJECT
27
28public:
29 CFrmPlayer(QWidget *parent = nullptr);
30 virtual ~CFrmPlayer();
31
32 QVideoSink* videoSink();
33 int SetParameter(CParameterPlayer* pParameter);
34
35 QAction* m_paStart;
36 QAction* m_paPause;
37#if HAVE_QT6_RECORD
38 QAction* m_paRecord;
39 QAction* m_paRecordPause;
40#endif
41 QAction* m_paScreenShot;
42 QAction* m_paMuted;
43 QAction* m_paVolume;
44 QAction* m_paSettings;
45
46public:
47 virtual bool eventFilter(QObject *watched, QEvent *event) override;
48
49public Q_SLOTS:
50 void slotPositionChanged(qint64 pos, qint64 duration);
51
52Q_SIGNALS:
53 void sigChangePosition(qint64 pos);
59 void sigViewerFocusIn(QWidget* pView);
60
61protected:
62 virtual void focusInEvent(QFocusEvent *event) override;
63 virtual void focusOutEvent(QFocusEvent *event) override;
64 virtual void mouseMoveEvent(QMouseEvent *event) override;
65
67 Q_INVOKABLE int OnFullScreen(bool bFull);
68
69private Q_SLOTS:
70 void slotAudioMuted(bool bMuted);
71 void slotAduioVolume(int volume);
72 void slotStart(bool bStart);
73 void slotTimeOut();
74 void StartTimer();
75
76private:
77#ifdef HAVE_QVideoWidget
78 QVideoWidget* m_pVideoWidget;
79#else
80 CVideoGraphicsView *m_pGraphicsView;
81 QGraphicsVideoItem* m_pVideoItem;
82 void UpdateGraphicsVideoGeometry();
83#endif
84 QToolBar* m_pToolBar;
85 QTimer tm_ToolBar;
86 QSlider m_pbVideo;
87 bool m_bMoveVideo;
88 QSlider m_pbVolume;
89 CParameterPlayer* m_pParameter;
90 QLabel* m_pLabel;
91 bool m_bFullScreen;
92 QMargins m_Margins;
93};
94
95#endif // FRMPLAYER_H
virtual void focusInEvent(QFocusEvent *event) override
[Full Screen]
Q_INVOKABLE int OnFullScreen(bool bFull)
Full Screen.
void sigViewerFocusIn(QWidget *pView)
The view is focus.