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); }
VSCPlayback::VSCPlayback(QWidget *parent, QTabWidget &pTabbed) : QWidget(parent), m_pTabbed(pTabbed), m_currentFocus(-1) { ui.setupUi(this); QVBoxLayout* layout = new QVBoxLayout(); m_pVideo = new VSCVideoWall(this->ui.widget); m_pVideo->hide(); //layout->setSpacing(10); layout->addWidget(m_pVideo); layout->setMargin(0); this->ui.widget->setLayout(layout); m_pVideo->show(); m_pFloating = new QAction(QIcon(tr("images/open.ico")), tr("Floating"), this); //m_pUnFloating = new QAction(QIcon(tr("images/open.ico")), tr("UnFloating"), this); //connect(m_pFloating, SIGNAL(triggered()), this, SLOT(floatingAction())); //connect(m_pUnFloating, SIGNAL(triggered()), this, SLOT(unFloatingAction())); SetupConnections(); createContentMenu(); m_pPlayControl = new VSCPlayControl(); m_bPlayControl = FALSE; m_pPlayControl->hide(); //setMouseTracking(true); }
VSCCameraAdd::VSCCameraAdd(DeviceParam &Param, QWidget *parent) : QWidget(parent) { ui.setupUi(this); m_Param = Param; BOOL bHWAccel; BOOL bMining; m_nId = m_Param.m_Conf.data.conf.nId; if (m_nId == 0) { gFactory->GetDefaultHWAccel(bHWAccel); if (bHWAccel == TRUE) { VDC_DEBUG( "%s Enable default the HWAccel\n",__FUNCTION__); m_Param.m_Conf.data.conf.HWAccel = 1; } gFactory->GetDefaultMining(bMining); if (bMining == TRUE) { VDC_DEBUG( "%s Enable default the Mining\n",__FUNCTION__); m_Param.m_Conf.data.conf.Mining = 1; } } #if 0 m_pFloating = new QAction(QIcon(tr("images/open.ico")), tr("Floating"), this); //m_pUnFloating = new QAction(QIcon(tr("images/open.ico")), tr("UnFloating"), this); connect(m_pFloating, SIGNAL(triggered()), this, SLOT(floatingAction())); //connect(m_pUnFloating, SIGNAL(triggered()), this, SLOT(unFloatingAction())); createContentMenu(); #endif //connect(ui.lineFilePath, SIGNAL(triggered()), this, SLOT(floatingAction())); //ui.radioButtonFile->setChecked(true); setupDefaultValue(); radioButtonClicked(); m_pVideo = new VSCVWidget(m_nId, this); QVBoxLayout* layout = new QVBoxLayout(); layout->addWidget(m_pVideo); layout->setMargin(0); ui.widget->setLayout(layout); PreView(); SetupConnections(); }
VSCVideoWall::VSCVideoWall(QWidget *parent) : m_bFloated(FALSE), QWidget(parent) { //setMinimumWidth(800); //setMinimumHeight(600); m_VideoWallMode = LAYOUT_MODE_2X2; if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { puts("# error initializing SDL"); puts(SDL_GetError()); return; } for (int i = 0; i < VIDEO_WALL_WIDGET_MAX; i ++) { m_VideoMap[i] = new VSCVWidget(i, this); connect(m_VideoMap[i], SIGNAL(ShowDisplayClicked(int)), this, SIGNAL(ShowDisplayClicked(int))); connect(m_VideoMap[i], SIGNAL(ShowFloatingClicked()), this, SIGNAL(ShowFloatingClicked())); connect(m_VideoMap[i], SIGNAL(ShowTabbedClicked()), this, SIGNAL(ShowTabbedClicked())); connect(m_VideoMap[i], SIGNAL(ShowFocusClicked(int)), this, SIGNAL(ShowFocusClicked(int))); } m_pLayout = new QGridLayout; //m_pLayout->setSpacing(1); m_pLayout->setMargin(0); m_pLayout->setVerticalSpacing(1); m_pLayout->setHorizontalSpacing(1); #if 0 #if 0 for (int i = 0; i < 3; i ++) { for (int j = 0; j < 3; j ++) { m_pLayout->addWidget(m_VideoMap[i * 3 + j], i, j); //m_pLayout->addWidget(new QLineEdit(), i, j); m_VideoMap[i]->show(); } } #else m_pLayout->addWidget(m_VideoMap[0], 0, 0, 2, 2); m_pLayout->addWidget(m_VideoMap[1], 0, 2); m_pLayout->addWidget(m_VideoMap[2], 1, 2); m_pLayout->addWidget(m_VideoMap[3], 2, 0); m_pLayout->addWidget(m_VideoMap[4], 2, 1); m_pLayout->addWidget(m_VideoMap[5], 2, 2); #endif #endif setLayout(m_pLayout); for (int i = 0; i < 1; i ++) { //m_VideoMap[i] = new VSCVideoWidget; //m_VideoMap[i]->showMaximized(); } #if 0 m_pFloating = new QAction(QIcon(tr("images/open.ico")), tr("Floating"), this); m_pUnFloating = new QAction(QIcon(tr("images/open.ico")), tr("UnFloating"), this); //connect(m_pFloating, SIGNAL(triggered()), this, SLOT(floatingAction())); //connect(m_pUnFloating, SIGNAL(triggered()), this, SLOT(unFloatingAction())); createContentMenu(); #endif UpdateVideoWallLayout(); }
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(); }