Exemplo n.º 1
0
void CRecordProcessor::init(QSettings* settings)
{
    time_t rawtime;
    struct tm * timeinfo;
    char buffer [80];


    QObject::connect( this, SIGNAL(updateFileText(QString)), parentwnd, SLOT(getFileText(QString)));
    QString txt = tr("none");
    emit updateFileText( txt );

    CvSize imgsize = imgdb->getImageSize();

    time ( &rawtime );
    timeinfo = localtime ( &rawtime );

    strftime (buffer,80,"sensbli-%Y-%m-%d_%H%M%S.avi",timeinfo);

    if( outfile != NULL )
    {
    	cvReleaseVideoWriter( &outfile );
    }
	outfile =cvCreateVideoWriter( buffer, CV_FOURCC('I','Y','U','V'), 25, cvSize(640,480), 1);

	QString filetext = buffer;
	emit updateFileText( filetext );


}
void EditButtonDialog::fileDialog(){
    qDebug("Entering EditButtonDialog::fileDialog()...");

    QString selectedFile = ui->fileEdit->text();

    if(selectedFile == NULL || ! QFile::exists(selectedFile)){
        selectedFile = Constants::SOUNDS_DIR;
    }

    QString newFile = QFileDialog::getOpenFileName(
            this,
            tr("Select audio file."),
            selectedFile,
            tr("Audio files (*.wav)"));

    if(newFile != NULL){
        updateFileText(newFile);
    }
}