diff src/OutputDataWriter.cpp @ 43:b7ad807c9cde

Added annotation writing and the src for the result calculator
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 04 May 2012 15:33:36 +0100
parents
children e359b9bad811
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/OutputDataWriter.cpp	Fri May 04 15:33:36 2012 +0100
@@ -0,0 +1,32 @@
+/*
+ *  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();
+}
\ No newline at end of file