view src/AccompanimentSynchroniser.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 5274e3b5479d
children
line wrap: on
line source
/*
 *  AccompanimentSynchroniser.h
 *  MultipleAudioMathcher
 *
 *  Created by Andrew on 06/02/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */


#ifndef ACCOMPANIMENT_SYNCHRONISER_H
#define ACCOMPANIMENT_SYNCHRONISER_H

#include "ofxOsc.h"
#define HOST "localhost"
#define SENDER_PORT 10875

#include "ofMain.h"


class AccompanimentSynchroniser{
	
public:
	AccompanimentSynchroniser();
	
	void reset();
	
	void setPlayingRatio(const double& ratio, const double& timePlayed);
	void setRecordedPosition();
	void updateRecordedPosition(const double& currentAlignmentPosition, const double& timeSent);
	
	void updateOutputSpeed();
	
	int counter ;
	
	double fileLengthSamples;
	

	
	double playingPositionRatio;
	double playingPositionSamples;
	double playingPositionMillis;
	double playingPositionTimeSent;
	
	double recordedPositionMillis;
	double recordedPositionTimeSent;

	double speed, smoothedSpeedOutput;
	double movingAverageWeighting, difference;

private:
	

	ofxOscSender sender;
	void sendSpeed(double const& val);

};
#endif