366 lines
8.9 KiB
C++
366 lines
8.9 KiB
C++
#ifndef RM_FRAME_VIDEO_BASE
|
|
#define RM_FRAME_VIDEO_BASE
|
|
|
|
#include "../rm_include.h"
|
|
#include "../fm_event_types.h"
|
|
#include "rm_widget_style_base.h"
|
|
#include "rm_widget_zoom_pos.h"
|
|
#include <QMouseEvent>
|
|
#include <QShortcut>
|
|
#include <QTime>
|
|
#include <QTimer>
|
|
|
|
#if (RM_MODEL_360)
|
|
#include "../core/rm_player.h"
|
|
#include "../../fav/VideoRenderer.h"
|
|
#endif
|
|
|
|
class FMButton;
|
|
class RMVideoItem;
|
|
class RMWidgetZoomPos;
|
|
class FMLogoWidget;
|
|
|
|
#if (USE_DRAG_ZOOM)
|
|
class FMDragZoomWidget;
|
|
#endif
|
|
|
|
#if (USE_360_POSITION_VIEW)
|
|
class QStackedLayout;
|
|
class FM360PositionView;
|
|
class FM360StaticPositionView;
|
|
#endif // #if (USE_360_POSITION_VIEW)
|
|
|
|
class RMFrameVideoBase : public RMWidgetBase
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
// QString styleChangeName ="",
|
|
explicit RMFrameVideoBase(QWidget *parent = nullptr,bool bMain = true, bool bEvent = false);
|
|
|
|
#if (PLAYER_ONLY_LIBRARY_MODE)
|
|
FMButton* btnClose;
|
|
#endif //!PLAYER_ONLY_LIBRARY_MODE
|
|
|
|
private:
|
|
bool _bIsMainVideo; // 처음시작시 MAIN
|
|
bool _bIsFrontVideo; // SWAP 포함하여 전/후방 구분
|
|
|
|
protected:
|
|
QWidget* _videoWidget;
|
|
#if (USE_360_POSITION_VIEW)
|
|
QStackedLayout* videoLayout;
|
|
FM360PositionView* _posView;
|
|
//QStackedLayout* videoLayout;
|
|
FM360StaticPositionView* _posStaticView;
|
|
#endif // #if (USE_360_POSITION_VIEW)
|
|
|
|
#if (DUAL_VIDEO_WIDGET || TOPDOWN_360_QUAD_MODE)
|
|
QWidget* _videoBaseWidget;
|
|
QHBoxLayout* _videoWidgetLayout;
|
|
QWidget* _videoWidget2;
|
|
#if (TOPDOWN_360_QUAD_MODE)
|
|
QWidget* _videoBaseTopWidget;
|
|
QWidget* _videoBaseDownWidget;
|
|
QVBoxLayout* _videoWidgetVLayout;
|
|
QHBoxLayout* _videoWidgetLayout2; // 하단 (상단은 _videoWidgetLayout 사용)
|
|
|
|
QWidget* _videoWidget3;
|
|
QWidget* _videoWidget4;
|
|
#endif // TOPDOWN_360_QUAD_MODE
|
|
|
|
#endif // DUAL_VIDEO_WIDGET
|
|
|
|
|
|
QWidget* _titleBar;
|
|
#if (PLAYER_ONLY_LIBRARY_MODE)
|
|
QLabel* _fileNameLabel;
|
|
#endif // PLAYER_ONLY_LIBRARY_MODE
|
|
|
|
|
|
QWidget* titleTools;
|
|
QHBoxLayout* titleToolLayout;
|
|
#if !(NO_CAMERA_TITLE)
|
|
QLabel* titleLabel;
|
|
#endif // #if !(NO_CAMERA_TITLE)
|
|
FMButton* btnFullScreen;
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && !PLAYER_ONLY_LIBRARY_MODE)
|
|
FMButton* btnTB5000;
|
|
#endif // RM_MODEL_TYPE_TB4000
|
|
#if !(RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
FMButton* btnFlipH;
|
|
#if !(TOP_DOWN_360)
|
|
FMButton* btnFlipV;
|
|
#endif // #if (TOP_DOWN_360)
|
|
|
|
#if !(SINGLE_CH_VIEWER || PENTA_CHANNEL)
|
|
FMButton* btnSwap;
|
|
#endif // #if !(SINGLE_CH_VIEWER)
|
|
|
|
#if (TRI_CHANNEL || TRI_CHANNEL2)
|
|
FMButton* btnIndoor;
|
|
#endif // TRI_CHANNEL
|
|
|
|
#if (RM_MODEL_EMT_KR)
|
|
FMButton* btn360Wide;
|
|
#endif // RM_MODEL_EMT_KR
|
|
|
|
#endif // #if !(RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
|
|
|
|
|
|
#if (TOP_DOWN_360)
|
|
|
|
#if !(RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
FMButton* btnZoom360;
|
|
FMButton* btnMode360;
|
|
#else
|
|
FMButton* btnMode360_2D;
|
|
FMButton* btnMode360_3D;
|
|
FMButton* btnMode360_4CH;
|
|
FMButton* btnMode360_5CH;
|
|
|
|
#endif // #if !(RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
QLabel* seperator;
|
|
FMButton* btnReset360;
|
|
#if (PLAYER_ONLY_LIBRARY_MODE)
|
|
FMButton* btnSave360; ///! 4,5분할 저장 버튼
|
|
#endif
|
|
|
|
MODE_360 mode360;
|
|
|
|
bool modeZoom;
|
|
void refreshMode360();
|
|
#if (MOUSE_DRAG_ACCELERATION)
|
|
int _scrollCount; // 현재 남은 scroll 개수
|
|
int _scrollStartCount; // 전체 scroll 개수 (감속을 위해 사용)
|
|
QPoint _lastSpeedPos; // Speed Accmulation
|
|
QTime _dragTimer; // Speed "
|
|
QPointF _lastSpeed; // XY Speed Vector
|
|
QTimer* _accelerationTimer; // On Mouse Up Start timer
|
|
void stopAccelerationTimer();
|
|
#endif // MOUSE_DRAG_ACCELERATION
|
|
#if (USE_POINT_ZOOM)
|
|
FAV::VideoRenderer* _pVR; // video renderer
|
|
bool _bZoomMode; // 확대 모드
|
|
QCursor* _magnifyZoom; // 확대 커서
|
|
void sendSelectedSignal();
|
|
#endif // USE_POINT_ZOOM
|
|
#endif // TOP_DOWN_360
|
|
|
|
|
|
#if (RESIZE_FILTER && !DO_NOT_USE_ZOOM)
|
|
void resizeEvent(QResizeEvent *event);
|
|
#endif
|
|
|
|
#if (USE_DRAG_ZOOM)
|
|
FMDragZoomWidget* dragWidget;
|
|
#endif
|
|
|
|
#if (CLICK_PAUSE_PLAY)
|
|
QTimer* clickTimer; ///! 더블클릭이 아닌 경우에만 play/pause 처리
|
|
#endif
|
|
|
|
QVBoxLayout* layout;
|
|
FMLogoWidget* logoWidget;
|
|
|
|
void setVideoWidget(QWidget* widget);
|
|
#if (DUAL_VIDEO_WIDGET)
|
|
void setVideoWidget2(QWidget* widget);
|
|
#endif // DUAL_VIDEO_WIDGET
|
|
#if(TOPDOWN_360_QUAD_MODE)
|
|
void setOtherVideoWidgets(QWidget* widget2,QWidget* widget3,QWidget* widget4);
|
|
#endif
|
|
|
|
public:
|
|
void _videoOnOff(bool on);
|
|
protected:
|
|
bool bIsFullScreen;
|
|
void _createTitleBar();
|
|
void refreshVideoOff();
|
|
void refreshButtons(bool bSingle);
|
|
|
|
#if (CLICK_PAUSE_PLAY)
|
|
void startClickTimer();
|
|
void cancelClickTimer();
|
|
#endif // CLICK_PAUSE_PLAY
|
|
|
|
|
|
#if !(DO_NOT_USE_ZOOM)
|
|
|
|
#if !(ZOOM_SHADER)
|
|
// PIP
|
|
QWidget* zoomWidget;
|
|
QHBoxLayout* zoomLayout;
|
|
QHBoxLayout* videoLayout;
|
|
|
|
QHBoxLayout* zoomPosLayout;
|
|
RMWidgetZoomPos* zoomPos;
|
|
QWidget* zoomVideoWidget;
|
|
|
|
void _updateZoomProcess(QPoint pos);
|
|
|
|
QPoint _zoomPos;
|
|
QTimer* _zoomTimer;
|
|
bool bPIPRight;
|
|
|
|
#if (USE_ZOOM_WH_RATIO)
|
|
void refreshZoomWidgetWH();
|
|
#endif
|
|
#endif // ZOOM_SHADER
|
|
|
|
public:
|
|
bool bZoomStarted;
|
|
|
|
protected:
|
|
|
|
#if !(ZOOM_SHADER)
|
|
QRect pipRect;
|
|
void refreshPIP();
|
|
#endif
|
|
|
|
#if (PENTA_CHANNEL)
|
|
FMButton* selectButtons[7];
|
|
void _createCHTool(QWidget* parent, QHBoxLayout* layout);
|
|
//! \brief 언어 변경시 수정
|
|
void _refreshCHTool();
|
|
#endif // #if (PENTA_CHANNEL)
|
|
// ZOOM CONTROL
|
|
|
|
bool _wasPIPHidden;
|
|
#endif // DO_NOT_USE_ZOOM
|
|
|
|
#if (MODEL_360)
|
|
bool _dualMode; // Mirror 모드 (회전,이동금지)
|
|
bool _zoom3D;
|
|
double _startAngle;
|
|
double _startPitch;
|
|
bool _offByDualMode; // 360 후방 끄기
|
|
#endif
|
|
QSize _resolution;
|
|
|
|
#if (!DO_NOT_USE_ZOOM || MODEL_360 || TOP_DOWN_360)
|
|
bool _dragStart;
|
|
QPoint _dragPos;
|
|
bool _mousePressed;
|
|
|
|
#if (TOP_DOWN_360)
|
|
#if (!USE_POINT_ZOOM || USE_HYBRID_ZOOM)
|
|
bool _drawStarted;
|
|
#endif //PZ
|
|
|
|
#if (!USE_POINT_ZOOM || USE_HYBRID_ZOOM)
|
|
QRect _rect;
|
|
QPainter _painter;
|
|
#endif
|
|
|
|
//bool _ROIEnabled;
|
|
void wheelEvent(QWheelEvent *e) override;
|
|
#endif // TOP_DOWN_360
|
|
|
|
void mouseMoveEvent(QMouseEvent* event) override;
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
|
#endif // DO_NOT_USE_ZOOM
|
|
|
|
//#if (RM_MODEL == RM_MODEL_TYPE_TB4000 || ZOOM_SHADER || MODEL_360)
|
|
#if !(DO_NOT_USE_ZOOM) || (RM_MODEL == RM_MODEL_TYPE_TB4000)
|
|
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
|
#endif // DO_NOT_USE_ZOOM
|
|
//#endif // RM_MODEL_TYPE_TB4000
|
|
|
|
|
|
#if (TOP_DOWN_360)
|
|
void _refresh360UI();
|
|
#endif
|
|
|
|
public:
|
|
#if (LIVE_LANGUAGE_CHANGE && MODEL_STANDARD)
|
|
virtual void refreshLanguageSub(){}
|
|
void refreshLanguage(); // 언어 변경
|
|
#endif
|
|
#if !(NO_CAMERA_TITLE)
|
|
void refreshTitle(bool bForceFlip); // 전후방 표시 (강제 전환 포함)
|
|
#endif // #if !(NO_CAMERA_TITLE)
|
|
|
|
#if (MODEL_360)
|
|
void dualOff(bool off); // 후방 채널 끄기
|
|
void setDualMode(bool dual);
|
|
#endif
|
|
|
|
public slots:
|
|
virtual void onPlayEvent(PLAY_EVENT event, RMVideoItem* item);
|
|
void onAppEvent(RMApp::Event event,int param) override;
|
|
|
|
#if (CLICK_PAUSE_PLAY)
|
|
void onClicked();
|
|
void onPlayOrPause();
|
|
#endif // CLICK_PAUSE_PLAY
|
|
#if !(DO_NOT_USE_ZOOM)
|
|
// ZOOM 업데이트
|
|
|
|
#if !(ZOOM_SHADER)
|
|
void onUpdateZoom();
|
|
void onForceUpdateZoom();
|
|
#endif
|
|
|
|
// ZOOM 시작, 종료
|
|
void onToggleZoom();
|
|
|
|
// ZOOM 위치이동
|
|
void onTogglePIPLocation();
|
|
|
|
// 실제 감추기만 하고 마우스 동작은 됨
|
|
void onToggleShowHidePIP();
|
|
|
|
void onHidePIPForCapture(bool hide);
|
|
#endif
|
|
|
|
#if (TOP_DOWN_360)
|
|
void onMode360();
|
|
void onReset360();
|
|
void onZoom360();
|
|
#if (MOUSE_DRAG_ACCELERATION)
|
|
void onScroll();
|
|
#endif // MOUSE_DRAG_ACCELERATION
|
|
#if (USE_POINT_ZOOM)
|
|
void onZoomChange(bool bZoom);
|
|
#endif // USE_POINT_ZOOM
|
|
#if (PLAYER_ONLY_LIBRARY_MODE)
|
|
void onSave360();
|
|
#endif // LIBRARY_MODE
|
|
#endif // TOP_DOWN_360
|
|
|
|
// 비디오 표시 (로딩 후 타이머 처리)
|
|
// void onShowVideo();
|
|
#if (RM_MODEL == RM_MODEL_TYPE_TB4000 && !PLAYER_ONLY_LIBRARY_MODE)
|
|
void onTB5000();
|
|
#endif //
|
|
#if (LIVE_LANGUAGE_CHANGE && MODEL_STANDARD)
|
|
void onLanguageChange(RMLanguage::LANGUAGE_TYPE language);
|
|
#endif
|
|
#if (PENTA_CHANNEL)
|
|
void onSelectVideo();
|
|
//! \brief onSelectVideo 에서 기능만 분리
|
|
//! \param mode
|
|
void selectMode(int mode);
|
|
#endif
|
|
|
|
#if (USE_360_POSITION_VIEW)
|
|
void onAngleUpdated(double yaw,double pitch);
|
|
#endif
|
|
|
|
#if (RM_MODEL_EMT_KR)
|
|
void onToggleWideMode();
|
|
#endif // RM_MODEL_EMT_KR
|
|
|
|
signals:
|
|
void modeZoomChange(bool zoom);
|
|
void mode360Change(int mode);
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif // RM_FRAME_VIDEO_BASE
|