annotate matchAnnotationSrc/testApp.h @ 50:158f5f38e9d3

outputting exact difference for annotations, comparison with match annotations is now working over all rwc files
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Thu, 29 Mar 2012 13:41:59 +0100
parents 3ce6dadd8167
children ef30f465a904
rev   line source
andrew@49 1 #pragma once
andrew@49 2
andrew@49 3 #include "ofMain.h"
andrew@49 4
andrew@49 5 #include "Annotations.h"
andrew@49 6 #include "matchAnnotations.h"
andrew@49 7 #include "jnmrMidiPlayerAnnotations.h"
andrew@49 8
andrew@50 9 struct TimingResult{
andrew@50 10 double median;
andrew@50 11 double mean;
andrew@50 12 int count;
andrew@50 13 double percentileCount[7];
andrew@50 14 double percentiles[7];
andrew@50 15 int type;
andrew@50 16 };
andrew@50 17
andrew@49 18 class testApp : public ofBaseApp{
andrew@49 19
andrew@49 20 public:
andrew@49 21 void setup();
andrew@49 22 void update();
andrew@49 23 void draw();
andrew@49 24
andrew@49 25 void keyPressed (int key);
andrew@49 26 void keyReleased(int key);
andrew@49 27 void mouseMoved(int x, int y );
andrew@49 28 void mouseDragged(int x, int y, int button);
andrew@49 29 void mousePressed(int x, int y, int button);
andrew@49 30 void mouseReleased(int x, int y, int button);
andrew@49 31 void windowResized(int w, int h);
andrew@49 32 void dragEvent(ofDragInfo dragInfo);
andrew@49 33 void gotMessage(ofMessage msg);
andrew@49 34
andrew@49 35 Annotations rwcAnnotations;
andrew@49 36
andrew@49 37 void loadRWCfileNumber(const int& i);
andrew@49 38 vector<std::string> rwcFileNameStrings;
andrew@49 39 void createRWCfilenameStrings();
andrew@49 40 string annotationRoot ;
andrew@49 41 std::string makeRWCfilename(std::string& root, const int& fileID, std::string& endPart);
andrew@49 42 void loadAnnotation(const int& fileID);
andrew@49 43
andrew@49 44 string matchPath;
andrew@50 45 std::string makeMatchFilename( const int& fileID, std::string matchEnd);
andrew@49 46
andrew@49 47 matchAnnotations matchNotations;
andrew@49 48
andrew@49 49 string jnmrPlayerPath, jnmrPlayerRoot;
andrew@49 50 jnmrMidiPlayerAnnotations jnmrPlayerAnnotations;
andrew@49 51
andrew@50 52 void calculateMatchErrors(TimingResult& t);
andrew@50 53 void calculateMatchForwardErrors(TimingResult& t);
andrew@49 54
andrew@50 55 void sortDifferenceVector(vector<float> diffVec, TimingResult& t);
andrew@50 56 void addToPercentiles(float value, TimingResult& t);
andrew@50 57
andrew@50 58 vector<TimingResult> matchOF_results;
andrew@50 59 vector<TimingResult> matchOB_results;
andrew@50 60 vector<TimingResult> JNMR_MidiMatcher_results;
andrew@50 61
andrew@50 62 void getResults(const int& fileID);
andrew@50 63 int fileNumberToTest;
andrew@49 64 };