Attribute VB_Name = "modVbVis10" '**************************************************************************' '* WinAmp VBLink - Winamp Visualisation Plugin for VB *' '* Copyright 2000 by Gert-Jaap Glasbergen, Berend Engelbrecht *' '* http://www.softwarecave.com *' '* *' '* Filename : modVbVis10.bas *' '* Platform : Win32 *' '* Component : VBVisDemo.exe *' '* Module : Visual Basic interface to VbVis10.dll *' '* Author : G.J. Glasbergen, B. Engelbrecht *' '* Date : 22-Jul-2000 *' '* *' '* Revisions : *' '* *' '* +--------+---------------+-------------------------------------------+ *' '* | Date | Author | Reason for change | *' '* +--------+---------------+-------------------------------------------+ *' '* | 000722 | Berend | Created | *' '* +--------+---------------+-------------------------------------------+ *' '**************************************************************************' Option Explicit ' These declares define the underlying interface to the DLL and ' must not be used outside of this module Private Declare Function vbvis_install_plugin Lib "VbVis10" () As Integer Private Declare Function vbvis_spectrum Lib "VbVis10" (ByVal dwChannel As Long, ByVal pbRet As String, ByVal cbRet As Long) As Integer Private Declare Function vbvis_vu Lib "VbVis10" (ByVal dwChannel As Long) As Integer ' vbvChannel enumerates the available sound channels ' This enum type is used for the Channel parameter in the ' VbVisSpectrum and VbVisVu functions Public Enum vbvChannel vbvChannelLeft = 0 vbvChannelRight = 1 End Enum ' VbVisInstallPlugin returns True if the plugin was correctly ' installed. ' ' Note that you must select the "Visualisation Plugin for VB by ' Software Cave" as visualisation plugin in WinAmp and start it ' to make the interface work. ' Public Function VbVisInstallPlugin() As Boolean VbVisInstallPlugin = (vbvis_install_plugin() <> 0) End Function ' VbVisSpectrum returns an array of bytes containing frequency samples ' for the specified channel. ' ' The valid array index range is from 0 to 287. ' Public Function VbVisSpectrum(Channel As vbvChannel) As Variant Dim pbRet As String, nValues As Integer Dim aSpectrum() As Byte, iSample As Integer nValues = vbvis_spectrum(0, "", 0) pbRet = Space(2 * nValues + 1) vbvis_spectrum Channel, pbRet, Len(pbRet) If nValues > 0 Then ReDim aSpectrum(nValues - 1) For iSample = 0 To nValues - 1 aSpectrum(iSample) = Val("&H" & Mid(pbRet, iSample * 2 + 1, 2)) Next iSample End If VbVisSpectrum = aSpectrum End Function ' VbVisVu returns an integer value proportional to the ' current volume of the specified channel. ' Public Function VbVisVu(Channel As vbvChannel) As Integer Dim iRet As Integer iRet = vbvis_vu(Channel) If iRet < 0 Then iRet = 0 VbVisVu = iRet End Function