Mercurial > hg > opencollidoscope
comparison CollidoscopeApp/include/DrawInfo.h @ 16:4dad0b810f18
Comment tidy up + attributions
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Tue, 16 Aug 2016 14:27:53 +0100 |
parents | a4a336624f5a |
children |
comparison
equal
deleted
inserted
replaced
15:5241f96479d6 | 16:4dad0b810f18 |
---|---|
56 mSelectionBarHeight = mWindowHeight / NUM_WAVES; | 56 mSelectionBarHeight = mWindowHeight / NUM_WAVES; |
57 mShrinkFactor = shrinkFactor; | 57 mShrinkFactor = shrinkFactor; |
58 } | 58 } |
59 | 59 |
60 /** | 60 /** |
61 * Maps a value in the audio space [-1.0, 1.0] to a position on the y axis of this DrawInf's bounding area. | 61 * Maps a value in the audio space [-1.0, 1.0] to a position on the y axis of this DrawInfo's bounding area. |
62 * | 62 * |
63 */ | 63 */ |
64 float audioToHeigt(float audioSample) const { | 64 float audioToHeigt(float audioSample) const { |
65 /* clip into range [-1.1] */ | 65 /* clip into range [-1.1] */ |
66 if (audioSample < -1.0f) { | 66 if (audioSample < -1.0f) { |
97 else | 97 else |
98 return mWindowHeight / (NUM_WAVES * 2); | 98 return mWindowHeight / (NUM_WAVES * 2); |
99 } | 99 } |
100 | 100 |
101 /** | 101 /** |
102 * Flips y according to the index of the wave. It is needed because the second wave in collidoscope is upside down from the orientation oftthe screen. | 102 * Flips y according to the index of the wave. It is needed because the second wave in collidoscope is drawn upside down in the screen. |
103 */ | 103 */ |
104 int flipY(int y) const | 104 int flipY(int y) const |
105 { | 105 { |
106 if ( mWaveIndex == 0) | 106 if ( mWaveIndex == 0) |
107 return mWindowHeight - y; | 107 return mWindowHeight - y; |
108 else | 108 else |
109 return y; | 109 return y; |
110 } | 110 } |
111 | 111 |
112 /** | 112 /** |
113 * Returns x. not used at he moment. | 113 * Returns x. not used at the moment. |
114 * | 114 * |
115 */ | 115 */ |
116 int flipX(int x) const | 116 int flipX(int x) const |
117 { | 117 { |
118 return x; | 118 return x; |