Forums > Dev

detecting DAC off?

June 12, 2009 | 3:54 pm

There is probably a really obvious answer to this, but I sure can’t find it. In an external object, is there a way (method that gets called) to detect when the DAC has been turned off? The object_free() function fires when it the external gets deleted, but I need to do some stuff when conversion is stopped.

While I’m asking questions — is there a good way for searching through the Max5 SDK for info? fgrepping through the html pages doesn’t really do it for me anymore.

brad
http://music.columbia.edu/~brad


June 12, 2009 | 4:10 pm
Brad Garton wrote on Fri, 12 June 2009 09:54
In an external object, is there a way (method that gets called) to detect when the DAC has been turned off?

yes, (at least in max4) there is a dspstate method that gets called.
i used something like the following in my code.

in main:
addmess((method)myObj_dspstate, "dspstate", A_CANT, 0);

void myObj_dspstate(t_myObj *x, long n) {
	if(n)
		do this...
	else
		do that...
}

volker.


June 12, 2009 | 4:39 pm

Thanks Volker! Works just fine (in max5 too).

brad
http://music.columbia.edu/~brad


Viewing 3 posts - 1 through 3 (of 3 total)