append investigation

This commit is contained in:
Hiro Protagonist 2017-03-23 20:10:54 +13:00
parent 517343f6de
commit 8ec73c978c
2 changed files with 11 additions and 7 deletions

View file

@ -3,7 +3,7 @@
// FIXME: Dir Set... // FIXME: Dir Set...
using namespace FlyCapture2; using namespace FlyCapture2;
Recorder::Recorder( QObject * parent, unsigned int frame_rate, bool cap_frames ) : QObject( parent ), is_recording {false}, frame_number {frame_n}, time_captured {time_c}, frame_n {0}, time_c {0}, project_dir( "" ) { Recorder::Recorder( QObject * parent, unsigned int frame_rate, bool cap_frames ) : QObject( parent ), is_recording {false}, frame_number {frame_n}, time_captured {time_c}, frame_n {0}, time_c {0}, baseDir( "" ) {
// No Compression for frame_captures // No Compression for frame_captures
frame_options.compression = frame_options.NONE; frame_options.compression = frame_options.NONE;
options.frameRate = frame_rate; options.frameRate = frame_rate;
@ -21,7 +21,7 @@ void Recorder::setProjectDir( QString &p_dir ) {
return; return;
} }
project_dir = QDir( p_dir ); baseDir = QDir( p_dir );
} }
// TODO: Write to statfile! // TODO: Write to statfile!
@ -37,7 +37,7 @@ void Recorder::newRecording( QString r_name ) {
rec_name = r_name; rec_name = r_name;
// Verify Recdir... create directories... // Verify Recdir... create directories...
record_dir = QDir( project_dir.path() + "/" + rec_name ); record_dir = QDir( baseDir.path() + "/" + rec_name );
// Change to try/catch // Change to try/catch
RecorderError err = verifyRecDir(); RecorderError err = verifyRecDir();
if( err != RecorderError::OK ) { if( err != RecorderError::OK ) {
@ -119,7 +119,11 @@ RecorderError Recorder::verifyRecDir() {
} }
} }
project_dir.mkdir( rec_name ); baseDir.mkdir( rec_name );
if(capture_frames)
record_dir.mkdir( "frames" );
return RecorderError::OK; return RecorderError::OK;
} }

View file

@ -43,7 +43,7 @@ class Recorder : public QObject {
void stopRecording(); void stopRecording();
QString getProjectDir() { QString getProjectDir() {
return project_dir.absolutePath(); return baseDir.absolutePath();
} }
QString getRecName() { QString getRecName() {
@ -64,7 +64,7 @@ class Recorder : public QObject {
} }
bool dirSet() { bool dirSet() {
return ( project_dir.path() != "" ); return ( baseDir.path() != "" );
} }
bool captureFrames() { bool captureFrames() {
@ -97,7 +97,7 @@ class Recorder : public QObject {
unsigned int frame_n; unsigned int frame_n;
double time_c; double time_c;
QDir project_dir; QDir baseDir;
QDir record_dir; QDir record_dir;
QString rec_name; QString rec_name;