BASS.NET API for the Un4seen BASS Audio Library

BASS_VST_AEFFECTGetProgramName Method

BASS.NET API for the Un4seen BASS Audio Library
Returns a specific program name of the VST effect.

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

public string GetProgramName(
	int program
)

Parameters

program
Type: SystemInt32
The number of the program to return (must be between 0 .. numPrograms-1).

Return Value

Type: String
The name of the selected program - or an empty string, if the effect has no programs.
Remarks

Retrieving a program name other than the current one enforces to change the current program inernally. So this method first retrieves the current program number, then changes the program in order to get that name and afterwards restores the currect selected program. But since changing the program is enforced even for a short period of time, calling this method on a channel based VST effect might produce some sound disturbance. So it is a good idea to either call this method on a non-channel vstHandle (BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32) called with chan=0) or make sure the channel is currently not playing.
Examples

Calling on a non-channel vstHandle:
vstHandle = BassVst.BASS_VST_ChannelSetDSP(0, 
                    "C:\\VstPlugins\\Ambience.dll", BASSVSTDsp.BASS_VST_DEFAULT, 0);
BASS_VST_INFO vstInfo = new BASS_VST_INFO();
if ( BassVst.BASS_VST_GetInfo(vstHandle, vstInfo) )
{
  if (vstInfo.aeffect != IntPtr.Zero)
  {
    BASS_VST_AEFFECT aeffect = BASS_VST_AEFFECT.FromIntPtr(vstInfo.aeffect);
    // list all available programs
    for (int i=0; i<aeffect.numPrograms; i++)
      Console.WriteLine( aeffect.GetProgramName(i) );
  }
}
See Also

Reference