MCPcopy Create free account
hub / github.com/christophhart/HISE / createPath

Method createPath

hi_scripting/scripting/api/ScriptingApiObjects.cpp:1738–1772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1736}
1737
1738var ScriptingObjects::ScriptRingBuffer::createPath(var dstArea, var sourceRange, var startValue)
1739{
1740 auto r = Result::ok();
1741
1742 auto dst = ApiHelpers::getRectangleFromVar(dstArea, &r);
1743
1744 if (!r.wasOk())
1745 reportScriptError(r.getErrorMessage());
1746
1747 auto src = ApiHelpers::getRectangleFromVar(sourceRange, &r);
1748
1749 if (!r.wasOk())
1750 reportScriptError(r.getErrorMessage());
1751
1752 auto hToUse = (int)src.getHeight();
1753
1754 auto sp = new PathObject(getScriptProcessor());
1755
1756 if (SimpleRingBuffer::Ptr buffer = getRingBuffer())
1757 {
1758 auto maxSize = hToUse = getRingBuffer()->getReadBuffer().getNumSamples();
1759
1760 if (hToUse == -1)
1761 hToUse = maxSize;
1762
1763 Range<int> s_range(jmax<int>(0, (int)src.getWidth()), jmin<int>(maxSize, hToUse));
1764 Range<float> valueRange(jmax<float>(-1.0f, src.getX()), jmin<float>(1.0f, src.getY()));
1765
1766 SimpleReadWriteLock::ScopedReadLock sl(buffer->getDataLock());
1767
1768 sp->getPath() = getRingBuffer()->getPropertyObject()->createPath(s_range, valueRange, dst, startValue);
1769 }
1770
1771 return var(sp);
1772}
1773
1774void ScriptingObjects::ScriptRingBuffer::setActive(bool shouldBeActive)
1775{

Callers

nothing calls this directly

Calls 11

varFunction · 0.85
getReadBufferMethod · 0.80
wasOkMethod · 0.45
getErrorMessageMethod · 0.45
getHeightMethod · 0.45
getNumSamplesMethod · 0.45
getWidthMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45
getPathMethod · 0.45
getPropertyObjectMethod · 0.45

Tested by

no test coverage detected