static PyObject *CmpObj_CaptureComponent(ComponentObject *_self, PyObject *_args) { PyObject *_res = NULL; Component _rv; Component capturingComponent; #ifndef CaptureComponent PyMac_PRECHECK(CaptureComponent); #endif if (!PyArg_ParseTuple(_args, "O&", CmpObj_Convert, &capturingComponent)) return NULL; _rv = CaptureComponent(_self->ob_itself, capturingComponent); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res; }
VolumeCatcherImpl::VolumeCatcherImpl() { mVolume = 1.0; // default to full volume mPan = 0.0; // and center pan ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; // Find the original default output component mOriginalDefaultOutput = FindNextComponent(NULL, &desc); // Register our own output component with the same parameters mVolumeAdjuster = RegisterComponent(&desc, NewComponentRoutineUPP(volume_catcher_component_entry), 0, NULL, NULL, NULL); // Capture the original component, so we always get found instead. CaptureComponent(mOriginalDefaultOutput, mVolumeAdjuster); }