Files
lmms/plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp
Michael Gregorius ffcf8c261d Add private setters for "from" and "to" (#7071)
* Add private setters for "from" and "to"

Add private setters for the "from" and "to" values in `AudioFileProcessorWaveView`. When being used the setters will ensure that the bounds are respected.

Also add a `range` method because this computation was done repeatedly throughout the code.

Fixes #7068 but masks some of the original problems with the code that computes out-of-bounds values for "from" and "to" like the `slide` method. Problematic code can still be found by temporarily adding the following assertions to the setters:
* `assert (to <= m_sample->sampleSize());` in `setTo`
* `assert (from >= 0);` in `setFrom`

* Remove superfluous calls to qMax and qMin
2024-01-24 18:12:42 +01:00

13 KiB