view src/OutputDataWriter.cpp @ 49:8df911733fdc

Added new histogram functions - absolute error graphs like Match paper
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 22 May 2012 22:53:44 +0100
parents b7ad807c9cde
children e359b9bad811
line wrap: on
line source
/*
 *  outputDataWriter.cpp
 *  MultipleAudioMathcher
 *
 *  Created by Andrew on 25/04/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */

#include "OutputDataWriter.h"

OutputDataWriter::OutputDataWriter(){
	filepath = "../../../data/output.txt";
	openFile();
}

void OutputDataWriter::writeOutput(const int& liveTime, const int& rehearsalTime, const int& playedRehearsalTime){
	
	if (outputFile.is_open()){
		outputFile << liveTime/1000.0 << "\t" << rehearsalTime/1000.0 << "\t" << playedRehearsalTime/1000.0 << endl;
	}
}

void OutputDataWriter::openFile(){
	if (!outputFile.is_open())
	outputFile.open(filepath.c_str());
}

void OutputDataWriter::closeFile(){
	if (outputFile.is_open())
		outputFile.close();
}