andrew@16: /* andrew@16: * AccompanimentSynchroniser.h andrew@16: * MultipleAudioMathcher andrew@16: * andrew@16: * Created by Andrew on 06/02/2012. andrew@16: * Copyright 2012 QMUL. All rights reserved. andrew@16: * andrew@16: */ andrew@16: andrew@16: andrew@16: #ifndef ACCOMPANIMENT_SYNCHRONISER_H andrew@16: #define ACCOMPANIMENT_SYNCHRONISER_H andrew@16: andrew@16: #include "ofxOsc.h" andrew@16: #define HOST "localhost" andrew@16: #define SENDER_PORT 10875 andrew@16: andrew@16: #include "ofMain.h" andrew@16: andrew@16: andrew@16: class AccompanimentSynchroniser{ andrew@16: andrew@16: public: andrew@16: AccompanimentSynchroniser(); andrew@16: andrew@16: void setPlayingRatio(const double& ratio, const double& timePlayed); andrew@16: void setRecordedPosition(); andrew@16: void updateRecordedPosition(const double& currentAlignmentPosition); andrew@16: andrew@16: void updateOutputSpeed(); andrew@16: andrew@16: double fileLengthSamples; andrew@16: andrew@16: andrew@16: andrew@16: double playingPositionRatio; andrew@16: double playingPositionSamples; andrew@16: double playingPositionMillis; andrew@16: double playingPositionTimeSent; andrew@16: andrew@16: private: andrew@16: andrew@16: double recordedPositionMillis; andrew@16: andrew@16: double speed; andrew@16: andrew@16: ofxOscSender sender; andrew@16: void sendSpeed(double const& val); andrew@16: andrew@16: }; andrew@16: #endif