QvkWebcamController::QvkWebcamController(QWidget *parent ) : QHBoxLayout(parent) { //qDebug() << "Begin QvkWebcamController::QvkWebcamController( QWidget * value ) ***************************"; checkBox = new QCheckBox; checkBox->setText( tr( "Webcam" ) ); connect( checkBox, SIGNAL( clicked() ), SLOT( webcam() ) ); this->addWidget(checkBox, 0, Qt::AlignLeft); comboBoxCount = new QComboBox; comboBoxCount->setToolTip( "Select webcam" ); this->addWidget(comboBoxCount, 0, Qt::AlignLeft); myWebcamWatcher = new QvkWebcamWatcher(); connect( myWebcamWatcher, SIGNAL( changed( QStringList ) ), this, SLOT( webcamChangedEvent( QStringList ) ) ); connect( myWebcamWatcher, SIGNAL( added( QStringList, QStringList ) ), this, SLOT( webcamAddedEvent( QStringList, QStringList ) ) ); connect( myWebcamWatcher, SIGNAL( removed( QStringList, QString ) ), this, SLOT( webcamRemovedEvent( QStringList, QString ) ) ); myWebcamWatcher->myfileSystemWatcher( "/dev/" ); if ( myWebcamWatcher->getWebcamCount() == 0 ) { checkBox->setEnabled( false ); comboBoxCount->setEnabled( false ); } vkWebcam = new QvkWebcam(); QSettings settings( "vokoscreen", "vokoscreen" ); settings.beginGroup( "Webcam" ); vkWebcam->setDeviceNumber( settings.value( "Number", 0 ).toUInt() ); comboBoxCount->setCurrentIndex( vkWebcam->getDeviceNumber() ); settings.endGroup(); //vkWebcam->setDeviceNumber( comboBoxCount->currentText().toUInt() ); //comboBoxCount->setCurrentIndex( vkWebcam->getDeviceNumber() ); connect( vkWebcam, SIGNAL( closeWebcam() ), this, SLOT( webcamCloseEvent() ) ); //qDebug() << "End QvkWebcamController::QvkWebcamController( QWidget * value ) ***************************"; }
QvkWebcamController::QvkWebcamController( QCheckBox *myCheckBox, QComboBox *myComboBox, QCheckBox *myMirrorCheckBox, QFrame *myRotateFrame ,QDial *myRotateDial, QRadioButton *myRadioButtonTopMiddle, QRadioButton *myRadioButtonRightMiddle, QRadioButton *myRadioButtonBottomMiddle, QRadioButton *myRadioButtonLeftMiddle ) { vkSettings.readAll(); checkBox = myCheckBox; checkBox->setEnabled( false ); connect( checkBox, SIGNAL( clicked( bool ) ), this, SLOT( setWebcamOnOff( bool ) ) ); rotateFrame = myRotateFrame; comboBox = myComboBox; mirrored = false; mirrorCheckBox = myMirrorCheckBox; if ( checkBox->checkState() == Qt::Unchecked ) { mirrorCheckBox->setEnabled( false ); rotateFrame->setEnabled( false ); } else { mirrorCheckBox->setEnabled( true ); rotateFrame->setEnabled( false ); } connect( mirrorCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( setMirrorOnOff( bool ) ) ); if ( vkSettings.getWebcamMirrored() == Qt::Checked ) { mirrorCheckBox->setEnabled( true ); mirrorCheckBox->click(); mirrorCheckBox->setEnabled( false ); } rotateDial = myRotateDial; rotateDial->setMinimum( 0 ); rotateDial->setMaximum ( 360 ); rotateDial->setValue( 0 ); connect( rotateDial, SIGNAL( sliderPressed () ), this, SLOT( rotateDialclicked() ) ); radioButtonTopMiddle = myRadioButtonTopMiddle; radioButtonTopMiddle->setChecked( vkSettings.getWebcamButtonTopMiddle() ); radioButtonRightMiddle = myRadioButtonRightMiddle; radioButtonRightMiddle->setChecked( vkSettings.getWebcamButtonRightMiddle() ); radioButtonBottomMiddle = myRadioButtonBottomMiddle; radioButtonBottomMiddle->setChecked( vkSettings.getWebcamButtonBottomMiddle() ); radioButtonLeftMiddle = myRadioButtonLeftMiddle; radioButtonLeftMiddle->setChecked( vkSettings.getWebcamButtonLeftMiddle() ); captureThread = new CaptureThread(); connect( captureThread, SIGNAL( newPicture( QImage ) ), this, SLOT( setNewImage( QImage ) ) ); myWebcamWatcher = new QvkWebcamWatcher(); connect( myWebcamWatcher, SIGNAL( changed( QStringList ) ), this, SLOT( webcamChangedEvent( QStringList ) ) ); connect( myWebcamWatcher, SIGNAL( removed( QStringList, QString ) ), this, SLOT( webcamRemovedEvent( QStringList, QString ) ) ); myWebcamWatcher->myfileSystemWatcher( "/dev/" ); webcamWindow = new QvkWebcamWindow(); connect( webcamWindow, SIGNAL( setOverScreen() ), this, SLOT( checkBox_OnOff() ) ); connect( webcamWindow, SIGNAL( closeWebcamWindow() ), SLOT( webcamCloseEvent() ) ); connect( myWebcamWatcher, SIGNAL( readWebcamNames( QStringList ) ), this, SLOT( readWebcams( QStringList ) ) ); }
void QvkWebcamController::webcams() { webcamChangedEvent( webcamList ); }