Assembly: Bass.Net (in Bass.Net.dll) Version: 220.127.116.11
[DllImportAttribute("bass_vst")] public static bool BASS_VST_SetScope( int vstHandle, int scope )
<DllImportAttribute("bass_vst">] Public Shared Function BASS_VST_SetScope ( vstHandle As Integer, scope As Integer ) As Boolean
- Type: SystemInt32
The VST effect handle as returned by BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32).
- Type: SystemInt32
The ID to set the scope to.
Return ValueType: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
If you create an editor window with BASS_VST_EmbedEditor(Int32, IntPtr) independently of a real channel (by skipping the channel parameter when calling BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32)) and the editor displays any spectrums, VU-meters or such, the data for this come from the most recent channel using the same effect and the same scope. The scope can be set by this method to any ID, the default is 0.
The 'scope' is used to forward 'real' audio data to 'unchanneled' editors (you may want to use these editors as you may want the user to open the editor window at any time, independent of a playing channel). Imaging the following code, where two streams are prepared for crossfading:
ch1 = BASS_StreamCreateFile(false, "sth1.mp3", ...); dsp1 = BASS_VST_ChannelSetDSP(ch1, "sth.dll", ...); ch2 = BASS_StreamCreateFile(false, "sth2.mp3", ...); dsp2 = BASS_VST_ChannelSetDSP(ch2, "sth.dll", ...);
So before the crossfade, you should set the scope:
BASS_VST_SetScope(dsp1, 123); // any number, scope is created implicitly BASS_VST_SetScope(dsp2, 123); // any number, scope is created implicitly
To open the unchanneled editor, you can then simply use the following code:
editor = BASS_VST_ChannelSetDSP(0, "sth.dll", ...); BASS_VST_SetScope(editor, 123); BASS_VST_EmbedEditor(editor, ...);
If you use BASSmix, maybe you won't need the VST-scopes as you can add the effects to the finaly mix. However, even in this case, there may be situations whereis just fine and simplifies your code.