andrew@2: /* andrew@2: * PreciseOnsetVisualiser.h andrew@2: * ofxPreciseOnsetDetectionOffline andrew@2: * andrew@2: * Created by Andrew Robertson on 28/12/2013. andrew@2: * Copyright 2013 QMUL. All rights reserved. andrew@2: * andrew@2: */ andrew@2: andrew@2: #ifndef PRECISE_ONSET_VISUALISER andrew@2: #define PRECISE_ONSET_VISUALISER andrew@2: andrew@2: #include "PreciseOnsetDetectorOffline.h" andrew@2: andrew@2: #include "ofxWindowRegion.h" Venetian@7: #include "ofxPlotOnsetFunction.h" andrew@2: andrew@2: class PreciseOnsetVisualiser{ andrew@2: public: andrew@2: PreciseOnsetVisualiser(); andrew@2: ~PreciseOnsetVisualiser(); andrew@2: andrew@2: void newFile(); andrew@2: void update(); andrew@2: void draw(); Venetian@7: Venetian@7: void drawOnsetInfo(std::vector onsetList, ofxWindowRegion& window, double startTime, double endTime); Venetian@7: andrew@3: double positionSeconds(); andrew@4: double windowWidth(); andrew@2: andrew@2: void mousePressed(int& x, int& y); andrew@2: void togglePlay(); andrew@3: void stop(); andrew@2: andrew@2: void resetWindow(); andrew@2: void cropStart(); andrew@2: void cropEnd(); andrew@3: void cropStartSeconds(double& val); andrew@3: void cropEndSeconds(double& val); andrew@2: andrew@4: void zoomIn(); andrew@4: void zoomOut(); andrew@4: andrew@4: void scrollLeft(); andrew@4: void scrollRight(); andrew@6: void scrollRightSecs(double secs); andrew@6: void scrollLeftSecs(double secs); andrew@6: andrew@4: void checkPosition(); andrew@6: void setPositionSeconds(double secs); andrew@6: andrew@6: double lengthSeconds(); andrew@4: Venetian@7: void keyPressed(int key); Venetian@7: andrew@2: //vars andrew@2: PreciseOnsetDetectorOffline* pod; andrew@2: ofSoundPlayer soundPlay; andrew@2: bool paused; andrew@2: // void drawOnsets(DoubleVector& onsetTimesSeconds, ofxWindowregion& window, double startTime, double endTime); andrew@2: andrew@2: ofxWindowRegion window; Venetian@7: ofxPlotOnsetFunction plotter; andrew@2: andrew@2: double windowStart, windowEnd, windowPress; andrew@6: andrew@6: double currentPlayPosition; Venetian@7: Venetian@7: std::string title; andrew@2: }; andrew@2: #endif