andrew@2
|
1 /*
|
andrew@2
|
2 * PreciseOnsetVisualiser.h
|
andrew@2
|
3 * ofxPreciseOnsetDetectionOffline
|
andrew@2
|
4 *
|
andrew@2
|
5 * Created by Andrew Robertson on 28/12/2013.
|
andrew@2
|
6 * Copyright 2013 QMUL. All rights reserved.
|
andrew@2
|
7 *
|
andrew@2
|
8 */
|
andrew@2
|
9
|
andrew@2
|
10 #ifndef PRECISE_ONSET_VISUALISER
|
andrew@2
|
11 #define PRECISE_ONSET_VISUALISER
|
andrew@2
|
12
|
andrew@2
|
13 #include "PreciseOnsetDetectorOffline.h"
|
andrew@2
|
14
|
andrew@2
|
15 #include "ofxWindowRegion.h"
|
Venetian@7
|
16 #include "ofxPlotOnsetFunction.h"
|
andrew@2
|
17
|
andrew@2
|
18 class PreciseOnsetVisualiser{
|
andrew@2
|
19 public:
|
andrew@2
|
20 PreciseOnsetVisualiser();
|
andrew@2
|
21 ~PreciseOnsetVisualiser();
|
andrew@2
|
22
|
andrew@2
|
23 void newFile();
|
andrew@2
|
24 void update();
|
andrew@2
|
25 void draw();
|
Venetian@7
|
26
|
Venetian@7
|
27 void drawOnsetInfo(std::vector<OnsetInfo> onsetList, ofxWindowRegion& window, double startTime, double endTime);
|
Venetian@7
|
28
|
andrew@3
|
29 double positionSeconds();
|
andrew@4
|
30 double windowWidth();
|
andrew@2
|
31
|
andrew@2
|
32 void mousePressed(int& x, int& y);
|
andrew@2
|
33 void togglePlay();
|
andrew@3
|
34 void stop();
|
andrew@2
|
35
|
andrew@2
|
36 void resetWindow();
|
andrew@2
|
37 void cropStart();
|
andrew@2
|
38 void cropEnd();
|
andrew@3
|
39 void cropStartSeconds(double& val);
|
andrew@3
|
40 void cropEndSeconds(double& val);
|
andrew@2
|
41
|
andrew@4
|
42 void zoomIn();
|
andrew@4
|
43 void zoomOut();
|
andrew@4
|
44
|
andrew@4
|
45 void scrollLeft();
|
andrew@4
|
46 void scrollRight();
|
andrew@6
|
47 void scrollRightSecs(double secs);
|
andrew@6
|
48 void scrollLeftSecs(double secs);
|
andrew@6
|
49
|
andrew@4
|
50 void checkPosition();
|
andrew@6
|
51 void setPositionSeconds(double secs);
|
andrew@6
|
52
|
andrew@6
|
53 double lengthSeconds();
|
andrew@4
|
54
|
Venetian@7
|
55 void keyPressed(int key);
|
Venetian@7
|
56
|
andrew@2
|
57 //vars
|
andrew@2
|
58 PreciseOnsetDetectorOffline* pod;
|
andrew@2
|
59 ofSoundPlayer soundPlay;
|
andrew@2
|
60 bool paused;
|
andrew@2
|
61 // void drawOnsets(DoubleVector& onsetTimesSeconds, ofxWindowregion& window, double startTime, double endTime);
|
andrew@2
|
62
|
andrew@2
|
63 ofxWindowRegion window;
|
Venetian@7
|
64 ofxPlotOnsetFunction plotter;
|
andrew@2
|
65
|
andrew@2
|
66 double windowStart, windowEnd, windowPress;
|
andrew@6
|
67
|
andrew@6
|
68 double currentPlayPosition;
|
Venetian@7
|
69
|
Venetian@7
|
70 std::string title;
|
andrew@2
|
71 };
|
andrew@2
|
72 #endif |