Namespace: Un4seen.Bass.AddOn.Vst
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
[DllImportAttribute("bass_vst")] public static bool BASS_VST_SetScope( int vstHandle, int scope )
Parameters
- vstHandle
- Type: SystemInt32
The VST effect handle as returned by BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32). - scope
- Type: SystemInt32
The ID to set the scope to.
Return Value
Type: BooleanIf 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 where BASS_VST_SetScope(Int32, Int32) is just fine and simplifies your code.