Author Topic: DEVICENOTIFYPROC  (Read 1716 times)

will8080

  • Posts: 12
DEVICENOTIFYPROC
« on: 29 Sep '11 - 00:09 »
In Bass.NET there is a delegate named DEVICENOTIFYPROC.

I couldn't find any references on how to use the delegate or where to hook it up. The summary is "User defined callback function to notify of when there are new/removed devices and default changes." This is exactly what I want to do.

Any help on the matter would be greatly appreciated.

radio42

  • Posts: 4573
Re: DEVICENOTIFYPROC
« Reply #1 on: 29 Sep '11 - 10:00 »
The device notification system was removed in BASS 2.4.7, because it caused problem with dynamic loading, or rather unloading. That was due to it being COM-based which meant that BASS couldn't release it when unloading (COM stuff not allowed in a DllMain function), so the notification system remained active if the app continued running after BASS was unloaded, and if a notification was triggered (eg. new device connected), it would end up trying to call a location where BASS.DLL is no longer present.
There were a few forum posts where people reported problems that were caused by it. Here's one...
   www.un4seen.com/forum/?topic=11832

It wasn't removed from Bass.Net v2.4.7 - but was in the latest Bass.Net verison.
So please use the latest Bass.Net version in which the DEVICENOTIFYPROC was also removed!

will8080

  • Posts: 12
Re: DEVICENOTIFYPROC
« Reply #2 on: 29 Sep '11 - 15:20 »
That's unfortunate. Thank you for your assistance.

I was going to setup a timer that just checks the device infos every x seconds will this cause problems?  The problem I'm trying to solve is, if the default audio device is disabled/changed Bass must be reinitialized, is there a better way to handle this?
« Last Edit: 29 Sep '11 - 15:29 by will8080 »

will8080

  • Posts: 12
Re: DEVICENOTIFYPROC
« Reply #3 on: 29 Sep '11 - 15:25 »
I saw that I can use BassWasapi but that requires Vista+, is just polling the device infos the best path or should I look into BassWasapi? In the post you linked it said the underlying code in Wasapi is just polling anyways.