// Stop the record
//----------------------------------------
bool ofxOpenNIRecorder::stopRecord() {
	
	if(is_recording){
		
		if (config.record_type == ONI_STREAMING) {
			
			recorder.Release();
			printf("Stopped streaming recording: %s\n", config.record_name.c_str());
			
		} else if (config.record_type == ONI_CYCLIC) {
			
			startRecord(config.record_name); // second call to startRecording dumps the buffer to file
			printf("Stopped cyclic recording: %s\n", config.record_name.c_str());
			
		}
		
		// summarise dropped frames
		if (config.record_depth) printf("Missed %d of %d depth frames (%5.2f%%)\n", 
										nMissedDepthFrames, 
										(nMissedDepthFrames+nDepthFrames), 
										(nMissedDepthFrames*100.0)/(nMissedDepthFrames + nDepthFrames));
		if (config.record_image) printf("Missed %d of %d image frames (%5.2f%%)\n", 
										nMissedImageFrames, 
										(nMissedImageFrames+nImageFrames), 
										(nMissedImageFrames*100.0)/(nMissedImageFrames+nImageFrames));
		
		is_recording = false;
		
	}
	return true;
}
void MainWindow::record() {
    if (recording) {
        stopRecord();
    } else {
       startRecord();
    };
};
KinectRecorderWindow::KinectRecorderWindow(int fps, KinectDevice* device)
    : QMainWindow()
    , fps_(fps)
    , device_(device)
    , widget_viewer_(new KinectViewerWidget(fps, device))
{
    widget_viewer_->setMinimumSize(1280, 480);
    widget_viewer_->setMaximumSize(1280, 480);
    setCentralWidget(widget_viewer_);

    QDockWidget *dock = new QDockWidget(this);
    dock->setAllowedAreas(Qt::BottomDockWidgetArea);
    dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
    widget_record_ = new RecordInterfaceWidget(dock);
    connect(widget_record_, SIGNAL(dialogOpened()), widget_viewer_, SLOT(pause()));
    connect(widget_record_, SIGNAL(dialogClosed()), widget_viewer_, SLOT(resume()));
    connect(widget_record_, SIGNAL(destroyed(QObject*)), this, SLOT(close()));
    connect(widget_record_, SIGNAL(startRecord(std::string)), this, SLOT(recordStarted(std::string)));
    connect(widget_record_, SIGNAL(finishRecord()), this, SLOT(recordFinished()));
    widget_record_->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    dock->setWidget(widget_record_);
    addDockWidget(Qt::BottomDockWidgetArea, dock);

    setWindowTitle("Kinect viewer");
    move(100, 100);
    setAttribute(Qt::WA_DeleteOnClose);
}
void RecordInterfaceWidget::testToggled(bool checked)
{
    if (checked)
        emit startRecord(line_edit_->text().toStdString());
    else
        emit finishRecord();
}
Example #5
0
int recordEvent(char* recFile)
{

    gRFilePath = recFile;
    struct sigaction sa;
    sa.sa_handler = signal_handler;
    sigemptyset(&sa.sa_mask);
    sa.sa_flags = 0;

    if (sigaction(SIGINT, &sa, NULL) < 0)
    {
        printf("Failed install signal handler: %s\n", strerror(errno));
        return -1;
    }

    if (recFile == NULL)
        gRFile = stdout;
    else
    {
        gRFile = fopen(recFile, "wt");
        if (gRFile == NULL)
        {
            printf("Failed open output file '%s': %s\n", recFile, strerror(errno));
            return -1;
        }
    }
    return startRecord();
}
  void run()
  {
    startRecord();

    display();

    stopRecord();
  }
Example #7
0
    void ESMWriter::startRecord (uint32_t name, uint32_t flags)
    {
        std::string type;
        for (int i=0; i<4; ++i)
            /// \todo make endianess agnostic
            type += reinterpret_cast<const char *> (&name)[i];

        startRecord (type, flags);
    }
Example #8
0
void ofApp::keyPressed(int key) {
	if(key == ' ') {
		switch(mode) {
			case PREVIEW: stopPreview(); startRecord(); break;
			case RECORD: stopRecord(); startPlayback(); break;
			case PLAYBACK: stopPlayback(); startPreview(); break;
		}
	}
}
Example #9
0
// автостарт записи
void autoStartRecord(){
    string mediaStreams = xmlGetString(config, "record");
    vector<string> arrayMediaStreams = xmlGetArrayTags(mediaStreams, "mediaStream");
    static string mediaStreamId;

    for(vector<string>::const_iterator it = arrayMediaStreams.begin(); it !=arrayMediaStreams.end(); ++it){
        if (xmlGetBool(*it, "autoStartRecord")){
            mediaStreamId = xmlGetString(*it, "mediaStreamId");
            startRecord(mediaStreamId);
        }
    }
}
Example #10
0
    void ESMWriter::save(std::ostream& file)
    {
        mRecordCount = 0;
        mRecords.clear();
        mCounting = true;
        mStream = &file;

        startRecord("TES3", 0);

        mHeader.save (*this);

        endRecord("TES3");
    }
Example #11
0
void ESMWriter::save(std::ostream& file)
{
    m_recordCount = 0;
    m_stream = &file;

    startRecord("TES3", 0);

    m_header.records = 0;
    writeHNT("HEDR", m_header, 300);
    m_headerPos = m_stream->tellp() - (std::streampos)4;

    for (std::list<MasterData>::iterator it = m_masters.begin(); it != m_masters.end(); ++it)
    {
        writeHNCString("MAST", it->name);
        writeHNT("DATA", it->size);
    }

    endRecord("TES3");
}