view annotationCalculatorSrc/BeatAnnotationReader.h @ 56:4394c9490716 tip

minor changes
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 24 Dec 2012 18:58:39 +0000
parents ba36a1721538
children
line wrap: on
line source
/*
 *  BeatAnnotationReader.h
 *  annotationResultCalculator
 *
 *  Created by Andrew on 03/05/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */

#ifndef BEAT_ANNOTATION_READER
#define BEAT_ANNOTATION_READER

#include "ofMain.h"

// basic file operations for text file stuff
#include <iostream>
#include <fstream>
using namespace std;


class BeatAnnotationReader{
public:	
	typedef std::vector<double> DoubleVector;
	DoubleVector beatTimes;
	DoubleVector errors;
	DoubleVector absoluteErrors;
	
	typedef std::vector<DoubleVector> DoubleMatrix;
	DoubleMatrix alignmentTimes;
	
	void readInBeatsFile(std::string& pathName);
	void printBeatTimes();
	
	void readInMultiAlignmentFile(std::string pathName);
	

//	typedef vector<DoubleVector> DoubleMatrix;
	double calculateMedianError(const DoubleVector& liveBeatTimes, const DoubleVector& groundTruthAlignment);
	double calculateMedianError(const DoubleVector& liveBeatTimes, const DoubleVector& groundTruthAlignment, const DoubleVector& alignmentLiveTimes, const DoubleVector& alignmentRehearsalTimes);

	//double getAlignmentErrorAtTime(const double& liveTime);
};
#endif