Mercurial > hg > multitrack-audio-matcher
annotate src/OutputDataWriter.cpp @ 46:ba36a1721538
Added abs median calculation, match forwards and backwards paths
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Tue, 08 May 2012 23:16:00 +0100 |
parents | b7ad807c9cde |
children | e359b9bad811 |
rev | line source |
---|---|
andrew@43 | 1 /* |
andrew@43 | 2 * outputDataWriter.cpp |
andrew@43 | 3 * MultipleAudioMathcher |
andrew@43 | 4 * |
andrew@43 | 5 * Created by Andrew on 25/04/2012. |
andrew@43 | 6 * Copyright 2012 QMUL. All rights reserved. |
andrew@43 | 7 * |
andrew@43 | 8 */ |
andrew@43 | 9 |
andrew@43 | 10 #include "OutputDataWriter.h" |
andrew@43 | 11 |
andrew@43 | 12 OutputDataWriter::OutputDataWriter(){ |
andrew@43 | 13 filepath = "../../../data/output.txt"; |
andrew@43 | 14 openFile(); |
andrew@43 | 15 } |
andrew@43 | 16 |
andrew@43 | 17 void OutputDataWriter::writeOutput(const int& liveTime, const int& rehearsalTime, const int& playedRehearsalTime){ |
andrew@43 | 18 |
andrew@43 | 19 if (outputFile.is_open()){ |
andrew@43 | 20 outputFile << liveTime/1000.0 << "\t" << rehearsalTime/1000.0 << "\t" << playedRehearsalTime/1000.0 << endl; |
andrew@43 | 21 } |
andrew@43 | 22 } |
andrew@43 | 23 |
andrew@43 | 24 void OutputDataWriter::openFile(){ |
andrew@43 | 25 if (!outputFile.is_open()) |
andrew@43 | 26 outputFile.open(filepath.c_str()); |
andrew@43 | 27 } |
andrew@43 | 28 |
andrew@43 | 29 void OutputDataWriter::closeFile(){ |
andrew@43 | 30 if (outputFile.is_open()) |
andrew@43 | 31 outputFile.close(); |
andrew@43 | 32 } |