VVidPBView::VVidPBView(ClientFactory &pFactory, QWidget *parent, QTabWidget &pTabbed, QString strName) : m_pFactory(pFactory), QWidget(parent), m_pTabbed(pTabbed), m_currentFocus(-1), m_bControlEnable(TRUE), m_strName(strName), m_bFloated(FALSE), m_TimerTour(NULL) { ui.setupUi(this); m_pParent = parent; m_lastHoverTime = time(NULL); this->setAttribute(Qt::WA_Hover,true); QVBoxLayout* layout = new QVBoxLayout(); m_pVideo = new VVidPBWall(m_pFactory, this->ui.widget); m_pVideo->hide(); //layout->setSpacing(10); layout->addWidget(m_pVideo); layout->setMargin(0); this->ui.widget->setLayout(layout); m_pVideo->show(); SetupConnections(); createContentMenu(); //ui.pushButton8x8->hide(); setMouseTracking(true); m_Timer = new QTimer(this); connect(m_Timer,SIGNAL(timeout()),this,SLOT(UpdateVideoControl())); m_Timer->start(1000); ShowFocusClicked(0); }
VSCVWidget::VSCVWidget(s32 nId, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) { m_pStarted = FALSE; m_nId = nId; m_nPlayId = 0; m_pRenderBuffer = NULL; m_bDeviceDeleted = FALSE; m_bFocus = FALSE; m_lastMoveTime = 0; m_InstantPbMode = FALSE; m_pbThread = NULL; m_autoUpdate = TRUE; m_Render = RENDER_QT; m_DragStart = FALSE; m_PtzStart = FALSE; m_PtzEnable = FALSE; gettimeofday(&m_lastPtz, NULL); this->setAcceptDrops(true); m_pStop = new QAction(QIcon(tr(":/action/resources/stop.png")), tr("Stop"), this); connect(m_pStop, SIGNAL(triggered()), this, SLOT(stopAction())); m_pStop->setEnabled(false); m_pFloating = new QAction(QIcon(tr(":/action/resources/float.png")), tr("Float"), this); connect(m_pFloating, SIGNAL(triggered()), this, SIGNAL(ShowFloatingClicked())); m_pPTZ = new QAction(QIcon(tr(":/device/resources/dome.png")), tr("PTZ"), this); connect(m_pPTZ, SIGNAL(triggered()), this, SLOT(PTZEnable())); m_pRecord = new QAction(QIcon(tr("images/open.ico")), tr("RECORD"), this); //connect(m_pFloating, SIGNAL(triggered()), this, SIGNAL(ShowFloatingClicked())); m_pTabbed = new QAction(QIcon(tr(":/action/resources/tabbed.png")), tr("Tabbed"), this); connect(m_pTabbed, SIGNAL(triggered()), this, SIGNAL(ShowTabbedClicked())); m_pControlEnable = new QAction(QIcon(tr(":/action/resources/control_panel.png")), tr("Control Panel"), this); connect(m_pControlEnable, SIGNAL(triggered()), this, SIGNAL(ShowControlPanelClicked())); m_pDisplay1 = new QAction(QIcon(tr(":/action/resources/display.png")), tr("DISPLAY 1"), this); connect(m_pDisplay1, SIGNAL(triggered()), this, SLOT(showDisplay1())); m_pDisplay2 = new QAction(QIcon(tr(":/action/resources/display.png")), tr("DISPLAY 2"), this); connect(m_pDisplay2, SIGNAL(triggered()), this, SLOT(showDisplay2())); m_pDisplay3 = new QAction(QIcon(tr(":/action/resources/display.png")), tr("DISPLAY 3"), this); connect(m_pDisplay3, SIGNAL(triggered()), this, SLOT(showDisplay3())); m_pDisplay4 = new QAction(QIcon(tr(":/action/resources/display.png")), tr("DISPLAY 4"), this); connect(m_pDisplay4, SIGNAL(triggered()), this, SLOT(showDisplay4())); createContentMenu(); ui.setupUi(this); ui.videoControl->setVisible(false); //ui.widgetTimeline->hide(); /* Hide all the control button */ StopPlayUI(); //ui.videoControl->setMaximumHeight(20); m_videoWindow = (HWND)ui.video->winId(); setMouseTracking(true); connect(ui.video, SIGNAL(videoMouseMove(QMouseEvent *)), this, SLOT(videoMouseMove(QMouseEvent *))); connect(ui.video, SIGNAL(videoResize()), this, SLOT(videoResizeEvent())); connect(ui.pbInstantpb, SIGNAL( clicked() ), this, SLOT(instantPbClick())); connect(ui.widgetTimeline, SIGNAL( TimeLineChange(int) ), this, SLOT(TimeLineChanged(int))); ui.widgetTimeline->SetEnabled(FALSE); connect(ui.pbPause, SIGNAL( clicked() ), this, SLOT(InstantPbPause())); connect(ui.pbPlay, SIGNAL( clicked() ), this, SLOT(InstantPbPlay())); connect(ui.timelineZoom, SIGNAL( currentIndexChanged (int) ), this, SLOT(TimeLineLengthChanged(int))); ui.timelineZoom->setCurrentIndex (TIMELINE_LEN_5_MIN); m_Timer = new QTimer(this); connect(m_Timer,SIGNAL(timeout()),this,SLOT(UpdateVideoControl())); m_Timer->start(500); m_lastWidth = ui.video->width(); m_lastHeight = ui.video->height(); }