view ofxPreciseOnsetDetectorOffline/PreciseOnsetVisualiser.h @ 8:184a7c232049 tip

changed files since updating computer
author Venetian
date Thu, 14 Aug 2014 17:53:57 +0100
parents b1c13e8bec26
children
line wrap: on
line source
/*
 *  PreciseOnsetVisualiser.h
 *  ofxPreciseOnsetDetectionOffline
 *
 *  Created by Andrew Robertson on 28/12/2013.
 *  Copyright 2013 QMUL. All rights reserved.
 *
 */

#ifndef PRECISE_ONSET_VISUALISER
#define PRECISE_ONSET_VISUALISER

#include "PreciseOnsetDetectorOffline.h"

#include "ofxWindowRegion.h"
#include "ofxPlotOnsetFunction.h" 

class PreciseOnsetVisualiser{
public:
	PreciseOnsetVisualiser();
	~PreciseOnsetVisualiser();
	
	void newFile();
	void update();
	void draw();
	
	void drawOnsetInfo(std::vector<OnsetInfo> onsetList, ofxWindowRegion& window, double startTime, double endTime);
	
	double positionSeconds();
	double windowWidth();
	
	void mousePressed(int& x, int& y);
	void togglePlay();
	void stop();
	
	void resetWindow();
	void cropStart();
	void cropEnd();
	void cropStartSeconds(double& val);
	void cropEndSeconds(double& val);
	
	void zoomIn();
	void zoomOut();
	
	void scrollLeft();
	void scrollRight();
	void scrollRightSecs(double secs);
	void scrollLeftSecs(double secs);

	void checkPosition();
	void setPositionSeconds(double secs);
	
	double lengthSeconds();
	
	void keyPressed(int key);
	
	//vars
	PreciseOnsetDetectorOffline* pod;
	ofSoundPlayer soundPlay;
	bool paused;
//	void drawOnsets(DoubleVector& onsetTimesSeconds, ofxWindowregion& window, double startTime, double endTime);

	ofxWindowRegion window;
	ofxPlotOnsetFunction plotter;
	
	double windowStart, windowEnd, windowPress;
	
	double currentPlayPosition;
	
	std::string title;
};
#endif