Mercurial > hg > soniczoomios
comparison grid.h @ 43:b91a1859829a
used UIkit sliders
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Apr 2013 18:50:04 +0100 |
parents | df7c08faf541 |
children | a1e75b94c505 |
comparison
equal
deleted
inserted
replaced
42:3d627dce8bf0 | 43:b91a1859829a |
---|---|
24 class Grid { | 24 class Grid { |
25 | 25 |
26 public: | 26 public: |
27 bool snapped; | 27 bool snapped; |
28 | 28 |
29 Hilbert hilbert; | |
29 | 30 |
30 Grid(); | 31 Grid(); |
31 ~Grid(); | 32 ~Grid(); |
32 void init(); | 33 void init(); |
33 void move(TwoVector moveP); // shift view by pixels | 34 void move(TwoVector moveP); // shift view by pixels |
36 typedef enum{NO_INTERPOLATION, INTERPOLATE_GRID, INTERPOLATE_PRESET} interpolateModeType; | 37 typedef enum{NO_INTERPOLATION, INTERPOLATE_GRID, INTERPOLATE_PRESET} interpolateModeType; |
37 interpolateModeType interpolateMode; | 38 interpolateModeType interpolateMode; |
38 void snapCheck(); | 39 void snapCheck(); |
39 void shiftCentreToSnapped(); | 40 void shiftCentreToSnapped(); |
40 void draw(); | 41 void draw(); |
41 void drawGridLines(); | 42 |
42 void update(); // change according to zoom | 43 void update(); // change according to zoom |
43 double interpLevel; | 44 double interpLevel; |
44 int smallestGridSpacing; // number of pixels when small grid dissappears from view | 45 int smallestGridSpacing; // number of pixels when small grid dissappears from view |
45 vector<int> getParams(); | 46 vector<int> getParams(); |
46 TwoVector getCoord(); | 47 TwoVector getCoord(); |
55 TwoVector coordToPixel(TwoVector coord); | 56 TwoVector coordToPixel(TwoVector coord); |
56 void setScale(double scaleLevel); | 57 void setScale(double scaleLevel); |
57 // the inverse stuff | 58 // the inverse stuff |
58 void setParams(vector<int>); | 59 void setParams(vector<int>); |
59 TwoVector getCoordForPresetSave(); | 60 TwoVector getCoordForPresetSave(); |
61 | |
62 // experimental | |
63 void changeNumberOfParamsPerDim(); | |
60 private: | 64 private: |
65 void drawGridLines(); | |
61 double scale; // surface units per pixel GUI | 66 double scale; // surface units per pixel GUI |
62 | 67 |
63 const double maxValue; // width of entire space | 68 double maxValue; // width of entire space |
64 const double minValue; // smallest zoom | 69 const double minValue; // smallest zoom |
65 int paramsPerDim; // no of parameters per dimension ( | 70 int paramsPerDim; // no of parameters per dimension ( |
66 int paramBitDepth; // number of bits for the parameter control data - i.e. always 7 for midi CC | 71 int paramBitDepth; // number of bits for the parameter control data - i.e. always 7 for midi CC |
67 | 72 |
68 | 73 |
77 TwoVector snapDist; // number of pixels to snap to GUI | 82 TwoVector snapDist; // number of pixels to snap to GUI |
78 Preset * closestPreset; // pointer to the currently selected (snapped to ) preset.. NULL if none. | 83 Preset * closestPreset; // pointer to the currently selected (snapped to ) preset.. NULL if none. |
79 | 84 |
80 bool maxZoom, minZoom; | 85 bool maxZoom, minZoom; |
81 | 86 |
82 | 87 vector<int> midiCC; // the actual params |
83 | |
84 int midiCC[10]; // the actual params SHOULD BE INITED FROM 2*paramsPerDim | |
85 | 88 |
86 // private functions | 89 // private functions |
87 | 90 |
88 | 91 |
89 void checkLimits(); | 92 void checkLimits(); |