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 62 of file VST3Utils.h.

Member Function Documentation

◆ fromString()

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

Definition at line 80 of file VST3Utils.cpp.

81{
82 Steinberg::Buffer buffer(str.length() / 4 * 3);
83 const auto numBytes = Base64::Decode(str, buffer);
84 //BufferStream uses fill size as a cursor position and size as a stream end position
85 //To prevent plugins from fetching bytes past the meaningful data we need to truncate
86 //end position
87 buffer.setSize(numBytes);
88
89 auto result = owned(safenew PresetsBufferStream);
90 result->mBuffer.take(buffer);
91 return result;
92}
#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 94 of file VST3Utils.cpp.

95{
96 auto str = Base64::Encode(mBuffer, mBuffer.getFillSize());
97 return str;
98}
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: