MCPcopy Create free account
hub / github.com/AndrewBelt/WaveEdit / waveLine

Function waveLine

src/widgets.cpp:42–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42static void waveLine(float *points, int pointsLen, float startIndex, float endIndex, float startValue, float endValue) {
43 // Switch indices if out of order
44 if (startIndex > endIndex) {
45 float tmpIndex = startIndex;
46 startIndex = endIndex;
47 endIndex = tmpIndex;
48 float tmpValue = startValue;
49 startValue = endValue;
50 endValue = tmpValue;
51 }
52
53 int startI = maxi(0, roundf(startIndex));
54 int endI = mini(pointsLen - 1, roundf(endIndex));
55 for (int i = startI; i <= endI; i++) {
56 float frac = (startIndex < endIndex) ? rescalef(i, startIndex, endIndex, 0.0, 1.0) : 0.0;
57 points[i] = crossf(startValue, endValue, frac);
58 }
59}
60
61
62static void waveSmooth(float *points, int pointsLen, float index) {

Callers 1

editorBehaviorFunction · 0.85

Calls 4

maxiFunction · 0.85
miniFunction · 0.85
rescalefFunction · 0.85
crossfFunction · 0.85

Tested by

no test coverage detected