Converts a frequency to screen y position.
| 63 | { |
| 64 | /// Converts a frequency to screen y position. |
| 65 | wxInt64 FrequencyToPosition(const WaveChannel &wc, |
| 66 | double frequency, |
| 67 | wxInt64 trackTopEdge, |
| 68 | int trackHeight) |
| 69 | { |
| 70 | const auto &settings = SpectrogramSettings::Get(wc); |
| 71 | float minFreq, maxFreq; |
| 72 | SpectrogramBounds::Get(wc).GetBounds(wc, minFreq, maxFreq); |
| 73 | const NumberScale numberScale(settings.GetScale(minFreq, maxFreq)); |
| 74 | const float p = numberScale.ValueToPosition(frequency); |
| 75 | return trackTopEdge + wxInt64((1.0 - p) * trackHeight); |
| 76 | } |
| 77 | |
| 78 | /// Converts a position (mouse Y coordinate) to |
| 79 | /// frequency, in Hz. |
nothing calls this directly
no test coverage detected