thestk / stk

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.
https://ccrma.stanford.edu/software/stk/
Other
1.03k stars 182 forks source link

Allow deriving classes from StkFrames #113

Closed vuki closed 3 years ago

vuki commented 3 years ago

This modification allows for creating classes that inherit from StkFrames.

In StkFrames class, private members were changed to protected. The following methods were made virtual: ~StkFrames, operator= and resize (both versions). These method allocate/free memory for the data pointer, so they have to be virtual.

An example usage is wrapping a pointer to buffer provided in a callback function into a custom class derived from StkFrames. Such a class may be passed to STK functions as an argument of StkFrames, using polymorphism.

The attached example is crtsine.cpp project from STK, reworked using a custom wrapper.

crtsine.cpp.txt