Diffstat (limited to 'noncore/multimedia/camera/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/camera/mainwindow.cpp | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/noncore/multimedia/camera/mainwindow.cpp b/noncore/multimedia/camera/mainwindow.cpp index 16ee8bc..49c7cbf 100644 --- a/noncore/multimedia/camera/mainwindow.cpp +++ b/noncore/multimedia/camera/mainwindow.cpp @@ -159,7 +159,7 @@ void CameraMainWindow::init() outputTog = new QActionGroup( 0, "output", true ); outputTog->setToggleAction( true ); - new QAction( "/tmp", 0, 0, outputTog, 0, true ); + new QAction( "/tmp/", 0, 0, outputTog, 0, true ); new QAction( "/mnt/card/", 0, 0, outputTog, 0, true ); - new QAction( "/mnt/sd/", 0, 0, outputTog, 0, true ); + new QAction( "/mnt/cf/", 0, 0, outputTog, 0, true ); docfolder = new QAction( "Documents Folder", 0, 0, outputTog, 0, true ); docfolder->setOn( true ); @@ -423,5 +423,13 @@ void CameraMainWindow::performCapture( const QString& format ) if ( outputTo == "Documents Folder" ) + { name.sprintf( "%s/Documents/image/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); + if ( !QDir( name ).exists() ) + { + odebug << "creating directory " << name << oendl; + QString msg = "mkdir -p " + name; + system( msg.latin1() ); + } + } else name = outputTo; @@ -502,6 +510,20 @@ void CameraMainWindow::stopVideoCapture() _framerate = 1000.0 / (_time.elapsed()/_videopics); - QString name( outputTo ); - name.append( "/prefix" ); + QString name; + if ( outputTo == "Documents Folder" ) + { + name.sprintf( "%s/Documents/video/%s/", (const char*) QDir::homeDirPath(), (const char*) captureFormat.lower() ); + if ( !QDir( name ).exists() ) + { + odebug << "creating directory " << name << oendl; + QString msg = "mkdir -p " + name; + system( msg.latin1() ); + } + } + else + name = outputTo; + + name.append( "/" ); // sure is sure and safe is safe ;-) + name.append( prefix ); if ( appendSettings ) name.append( QString().sprintf( "_%d_%d_q%d_%dfps", captureX, captureY, quality, _framerate ) ); @@ -520,4 +542,6 @@ void CameraMainWindow::stopVideoCapture() void CameraMainWindow::postProcessVideo( const QString& infile, const QString& outfile ) { + odebug << "post processing " << infile << " --> " << outfile << oendl; + preview->setRefreshingRate( 0 ); @@ -597,5 +621,5 @@ void CameraMainWindow::postProcessVideo( const QString& infile, const QString& o qApp->processEvents(); - #ifndef QT_NO_DEBUG + #ifdef CAMERA_EXTRA_DEBUG QString tmpfilename; tmpfilename.sprintf( "/tmp/test/%04d.jpg", i ); @@ -622,11 +646,14 @@ void CameraMainWindow::postProcessVideo( const QString& infile, const QString& o framefile.close(); - odebug << "deleting temporary capturefile " << infile << oendl; - ::close( infd ); - QFile::remove( infile ); } avi_end( outfd, captureX, captureY, _framerate ); ::close( outfd ); + ::close( infd ); + + label->setText( "deleting temp files..." ); + qApp->processEvents(); + odebug << "deleting temporary capturefile " << infile << oendl; + QFile::remove( infile ); fr->hide(); @@ -644,4 +671,5 @@ void CameraMainWindow::updateCaption() else setCaption( "Opie-Camera: => CAPTURING <=" ); + qApp->processEvents(); } |