I have problems with BB's rendering WAY to slow, so i just dont normally use them at all. Sonique plugins, WMP and WinAmp vises do good for me! I have made a small mode to the original code, but only for ease of calling.
here is all of my frmSFXTest code. It may make a call to a module that I dont have here, if so, just remark that line. I tried to clean it up here for you.
Dim hStream As Long
Public hSFX As Long
Dim hSFX2 As Long
Dim hSFX3 As Long
Dim OpenFile As String
Public CurrentVis As String
Sub InitVis()
hSFX = -1
hSFX2 = -1
hSFX3 = -1
hStream = 0
'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
BASS_SFX_Init App.hInstance, frmSFXTest.hwnd
'BASS_SFX_Init App.hInstance, Form1.hWnd
End Sub
Private Sub Form_Load()
InitVis
CheckFiles
Load frmOne
frmOne.Visible = False
'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
'BASS_SFX_Init App.hInstance, Me.hWnd
'hSFX = BASS_SFX_PluginCreate("plugins\Fractal.svp", Picture1.hWnd, Picture1.Width, Picture1.Height, 0)
'hSFX = BASS_SFX_PluginCreate("plugins\smear.svp", frmSFXTest.hWnd, frmSFXTest.Width, frmSFXTest.Height, 0)
'hSFX2 = BASS_SFX_PluginCreate("plugins\vis_avs.dll", Picture2.hWnd, Picture2.Width, Picture2.Height, 0)
'hSFX3 = BASS_SFX_PluginCreate("BBPlugin\oscillo", Picture3.hWnd, Picture3.Width, Picture3.Height, 0)
' hStream = Form1.BasCStream
' If hStream Then
' ' BASS_ChannelPlay hStream, 0
' BASS_SFX_PluginStart hSFX
' ' BASS_SFX_PluginStart hSFX2
' ' BASS_SFX_PluginStart hSFX3
' Timer1.Interval = 27
' Timer1.Enabled = True
' End If
'End If
End Sub
Public Sub ReloadVis(VisName As String)
'BASS_SFX_PluginFree Picture1.hWnd
'BASS_SFX_PluginFree frmSFXTest.hWnd
'BASS_SFX_Free
If VisName = "" Then VisName = "plugins\Fractal.svp"
CurrentVis = VisName
DoEvents
hSFX = -1
hSFX2 = -1
hSFX3 = -1
hStream = 0
'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
' BASS_SFX_Init App.hInstance, Me.hWnd
hSFX = BASS_SFX_PluginCreate(VisName, Picture1.hwnd, Picture1.Width, Picture1.Height, 0)
'hSFX2 = BASS_SFX_PluginCreate(VisName, Form1.box_spectr.hWnd, Form1.box_spectr.Width, Form1.box_spectr.Height, 0)
'hSFX = BASS_SFX_PluginCreate("plugins\smear.svp", frmSFXTest.hWnd, frmSFXTest.Width, frmSFXTest.Height, 0)
'hSFX2 = BASS_SFX_PluginCreate("plugins\vis_avs.dll", Picture2.hWnd, Picture2.Width, Picture2.Height, 0)
'hSFX3 = BASS_SFX_PluginCreate("BBPlugin\oscillo", Picture3.hWnd, Picture3.Width, Picture3.Height, 0)
'If InStr(1, VisName, ".dll") Then
'hSFX2 = BASS_SFX_PluginModuleSetActive(Picture1.hWnd, VisName)
'
' hSFX3 = BASS_SFX_PluginSetStream(Picture1.hWnd, VisName)
'End If
hStream = Form1.BasCStream
If hStream Then
' BASS_ChannelPlay hStream, 0
BASS_SFX_PluginStart hSFX
' BASS_SFX_PluginStart hSFX2
' BASS_SFX_PluginStart hSFX3
Timer1.Interval = 27
Timer1.Enabled = True
End If
'End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then DragForm frmSFXTest
End Sub
Private Sub Form_Resize()
Picture1.Height = Me.ScaleHeight
Picture1.Width = Me.ScaleWidth
Dim retval As Long
retval = BASS_SFX_PluginResize(Picture1.hwnd, Picture1.Width, Picture1.Height)
ReloadVis CurrentVis
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Dim FormVal, CurrentVal As Integer
Dim D As Integer
D = frmSFXTest.Top
If frmSFXTest.Top <> Form1.Top Then GoTo Skipper
If frmSFXTest.Left + frmSFXTest.Width = Form1.Left Or Form1.Left + Form1.Width = frmSFXTest.Left Then
If Form1.Left + Form1.Width = frmSFXTest.Left Then ReturnMe frmSFXTest, Form1, True, "Right", 10
If frmSFXTest.Left + frmSFXTest.Width = Form1.Left Then ReturnMe frmSFXTest, Form1, True, "Left", 10
End If
Skipper:
Unload frmOne
BASS_SFX_PluginStop Picture1.hwnd
BASS_SFX_PluginFree Picture1.hwnd
Me.Visible = False
If sfxbg.Visible = True Then
Unload sfxbg
Set sfxbg = Nothing
End If
End Sub
Private Sub Picture1_DblClick()
frmSFXTest.Visible = False
'If frmSFXTest.Width <> Screen.Width Then
If frmSFXTest.WindowState = 0 Then
frmSFXTest.WindowState = 2
'frmSFXTest.Width = Screen.Width
'frmSFXTest.Height = Screen.Height
'frmSFXTest.Move 1, 1
'fullscreen
'FormOnBottom frmSFXTest
frmSFXTest.Visible = True
GoTo EOSub
Else
'windowed
frmSFXTest.WindowState = 0
End If
EOSub:
FormOnTop Form1
frmSFXTest.Visible = True
End Sub
Private Sub Timer1_Timer()
On Error Resume Next
If (hSFX <> -1) Then
If mnuFullVis.Checked = True Then
BASS_SFX_PluginRender hSFX, hStream, Picture1.hdc
Else
BASS_SFX_PluginRender hSFX, hStream, Form1.hdc
End If
End If
'If (hSFX2 <> -1) Then
'BASS_SFX_PluginRender hSFX2, hStream, Form1.box_spectr.hDC
'End If
End Sub
Sub CheckFiles()
Dim dVis As String
Dim xName As String, xLen As Integer
If FileExists(App.Path & "\defaultvis.txt") = True Then
Open App.Path & "\defaultvis.txt" For Input As #1
Input #1, dVis
Close #1
'EdgeCrusher - Sonique = always fails for me.
If InStr(1, dVis, "edgecrusher") Then Exit Sub
If dVis = "" Then dVis = "plugins\Fractal.svp"
frmSFXTest.ReloadVis dVis
xLen = Len(App.Path & "\plugins\")
xName = Mid(dVis, xLen + 1)
frmSFXTest.Caption = "Visulizer - " & xName
GoTo EOSub:
End If
If FileExists(App.Path & "\currentvis.txt") = True Then
Open App.Path & "\currentvis.txt" For Input As #1
Input #1, dVis
Close #1
If dVis = "" Then dVis = "plugins\Fractal.svp"
frmSFXTest.ReloadVis dVis
xLen = Len(App.Path & "\plugins\")
xName = Mid(dVis, xLen + 1)
frmSFXTest.Caption = "Visulizer - " & xName
End If
GoTo EOSub:
EOSub:
If dVis = "" Then dVis = "plugins\Fractal.svp"
frmSFXTest.ReloadVis dVis
End Sub
Private Function FileExists(FullFileName As String) As Boolean
On Error GoTo MakeF
'If file does Not exist, there will be an Error
Open FullFileName For Input As #1
Close #1
'no error, file exists
FileExists = True
Exit Function
MakeF:
'error, file does Not exist
FileExists = False
Exit Function
End Function
I actually Don't have it crash VB6, my Glass (Aero) code does that, not this. This works just fine for me. I have it set up so that you can call from ANY Form / Module a quick swap on the Vises.
just call frmsfxtest.ReloadVis (visname\path to new vis name here)
So just call frmsfxtest.reloadvis "c:\ProgramDir\SomeFolderName\Aorta.svp"
and it will change to Aorta ASAP.