BASS.NET API for the Un4seen BASS Audio Library

BASS_VST_AEFFECTFromIntPtr Method

BASS.NET API for the Un4seen BASS Audio Library
Returns an instance of the BASS_VST_AEFFECT class derived from an IntPtr (aeffect) as obtained via BASS_VST_GetInfo(Int32, BASS_VST_INFO).

Namespace:  Un4seen.Bass.AddOn.Vst
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public static BASS_VST_AEFFECT FromIntPtr(
	IntPtr aeffect
)

Parameters

aeffect
Type: SystemIntPtr
The IntPtr to the AEffect structure as obtained from the BASS_VST_INFO class when calling BASS_VST_GetInfo(Int32, BASS_VST_INFO).

Return Value

Type: BASS_VST_AEFFECT
An instance of the BASS_VST_AEFFECT class if successfull, otherwise will be returned.
Remarks

This method can only be used in the .Net Framework version 2.0 or above!
Examples

vstHandle = BassVst.BASS_VST_ChannelSetDSP(_stream, 
                    "C:\\VstPlugins\\Ambience.dll", BASSVSTDsp.BASS_VST_DEFAULT, 0);
BASS_VST_INFO vstInfo = new BASS_VST_INFO();
if (BassVst.BASS_VST_GetInfo(vstHandle, vstInfo))
{
  BASS_VST_AEFFECT aeffect = BASS_VST_AEFFECT.FromIntPtr(vstInfo.aeffect);
  if (aeffect != null)
  {
    // now you might use the aeffect instance, e.g. retrieve the number of programs...
    int numPrograms = aeffect.numPrograms;
    ...
    // or call the dispatcher...
    string cmd = "bypass";
    GCHandle gch = GCHandle.Alloc(cmd, GCHandleType.Pinned);
    if (aeffect.dispatcher(vstInfo.aeffect, BASSVSTDispatcherOpCodes.effCanDo, 
                            0, 0, gch.AddrOfPinnedObject(), 0.0f) != 0)
    {
      int ret = aeffect.dispatcher(vstInfo.aeffect, BASSVSTDispatcherOpCodes.effSetBypass, 
                                   0, 1, IntPtr.Zero, 0.0f);
      Console.WriteLine(ret.ToString());
    }
    gch.Free();
    ...
  }
}
See Also

Reference