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
public string GetProgramName(
int program
)
Public Function GetProgramName (
program As Integer
) As String
Parameters
- program
- Type: SystemInt32
The number of the program to return (must be between 0 .. numPrograms-1).
Return Value
Type:
StringThe name of the selected program - or an empty string, if the effect has no programs.
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.
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);
for (int i=0; i<aeffect.numPrograms; i++)
Console.WriteLine( aeffect.GetProgramName(i) );
}
}
vstHandle = BassVst.BASS_VST_ChannelSetDSP(0, "C:\VstPlugins\Ambience.dll", BASSVSTDsp.BASS_VST_DEFAULT, 0)
Dim vstInfo As New BASS_VST_INFO()
If BassVst.BASS_VST_GetInfo(vstHandle, vstInfo) Then
If vstInfo.aeffect <> IntPtr.Zero Then
Dim aeffect As BASS_VST_AEFFECT = BASS_VST_AEFFECT.FromIntPtr(vstInfo.aeffect)
Dim i As Integer
For i = 0 To aeffect.numPrograms - 1
Console.WriteLine(aeffect.GetProgramName(i))
Next i
End If
End If
Reference