Help - Search - Members - Calendar
Full Version: Can we add a callback to the DSP interface ?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
oddsock
my current DSP plugin would desparately like to know when it's placed in the DSP chain via the DSP manager. I have a dialog box which needs to be displayed in the event that it is selected (and hidden when it is deselected). Currently, I am doing this display triggering the first time I get samples in the DSP, but if the DSP is deselected in the DSP manager, the user has to restart foobar to get rid of the dialog. Is there a way that we can add a notification of the events of "added/removed to/from DSP manager" to the DSP interface ?

thanks much..

oddsock
kode54
Would it be a problem to have this dialog disappear when your DSP stops processing samples? (flags & FLUSH, close/hide after processing the chunks you receive during that call)
oddsock
QUOTE(kode54 @ May 5 2003 - 06:02 AM)
Would it be a problem to have this dialog disappear when your DSP stops processing samples? (flags & FLUSH, close/hide after processing the chunks you receive during that call)

you mean at the beginning and end of the on_chunk() call ? that would cause the dialog box to flicker like crazy

I can already hack my code so that the dialog is displayed when foobar2k starts, but the proper way to do it would be to create the dialog/destroy the dialog, when the DSP is added/removed from the DSP chain..I just need the callback notification to do it....

the dialog should be shown at all times when the DSP is either processing samples, or will be processing samples (i.e. is in the chain)
oddsock
kode54
I believe FLUSH flag is only sent before the service is terminated, I think. I haven't actually tested it.

from dsp.h:
CODE
enum
{
 END_OF_TRACK = 1, //flush whatever you need to when tracks change
 FLUSH = 2 //flush everything
};


and perhaps the gist of using it,
CODE
run([...], int flags)
{
[processing of sample data]
if (flags & FLUSH) [close dialog]
}
Curi0us_George
I don't really know what he's what he's doing with his dsp, but it sounds as if any solutions other than an actual "you're in/out of the queue" message is going to be a poor fix. If it's something that actually needs to be displayed when the dsp is added, then anything less is just going to be a of half-assed workaround.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.