예제 #1
0
static PyObject *Snd_SndSoundManagerVersion(PyObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	NumVersion _rv;
	if (!PyArg_ParseTuple(_args, ""))
		return NULL;
	_rv = SndSoundManagerVersion();
	_res = Py_BuildValue("O&",
	                     PyMac_BuildNumVersion, _rv);
	return _res;
}
예제 #2
0
pascal ComponentResult 
__SoundComponentRegister( void *dummy )
{
	NumVersion installedVersion;
	ComponentResult result;

	/* Check for hardware here. We are always installed, so we return 0
	 *
	 * we can only run if version 3.0 or greater of the sound manager is running
	 * we can check the entire long because the format of NumVersion is BCD data
	 */	
	result = kComponentDoesNotWantToRegister;
	installedVersion = SndSoundManagerVersion();
	if( installedVersion.majorRev >= 3 ) 	/* has 3.0 sound manager */
		result = kComponentWantsToRegister;
	return result;
}
예제 #3
0
static int DoubleBufferAudio_Available(void)
{
    int available;
    NumVersion sndversion;
    long response;

    available = 0;
    sndversion = SndSoundManagerVersion();
    if ( sndversion.majorRev >= 3 ) {
        if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
            if ( (response & (1 << gestaltSndPlayDoubleBuffer)) ) {
                available = 1;
            }
        }
    } else {
        if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
            if ( (response & (1 << gestaltHasASC)) ) {
                available = 1;
            }
        }
    }
    return(available);
}