auto in lambdas
This commit is contained in:
parent
f405e2c23f
commit
70743900b5
3 changed files with 3 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ namespace sfz {
|
|||
template <class Type>
|
||||
void ADSREnvelope<Type>::reset(const Region& region, const MidiState& state, int delay, uint8_t velocity, float sampleRate) noexcept
|
||||
{
|
||||
auto secondsToSamples = [sampleRate](auto timeInSeconds) {
|
||||
auto secondsToSamples = [sampleRate](Type timeInSeconds) {
|
||||
return static_cast<int>(timeInSeconds * sampleRate);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void EventEnvelope<Type>::prepareEvents(int blockLength)
|
|||
if (resetEvents)
|
||||
clear();
|
||||
|
||||
absl::c_stable_sort(events, [](const auto& lhs, const auto& rhs) {
|
||||
absl::c_stable_sort(events, [](const std::pair<int, Type>& lhs, const std::pair<int, Type>& rhs) {
|
||||
return lhs.first < rhs.first;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1011,7 +1011,7 @@ float sfz::Region::velocityCurve(uint8_t velocity) const noexcept
|
|||
float gain { 1.0f };
|
||||
|
||||
if (velocityPoints.size() > 0) { // Custom velocity curve
|
||||
auto after = std::find_if(velocityPoints.begin(), velocityPoints.end(), [velocity](auto& val) { return val.first >= velocity; });
|
||||
auto after = std::find_if(velocityPoints.begin(), velocityPoints.end(), [velocity](const std::pair<int, float>& val) { return val.first >= velocity; });
|
||||
auto before = after == velocityPoints.begin() ? velocityPoints.begin() : after - 1;
|
||||
// Linear interpolation
|
||||
float relativePositionInSegment {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue