Author Topic: BassVis.BASS_WINAMPVIS_Free Crashing  (Read 7984 times)

hwahrmann

  • Posts: 137
BassVis.BASS_WINAMPVIS_Free Crashing
« on: 12 Jan '07 - 11:22 »
Hi,

i'm using somw winamp plugins, which i render in my own hdc.
works good so far, but when Freeing the plugin, the plugin itself crashes.
Have found no way to catch the exception in a try / catch block.

here's the init code:

Code: [Select]
      string pluginfile = @"D:\Programme\Winamp\Plugins\vis_avs.dll";
      visplugin = BassVis.BASS_WINAMPVIS_CreateVis(pluginfile, 0, 0, this.Handle, true);
      hwndWinAmp = BassVis.BASS_WINAMPVIS_GetAmpHwnd();
     
      IntPtr genHwnd = BassVis.BASS_WINAMPVIS_GetGenHwnd();
      IntPtr childHWnd = GetWindow(genHwnd, GW_CHILD);
      SetParent(childHWnd, pictureBoxVis.Handle);
      MoveWindow(childHWnd, 0, 0, pictureBoxVis.Width, pictureBoxVis.Height, true);
      BassVis.BASS_WINAMPVIS_SetChanMPEGInfo(visplugin, chInfo.freq, 256, Bass.BASS_ChannelGetLength(_stream), 2);
      SendMessage(hwndWinAmp, (int)WM_COMMAND, (int)WINAMP_BUTTON2, 0);
      Bass.BASS_ChannelPlay(_stream, false);

when stopping the playback i do:

Code: [Select]
BassVis.BASS_WINAMPVIS_Free(visplugin);
this causes the crash of the plugin itself. doesn't matter which plugin i use.

any help is appreciated.

thx,

Helmut

radio42

  • Posts: 4576
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #1 on: 12 Jan '07 - 13:46 »
Guess this one needs to go to the VIS developers...seems not to be any BASS.NET issue.
...

BassFan

  • Guest
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #2 on: 13 Jan '07 - 02:18 »
Guess this one needs to go to the VIS developers...seems not to be any BASS.NET issue.
...

This is not a problem from VIS
Befor you remove the Plugin BassVis.BASS_WINAMPVIS_Free(visplugin); 
check that's you have returned the hwnd.

then use BassVis.BASS_WINAMPVIS_Free(visplugin);

greets

Hi Helmut !
Denke mal das dein problem in verbindung mit Setparent entsteht.
Du kannst das Plugin nicht beenden wenn du mit setparent das Pluginwindow in dein eigenes Window(Picbox) verschoben hast.
Sorge dafür das du das Window vorher wieder ins Plugin zurückschiebst bevor dieses beendet wird.

Schau dir das an!
Code: [Select]
        RepeatCounter = 0
        lHwnd = BASS_WINAMPVIS_GetGenHwnd
        Do Until (lHwnd <> 0) Or RepeatCounter = 32000
            lHwnd = BASS_WINAMPVIS_GetGenHwnd
            RepeatCounter = RepeatCounter + 1
            DoEvents
        Loop

        If lHwnd <> 0 Then
            'Plugin Handle.
            If optPicBox(0).value Then
                lHwndParent = GetWindow(picPlgSource(i).hWnd, GW_CHILD)
            Else
                lHwndParent = GetWindow(frmGen.PicBack.hWnd, GW_CHILD)
            End If
            If lHwndParent <> 0 Then
                'Plugin verstecken
                Call ShowWindow(lHwndParent, SW_HIDE)
                'Plugin wieder in das Winamp Gen Fenster setzen.
                Call SetParent(lHwndParent, lHwnd)
            End If
        End If

Über einen Counter wird ermittelt ob lHwnd <> 0
Wenn mehr als 0 dann wird überprüft ob mehr als ein Plugin gestartet wurde.
Wenn lHwndParent <> 0 dann wird das Window mit ShowWindow(lHwndParent, SW_HIDE) auf visible false geschaltet.
und anschließend mit SetParent(lHwndParent, lHwnd) ins Plugin zurückgeschoben.

Danach mit BassVis.BASS_WINAMPVIS_Free(visplugin) beenden !!!.

gruß
« Last Edit: 13 Jan '07 - 03:13 by BassFan »

hwahrmann

  • Posts: 137
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #3 on: 15 Jan '07 - 17:35 »
Bernd,

i was told by BassFan, that BassVis.BASS_WINAMPVIS_FREE uses 2 parameters in 2.3.0.2.
Could you please update Bass.Net.

His definitions are:
Code: [Select]
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" ( _
    ByVal handle As Long, ByVal VisCounter As Long _
) As Long

radio42

  • Posts: 4576
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #4 on: 15 Jan '07 - 17:40 »
Yepp, I will take a look at it!

BassFan

  • Guest
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #5 on: 15 Jan '07 - 17:44 »
Bernd,

i was told by BassFan, that BassVis.BASS_WINAMPVIS_FREE uses 2 parameters in 2.3.0.2.
Could you please update Bass.Net.

His definitions are:
Code: [Select]
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" ( _
    ByVal handle As Long, ByVal VisCounter As Long _
) As Long

Bernd can not help !
I will show that i update BassVis for Net.
Test befor my VB Sample.



« Last Edit: 16 Jan '07 - 21:15 by BassFan »

hwahrmann

  • Posts: 137
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #6 on: 15 Jan '07 - 19:02 »
BassFan,

your VB sample works perfect. No crash.
have no idea, what could be wrong.


radio42

  • Posts: 4576
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #7 on: 15 Jan '07 - 19:35 »
Hi All,

Quote
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" ( _
    ByVal handle As Long, ByVal VisCounter As Long _
) As Long

I just (re)downloaded the BASSVIS v2.3.0.2...but the decleration of the BASS_WINAMPVIS_Free function is still:
Code: [Select]
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" (ByVal handle As Long) As Long

So I don't get what I could/should change?

hwahrmann

  • Posts: 137
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #8 on: 15 Jan '07 - 20:06 »
BassFan was talking about a 2.3.0.3.

BassFan

  • Guest
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #9 on: 15 Jan '07 - 21:03 »
Hi All,

Quote
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" ( _
    ByVal handle As Long, ByVal VisCounter As Long _
) As Long

I just (re)downloaded the BASSVIS v2.3.0.2...but the decleration of the BASS_WINAMPVIS_Free function is still:
Code: [Select]
Public Declare Function BASS_WINAMPVIS_Free Lib "bass_vis.dll" (ByVal handle As Long) As Long

So I don't get what I could/should change?

I will upoad a new version 2.3.0.3 this week.
Please leave me a little time.

greets

BassFan

  • Guest
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #10 on: 16 Jan '07 - 20:58 »
Hi All

I have upoad a new version BassVis 2.3.0.3

2.3.0.3
---------------
* Upgraded help file
* changed BASS_WINAMPVIS_CreateVis   '// show help file
* changed BASS_WINAMPVIS_Free        '// show help file
* changed Visual Basic Sample        '// to new Bass_Vis Version 
* changed c++ Library                '// to new Bass_Vis Version
* changed c++ BassVis.h              '// to new Bass_Vis Version
* changed Delphi Sample              '// to new Bass_Vis Version
* changed VB_NET Sample              '// to new Bass_Vis Version

You can run more then one Winamp Plugin to self time!
BassVis_NET work only radio42 have update Bass.Net 2.3

greets

radio42

  • Posts: 4576
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #11 on: 16 Jan '07 - 22:35 »
Here is the BASS.NET for BASS_VIS update to try (it's a pre 2.3.1.1 version):

.Net 1.1. build : http://www.un4seen.com/filez/4/Bass23.Net11_update.zip
.Net 2.0 build : http://www.un4seen.com/filez/4/Bass23.Net20_update.zip

What's new:
Support for BASS_VIS version 2.3.03

hwahrmann

  • Posts: 137
Re: BassVis.BASS_WINAMPVIS_Free Crashing
« Reply #12 on: 17 Jan '07 - 09:10 »
BassFan, radio42,


your changes work perfect.
No more crashes, when freeing a plugin.

thanks for your help,

Helmut