MCPcopy Create free account
hub / github.com/audacity/audacity / ValueOfPixel

Method ValueOfPixel

src/EnvelopeEditor.cpp:138–150  ·  view source on GitHub ↗

ValueOfPixel() converts a y position on screen to an envelope value. @param y - y position, usually of the mouse.relative to the clip. @param height - height of the rectangle we are in. @upper - true if we are on the upper line, false if on lower. @dB - display mode either linear or log. @zoomMin - vertical scale, typically -1.0 @zoomMax - vertical scale, typically +1.0

Source from the content-addressed store, hash-verified

136/// @zoomMin - vertical scale, typically -1.0
137/// @zoomMax - vertical scale, typically +1.0
138float EnvelopeEditor::ValueOfPixel( int y, int height, bool upper,
139 bool dB, double dBRange,
140 float zoomMin, float zoomMax)
141{
142 float v = ::ValueOfPixel(y, height, 0 != mContourOffset, dB, dBRange, zoomMin, zoomMax);
143
144 // MB: this is mostly equivalent to what the old code did, I'm not sure
145 // if anything special is needed for asymmetric ranges
146 if(upper)
147 return mEnvelope.ClampValue(v);
148 else
149 return mEnvelope.ClampValue(-v);
150}
151
152/// HandleMouseButtonDown either finds an existing control point or adds a NEW one
153/// which is then recorded as the point to drag.

Callers

nothing calls this directly

Calls 1

ValueOfPixelFunction · 0.85

Tested by

no test coverage detected