annotate 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
rev   line source
andrew@16 1 /*
andrew@16 2 * AccompanimentSynchroniser.h
andrew@16 3 * MultipleAudioMathcher
andrew@16 4 *
andrew@16 5 * Created by Andrew on 06/02/2012.
andrew@16 6 * Copyright 2012 QMUL. All rights reserved.
andrew@16 7 *
andrew@16 8 */
andrew@16 9
andrew@16 10
andrew@16 11 #ifndef ACCOMPANIMENT_SYNCHRONISER_H
andrew@16 12 #define ACCOMPANIMENT_SYNCHRONISER_H
andrew@16 13
andrew@16 14 #include "ofxOsc.h"
andrew@16 15 #define HOST "localhost"
andrew@16 16 #define SENDER_PORT 10875
andrew@16 17
andrew@16 18 #include "ofMain.h"
andrew@16 19
andrew@16 20
andrew@16 21 class AccompanimentSynchroniser{
andrew@16 22
andrew@16 23 public:
andrew@16 24 AccompanimentSynchroniser();
andrew@16 25
andrew@17 26 void reset();
andrew@17 27
andrew@16 28 void setPlayingRatio(const double& ratio, const double& timePlayed);
andrew@16 29 void setRecordedPosition();
andrew@17 30 void updateRecordedPosition(const double& currentAlignmentPosition, const double& timeSent);
andrew@16 31
andrew@16 32 void updateOutputSpeed();
andrew@16 33
andrew@17 34 int counter ;
andrew@17 35
andrew@16 36 double fileLengthSamples;
andrew@16 37
andrew@16 38
andrew@16 39
andrew@16 40 double playingPositionRatio;
andrew@16 41 double playingPositionSamples;
andrew@16 42 double playingPositionMillis;
andrew@16 43 double playingPositionTimeSent;
andrew@16 44
andrew@17 45 double recordedPositionMillis;
andrew@39 46 double recordedPositionTimeSent;
andrew@53 47
andrew@53 48 double speed, smoothedSpeedOutput;
andrew@53 49 double movingAverageWeighting, difference;
andrew@53 50
andrew@16 51 private:
andrew@16 52
andrew@53 53
andrew@16 54 ofxOscSender sender;
andrew@16 55 void sendSpeed(double const& val);
andrew@16 56
andrew@16 57 };
andrew@16 58 #endif