Audacity 3.2.0
Public Member Functions | Static Public Member Functions | List of all members
PresetsBufferStream Class Reference

#include <VST3Utils.h>

Inheritance diagram for PresetsBufferStream:
[legend]
Collaboration diagram for PresetsBufferStream:
[legend]

Public Member Functions

wxString toString () const
 

Static Public Member Functions

static Steinberg::IPtr< PresetsBufferStreamfromString (const wxString &str)
 

Detailed Description

Definition at line 67 of file VST3Utils.h.

Member Function Documentation

◆ fromString()

Steinberg::IPtr< PresetsBufferStream > PresetsBufferStream::fromString ( const wxString &  str)
static

Definition at line 153 of file VST3Utils.cpp.

154{
155 Steinberg::Buffer buffer(str.length() / 4 * 3);
156 const auto numBytes = Base64::Decode(str, buffer);
157 //BufferStream uses fill size as a cursor position and size as a stream end position
158 //To prevent plugins from fetching bytes past the meaningful data we need to truncate
159 //end position
160 buffer.setSize(numBytes);
161
162 auto result = owned(safenew PresetsBufferStream);
163 result->mBuffer.take(buffer);
164 return result;
165}
#define str(a)
#define safenew
Definition: MemoryX.h:10
STRINGS_API int Decode(const wxString &in, void *out)
Definition: Base64.cpp:67

References Base64::Decode(), safenew, and str.

Referenced by VST3Wrapper::FetchSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

wxString PresetsBufferStream::toString ( ) const

Definition at line 167 of file VST3Utils.cpp.

168{
169 auto str = Base64::Encode(mBuffer, mBuffer.getFillSize());
170 return str;
171}
STRINGS_API wxString Encode(const void *in, int len)
Definition: Base64.cpp:27

References Base64::Encode(), and str.

Referenced by VST3Wrapper::StoreSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: