|
Jamba C++ API
4.2.0
|
Functions | |
| template<typename T , typename... Args> | |
| std::shared_ptr< T > | make_sfo (Args &&...iArgs) |
The VST SDK uses the concept of FObject (which are self contained reference counted objects) but require to be manually managed (by calling addRef and release). More... | |
| std::string | toUT8String (VstString16 const &iString) |
Converts a VstString16 to a regular std::string that is properly utf-8 encoded. More... | |
| template<typename T > | |
| std::string | toUTF8String (T const &iValue, Steinberg::int32 iPrecision) |
This generic function will determine (at compilation time) whether T can be written to an ostream and if that is the case, will use this information to build the string. More... | |
| std::shared_ptr<T> pongasoft::VST::VstUtils::make_sfo | ( | Args &&... | iArgs | ) |
The VST SDK uses the concept of FObject (which are self contained reference counted objects) but require to be manually managed (by calling addRef and release).
In a few instances (GUIValParameter and GUIJmbParameter), Jamba creates and manages std::shared_ptr while using the underlying raw pointer with VST SDK classes. So in order to marry the 2 worlds, this util method creates a shared_ptr whose deleter simply delegates to the FObject::release method:
p->release() will destroy the objectFObjectCx still holds a reference) and the shared_ptr goes away, then p->release() only decrements the counter and whenever FObjectCx goes away, it will call p->release() which will then destroy the object
|
inline |
Converts a VstString16 to a regular std::string that is properly utf-8 encoded.
| std::string pongasoft::VST::VstUtils::toUTF8String | ( | T const & | iValue, |
| Steinberg::int32 | iPrecision | ||
| ) |
This generic function will determine (at compilation time) whether T can be written to an ostream and if that is the case, will use this information to build the string.
Otherwise returns an empty string.