C# Class SharpSoundDevice.DeviceUtilities

Class containing various helper methods.
Show file Open project: ValdemarOrn/SharpSoundDevice

Public Methods

Method Description
CopyStringToBuffer ( string input, IntPtr buffer, int maxLen ) : void

CopyToUnmanaged ( double outp, IntPtr ptr, int OutputPortCount, uint bufferSize ) : void

Copies data from a managed 2d array into an unmanaged double**

DeserializeParameters ( Parameter parameters, byte data ) : void

Takes output generated by SerializeParameters(), deserializes it and assigns the values to the Parameters

DockWinFormsPanel ( System panel, IntPtr vstWindow ) : void

Docks a Winforms panel inside the parent window.

DockWpfWindow ( System WpfWindow, IntPtr vstWindow ) : void

Helper method used to dock a Wpf window inside a Vst Window. All UI chrome is hidden away (borders, close/minimize/maximize buttons) and the window becomes embedded inside the parent window

GenerateIntegerId ( string seedString ) : int

Generates a 4-byte integer by hashing an input string and taking modulus. Useful to create VST Id that is unique to your plugin

GetEmptyArrays ( int InputPortCount, uint bufferSize ) : double[][]

Creates an empty 2d managed array

GetManagedSamples ( IntPtr ptr, int InputPortCount, uint bufferSize ) : double[][]

Copies data from double** into managed 2d array

SerializeParameters ( Parameter parameters ) : byte[]

Accepts an array of Parameters and returns their values in a serialized format.

Private Methods

Method Description
SetParent ( IntPtr hWndChild, IntPtr hWndNewParent ) : IntPtr

Method Details

CopyStringToBuffer() public static method

public static CopyStringToBuffer ( string input, IntPtr buffer, int maxLen ) : void
input string
buffer System.IntPtr
maxLen int
return void

CopyToUnmanaged() public static method

Copies data from a managed 2d array into an unmanaged double**
public static CopyToUnmanaged ( double outp, IntPtr ptr, int OutputPortCount, uint bufferSize ) : void
outp double
ptr System.IntPtr
OutputPortCount int
bufferSize uint
return void

DeserializeParameters() public static method

Takes output generated by SerializeParameters(), deserializes it and assigns the values to the Parameters
public static DeserializeParameters ( Parameter parameters, byte data ) : void
parameters Parameter An array of parameters to set with the new values
data byte Serialized values, as generated by the SerializeParameters() method
return void

DockWinFormsPanel() public static method

Docks a Winforms panel inside the parent window.
public static DockWinFormsPanel ( System panel, IntPtr vstWindow ) : void
panel System
vstWindow System.IntPtr
return void

DockWpfWindow() public static method

Helper method used to dock a Wpf window inside a Vst Window. All UI chrome is hidden away (borders, close/minimize/maximize buttons) and the window becomes embedded inside the parent window
public static DockWpfWindow ( System WpfWindow, IntPtr vstWindow ) : void
WpfWindow System
vstWindow System.IntPtr
return void

GenerateIntegerId() public static method

Generates a 4-byte integer by hashing an input string and taking modulus. Useful to create VST Id that is unique to your plugin
public static GenerateIntegerId ( string seedString ) : int
seedString string input string, e.g. plugin and developer name
return int

GetEmptyArrays() public static method

Creates an empty 2d managed array
public static GetEmptyArrays ( int InputPortCount, uint bufferSize ) : double[][]
InputPortCount int
bufferSize uint
return double[][]

GetManagedSamples() public static method

Copies data from double** into managed 2d array
public static GetManagedSamples ( IntPtr ptr, int InputPortCount, uint bufferSize ) : double[][]
ptr System.IntPtr
InputPortCount int
bufferSize uint
return double[][]

SerializeParameters() public static method

Accepts an array of Parameters and returns their values in a serialized format.
public static SerializeParameters ( Parameter parameters ) : byte[]
parameters Parameter
return byte[]