Imports System.Runtime.InteropServices
Module modBassVis
'Module containing the public declares to the BassVis library
' BASS_SONIQUEVIS_CreateVis flags
Public Const BASS_VIS_NOINIT As Integer = 1
' BASS_SONIQUEVIS_SetConfig flags
Public Enum BASSVIS_CONFIGFLAGS
BASS_CONFIG_FFTAMP = 1 ' FFTConfig for Winamp, Sonique, Wmp
BASS_SONIQUEVIS_CONFIG_FFT_SKIPCOUNT = 2 ' Skip count range is from 0 to 3 (because of limited FFT request size)
BASS_SONIQUEVIS_CONFIG_WAVE_SKIPCOUNT = 3 ' Skip count range is from 0 to (...) try it out, whenever Bass crashes or does not return enough sample data
BASS_SONIQUEVIS_CONFIG_SLOWFADE = 4 ' Dim light colors to less than half, then slowly fade them out
BASS_SONIQUEVIS_CONFIG_RENDERTIMING = 5 ' RenderTiming default = 16 ms (min 10)
BASS_SONIQUEVIS_CONFIG_USESLOWFADE = 6 ' use VideoProc or not , 0/off 1/on
End Enum
' BASS_VIS_FindPlugin flags
Public Const BASS_VIS_FIND_RECURSIVE As Integer = 4
' Plugin Kind
Public Enum BassVisKind
BASSVISKIND_NONE = 0
BASSVISKIND_WINAMP = 1
BASSVISKIND_SONIQUE = 2
BASSVISKIND_WMP = 3
BASSVISKIND_BASSBOX = 4
BASSVISKIND_AIMP2 = 5
End Enum
' Plugin Parameter
<StructLayout(LayoutKind.Sequential)> _
Public Structure BASSVIS_PARAM
Friend Vishandle As Integer ' VisHandle
Friend VisGenWinhandle As Integer ' General Vis Window
Handle
Friend Kind As BassVisKind ' Plugin Kind (BASSVISKIND_NONE, BASSVISKIND_WINAMP, BASSVISKIND_SONIQUE)
End Structure
' Definition der Typen f�r die variablen Parameter bei Create bzw. Execute
<StructLayout(LayoutKind.Sequential)> _
Public Structure BASSVIS_EXEC
Friend Pluginfile As String ' Dateiname des Plugins f�r Sonique und Winamp
Friend AMP_UseOwnW1 As Integer ' Flag f�r Winamp False =(Render Winamp5 im eigenen Window) 0=aus,1=an
Friend AMP_UseOwnW2 As Integer ' Flag f�r Winamp False =(Render Winamp2 im eigenen Window) 0=aus,1=an
Friend AMP_Moduleindex As Integer ' Modul-index f�r Winamp
Friend SON_PaintHandle As IntPtr ' Painthandle f�r Sonique
Friend SON_ConfigFile As String ' Dateiname der Konfiguration f�r Sonique
Friend SON_Flags As Integer ' Flags f�r Sonique
Friend WMP_PluginIndex As Integer ' Pluginindex f�r WMP;
Friend WMP_PresetIndex As Integer ' Presetindex f�r WMP
Friend WMP_SrcVisHandle As IntPtr ' ContainerVisHandle f�r WMP
Friend BB_ParentHandle As IntPtr ' Parent Windowhandle
Friend BB_Flags As Integer ' Flags f�r BassBox selbe wie Sonique
Friend BB_ShowFPS As Boolean ' Frames pro Sekunde anzeigen
Friend BB_ShowPrgBar As Boolean ' Progressbar anzeigen
Friend AIMP_PaintHandle As Integer ' Painthandle für Aimp2
Friend AIMP_Flags As Integer ' Flags für Aimp2
Friend Width As Integer ' Fensterbreite
Friend Height As Integer ' Fensterh�he
Friend Left As Integer ' Top
Friend Top As Integer ' Left
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure BASSVIS_INFO
Friend SongTitle As String ' SongTitel ohne Pfad
Friend Songfile As String ' SongFile incl. Pfad (StreamFile)
Friend pos As Integer ' StreamPos = 1000*StreamPos
Friend len As Integer ' Stream l�nge
Friend PlaylistPos As Integer ' PlaylistPos minimal > 0
Friend Playlistlen As Integer ' Playlist l�nge
Friend SampleRate As Integer ' Samplerate default = 44100
Friend BitRate As Integer '
Friend Duration As Integer '
Friend Channels As Integer ' 2
End Structure
Public Enum BASSVIS_PLAYSTATE
psError = -1
psStop = 0
psPlay = 1
psIsPlaying = 2
psPause = 3
psPrevTitle = 4
psNextTitle = 5
psSetPlaylistTitle = 6
psGetPlaylistTitlePos = 7
psSetPlaylistPos = 8
psGetSelectedTitlePos = 9
psPlaylistClear = 10
psAddPlaylistTitle = 11
End Enum
'Core functions for initalizing BASSVIS and Find Plugins of any kind
Public Declare Function BASSVIS_Init Lib "bass_vis.dll" ( _
ByVal Kind As BassVisKind, _
ByVal AppHandle As IntPtr, _
ByVal WinHandle As IntPtr _
) As Boolean
'Core functions for initalizing BASSVIS and Find Plugins of any kind
'delemiter As Byte = 44 .. ASC(",")
'you can send other delemiter for Spliting
Public Declare Function BASSVIS_FindPlugins Lib "bass_vis.dll" ( _
ByVal Kind As BassVisKind, _
ByVal PluginPath As String, _
ByVal Searchflags As Integer, _
Optional ByVal delemiter As Byte = 44 _
) As Int32
Public Declare Function BASSVIS_Free Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByRef Base As BASSVIS_PARAM _
) As Boolean
Public Declare Function BASSVIS_GetVersion Lib "bass_vis.dll" () As String
Public Declare Sub BASSVIS_ExecutePlugin Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_EXEC, _
ByRef Base As BASSVIS_PARAM _
)
Public Declare Function BASSVIS_RenderChannel Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal channel As Integer _
) As Boolean
Public Declare Function BASSVIS_StartRecord Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
Optional ByVal SampleRate As Integer = 44100, _
Optional ByVal Channels As Integer = 2 _
) As Boolean
Public Declare Function BASSVIS_Config Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
Optional ByVal Entry As Integer = 0 _
) As Boolean
Public Declare Function BASSVIS_SetInfo Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByRef infos As BASSVIS_INFO _
) As Boolean
Public Declare Function BASSVIS_Resize Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal Left As Integer, _
ByVal Top As Integer, _
ByVal Width As Integer, _
ByVal Height As Integer _
) As Boolean
Public Declare Function BASSVIS_SetFullscreen Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal SourceHandle As IntPtr, _
ByVal DestHandle As IntPtr, _
ByVal SourceLeft As Integer, _
ByVal SourceTop As Integer, _
ByVal SourceWidth As Integer, _
ByVal SourceHeight As Integer, _
ByVal FullScreenFlag As Boolean, _
ByVal FullScreenWidth As Integer, _
ByVal FullScreenHeight As Integer _
) As Boolean
Public Declare Function BASSVIS_GetModulePresetCount Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal Pluginname As String _
) As Int32
Public Declare Function BASSVIS_GetModulePresetName Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal index As Integer, _
ByVal Pluginname As String _
) As Int32
Public Declare Function BASSVIS_GetModulePresetNameList Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal Pluginname As String _
) As Int32
Public Declare Function BASSVIS_SetModulePreset Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal index As Integer _
) As Boolean
Public Declare Function BASSVIS_GetOption Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal options As Integer _
) As Int32
Public Declare Function BASSVIS_SetOption Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal options As Integer, _
ByVal value As Integer _
) As Boolean
Public Declare Function BASSVIS_SetPlayState Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal State As BASSVIS_PLAYSTATE, _
Optional ByVal value As Integer = -1, _
Optional ByVal Title As String = "" _
) As Int32
Public Declare Function BASSVIS_GetPluginHandle Lib "bass_vis.dll" ( _
ByVal Kind As BassVisKind, _
ByVal Pluginfile As String _
) As Int32
Public Declare Function BASSVIS_GetPluginName Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM _
) As Int32
Public Declare Sub BASSVIS_Quit Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM _
)
Public Declare Sub BASSVIS_SetVisPort Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal WindowHandle As IntPtr, _
ByVal ContainerHandle As IntPtr, _
ByVal x As Int32, _
ByVal y As Int32, _
ByVal Width As Int32, _
ByVal Height As Int32 _
)
Public Declare Sub BASSVIS_WINAMP_RemoveCallback Lib "bass_vis.dll" ()
'Special for Sonique, Aimp2
Public Declare Function BASSVIS_Clicked Lib "bass_vis.dll" ( _
ByRef param As BASSVIS_PARAM, _
ByVal x As Integer, _
ByVal y As Integer _
) As Boolean
'Spezial für Sonique
Public Declare Function BASSVIS_SONIQUEVIS_RenderToDC Lib "bass_vis.dll" ( _
ByVal Kind As BassVisKind, _
ByVal
handle As Int32, _
ByVal channel As Int32, _
ByVal canvas As Int32 _
) As Boolean
Public Declare Function BASSVIS_SONIQUEVIS_RenderToDC2 Lib "bass_vis.dll" ( _
ByVal Kind As BassVisKind, _
ByVal
handle As Int32, _
ByVal Data As IntPtr, _
ByVal fft As IntPtr, _
ByVal canvas As Int32, _
ByVal flags As Int32, _
ByVal pos As Int32 _
) As Boolean
'Public delegate for the changing state of a playlist
Public Declare Sub BASSVIS_WINAMP_SetStateCallback Lib "bass_vis.dll" (ByVal CallBackDelegate As BassVis_PlayStateChanging)
Public Delegate Sub BassVis_PlayStateChanging(ByVal NewState As BASSVIS_PLAYSTATE)
End Module