[plain text]
#include "AppleUSBAudioPlugin.h"
#include "AppleUSBAudioEngine.h"
#include <IOKit/IOLib.h>
#define super IOService
OSDefineMetaClassAndStructors (AppleUSBAudioPlugin, IOService)
OSMetaClassDefineReservedUsed(AppleUSBAudioPlugin, 0);
OSMetaClassDefineReservedUsed(AppleUSBAudioPlugin, 1);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 2);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 3);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 4);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 5);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 6);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 7);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 8);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 9);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 10);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 11);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 12);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 13);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 14);
OSMetaClassDefineReservedUnused(AppleUSBAudioPlugin, 15);
bool AppleUSBAudioPlugin::start (IOService * provider) {
if (!super::start (provider))
{
return FALSE;
}
reserved = (ExpansionData *)IOMalloc (sizeof(struct ExpansionData));
if (!reserved) {
return FALSE;
}
reserved->streamProvider = OSDynamicCast (AppleUSBAudioStream, provider);
if (reserved->streamProvider)
{
reserved->streamProvider->registerPlugin (this);
}
else
{
mOurProvider = OSDynamicCast (AppleUSBAudioEngine, provider);
if (mOurProvider)
{
mOurProvider->registerPlugin (this);
}
}
return TRUE;
}
void AppleUSBAudioPlugin::stop (IOService * provider) {
publishResource ("AppleUSBAudioPlugin", NULL);
if (reserved) {
IOFree (reserved, sizeof(struct ExpansionData));
}
super::stop (provider);
}
IOReturn AppleUSBAudioPlugin::pluginDeviceRequest (IOUSBDevRequest * request, IOUSBCompletion * completion) {
IOReturn result;
result = kIOReturnError;
if (reserved && reserved->streamProvider)
{
result = reserved->streamProvider->pluginDeviceRequest (request, completion);
}
else if (mOurProvider)
{
result = mOurProvider->pluginDeviceRequest (request, completion);
}
return result;
}
void AppleUSBAudioPlugin::pluginSetConfigurationApp (const char * bundleID) {
if (reserved && reserved->streamProvider)
{
reserved->streamProvider->pluginSetConfigurationApp (bundleID);
}
else if (mOurProvider)
{
mOurProvider->pluginSetConfigurationApp (bundleID);
}
}
IOReturn AppleUSBAudioPlugin::pluginInit (IOService * provider, UInt16 vendorID, UInt16 modelID) {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginSetDirection (IOAudioStreamDirection direction) {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginStart () {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginSetFormat (const IOAudioStreamFormat * const newFormat, const IOAudioSampleRate * const newSampleRate) {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginReset () {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginProcess (float * mixBuf, UInt32 numSampleFrames, UInt32 numChannels) {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginProcessInput (float * destBuf, UInt32 numSampleFrames, UInt32 numChannels) {
return kIOReturnSuccess;
}
IOReturn AppleUSBAudioPlugin::pluginStop () {
return kIOReturnSuccess;
}
Generated by GNU enscript 1.6.4.