本文整理汇总了C++中ThrowIfNULL函数的典型用法代码示例。如果您正苦于以下问题:C++ ThrowIfNULL函数的具体用法?C++ ThrowIfNULL怎么用?C++ ThrowIfNULL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ThrowIfNULL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AudioDriverPlugInStreamGetProperty
extern "C" OSStatus AudioDriverPlugInStreamGetProperty(AudioDeviceID inDevice, io_object_t inIOAudioStream, UInt32 inChannel, AudioDevicePropertyID inPropertyID, UInt32* ioPropertyDataSize, void* outPropertyData)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// sanity check the arguments
ThrowIfNULL(ioPropertyDataSize, CAException(kAudioHardwareIllegalOperationError), "AudioDriverPlugInDeviceGetProperty: ioPropertyDataSize is NULL");
// find the plug-in object for the device
HP_DriverPlugIn* thePlugIn = HP_DriverPlugIn::GetPlugIn(inDevice);
ThrowIfNULL(thePlugIn, CAException(kAudioHardwareBadDeviceError), "AudioDriverPlugInDeviceGetProperty: couldn't find the plug-in for the device");
// figure out if the stream has the given property
if(thePlugIn->StreamHasProperty(inIOAudioStream, inChannel, inPropertyID))
{
// let the plug-in do the work
thePlugIn->StreamGetPropertyData(inIOAudioStream, inChannel, inPropertyID, *ioPropertyDataSize, outPropertyData);
}
else
{
theError = kAudioHardwareUnknownPropertyError;
}
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例2: HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock
static OSStatus HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock(AudioHardwarePlugInRef inSelf, AudioDeviceIOProcID* outIOProcID, AudioDeviceID inDeviceID, dispatch_queue_t inDispatchQueue, AudioDeviceIOBlock inBlock)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock: no plug-in");
ThrowIf(inBlock == 0, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock: no IOBlock to add");
ThrowIfNULL(outIOProcID, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock: nowhere to put the return value");
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadDeviceError), "HP_HardwarePlugIn_DeviceCreateIOProcIDWithBlock: no device with given ID");
// do the work
*outIOProcID = theDevice->Do_CreateIOProcIDWithBlock(inDispatchQueue, inBlock);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例3: HP_HardwarePlugIn_DeviceStop
static OSStatus HP_HardwarePlugIn_DeviceStop(AudioHardwarePlugInRef inSelf, AudioDeviceID inDeviceID, AudioDeviceIOProc inProc)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceStop: no plug-in");
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadDeviceError), "HP_HardwarePlugIn_DeviceStop: no device with given ID");
// do the work
theDevice->Do_StopIOProc(inProc);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例4: HP_HardwarePlugIn_DeviceTranslateTime
static OSStatus HP_HardwarePlugIn_DeviceTranslateTime(AudioHardwarePlugInRef inSelf, AudioDeviceID inDeviceID, const AudioTimeStamp* inTime, AudioTimeStamp* outTime)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceTranslateTime: no plug-in");
ThrowIfNULL(inTime, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceTranslateTime: no input time stamp");
ThrowIfNULL(outTime, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceTranslateTime: no place for the return data");
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadDeviceError), "HP_HardwarePlugIn_DeviceTranslateTime: no device with given ID");
// do the work
theDevice->TranslateTime(*inTime, *outTime);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例5: HP_HardwarePlugIn_DeviceGetNearestStartTime
static OSStatus HP_HardwarePlugIn_DeviceGetNearestStartTime(AudioHardwarePlugInRef inSelf, AudioDeviceID inDeviceID, AudioTimeStamp* ioRequestedStartTime, UInt32 inFlags)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceGetNearestStartTime: no plug-in");
ThrowIfNULL(ioRequestedStartTime, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceGetNearestStartTime: no time stamp");
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadDeviceError), "HP_HardwarePlugIn_DeviceGetNearestStartTime: no device with given ID");
// do the work
theDevice->GetNearestStartTime(*ioRequestedStartTime, inFlags);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例6: HP_HardwarePlugIn_DeviceGetPropertyInfo
static OSStatus HP_HardwarePlugIn_DeviceGetPropertyInfo(AudioHardwarePlugInRef inSelf, AudioDeviceID inDeviceID, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32* outSize, Boolean* outWritable)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceGetPropertyInfo: no plug-in");
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadDeviceError), "HP_HardwarePlugIn_DeviceGetPropertyInfo: no device with given ID");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inDeviceID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
// re-find the object for the given ID since it may have changed while we blocked waiting for the lock
theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_DeviceGetPropertyInfo: no device with given ID after locking");
}
// construct a property address
CAPropertyAddress theAddress(inPropertyID, isInput == 0 ? kAudioDevicePropertyScopeOutput : kAudioDevicePropertyScopeInput, inChannel);
// do the work
ThrowIf(!theDevice->HasProperty(theAddress), CAException(kAudioHardwareUnknownPropertyError), "HP_HardwarePlugIn_DeviceGetPropertyInfo: no such property");
if(outSize != NULL)
{
*outSize = theDevice->GetPropertyDataSize(theAddress, 0, NULL);
}
if(outWritable != NULL)
{
*outWritable = theDevice->IsPropertySettable(theAddress) ? 1 : 0;
}
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例7: HP_HardwarePlugIn_StreamGetPropertyInfo
static OSStatus HP_HardwarePlugIn_StreamGetPropertyInfo(AudioHardwarePlugInRef inSelf, AudioStreamID inStreamID, UInt32 inChannel, AudioDevicePropertyID inPropertyID, UInt32* outSize, Boolean* outWritable)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_StreamGetPropertyInfo: no plug-in");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inStreamID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
}
// find the stream for the given ID
HP_Stream* theStream = HP_Object::GetStreamByID(inStreamID);
ThrowIfNULL(theStream, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_StreamGetPropertyInfo: no device with given ID after locking");
// construct a property address
CAPropertyAddress theAddress(inPropertyID, kAudioObjectPropertyScopeGlobal, inChannel);
// do the work
ThrowIf(!theStream->HasProperty(theAddress), CAException(kAudioHardwareUnknownPropertyError), "HP_HardwarePlugIn_StreamGetPropertyInfo: no such property");
if(outSize != NULL)
{
*outSize = theStream->GetPropertyDataSize(theAddress, 0, NULL);
}
if(outWritable != NULL)
{
*outWritable = theStream->IsPropertySettable(theAddress) ? 1 : 0;
}
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例8: HP_HardwarePlugIn_StreamGetProperty
static OSStatus HP_HardwarePlugIn_StreamGetProperty(AudioHardwarePlugInRef inSelf, AudioStreamID inStreamID, UInt32 inChannel, AudioDevicePropertyID inPropertyID, UInt32* ioPropertyDataSize, void* outPropertyData)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_StreamGetProperty: no plug-in");
ThrowIfNULL(ioPropertyDataSize, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_StreamGetProperty: no data size");
// find the stream for the given ID
HP_Stream* theStream = HP_Object::GetStreamByID(inStreamID);
ThrowIfNULL(theStream, CAException(kAudioHardwareBadStreamError), "HP_HardwarePlugIn_StreamGetProperty: no stream with given ID");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inStreamID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
// re-find the object for the given ID since it may have changed while we blocked waiting for the lock
theStream = HP_Object::GetStreamByID(inStreamID);
ThrowIfNULL(theStream, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_StreamGetProperty: no device with given ID after locking");
}
// construct a property address
CAPropertyAddress theAddress(inPropertyID, kAudioObjectPropertyScopeGlobal, inChannel);
// do the work
theStream->GetPropertyData(theAddress, 0, NULL, *ioPropertyDataSize, outPropertyData);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例9: HP_HardwarePlugIn_QueryInterface
static HRESULT HP_HardwarePlugIn_QueryInterface(AudioHardwarePlugInRef inSelf, REFIID inUUID, LPVOID* outInterface)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_QueryInterface: no plug-in");
ThrowIfNULL(outInterface, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_QueryInterface: no place to store the return value");
// set the returned interface to NULL
*outInterface = NULL;
// get the object out of the interface reference
HP_HardwarePlugIn* thePlugIn = HP_HardwarePlugIn::GetObject(inSelf);
// create a CoreFoundation UUIDRef for the requested interface.
CACFUUID theInterfaceUUID(CFUUIDCreateFromUUIDBytes(NULL, inUUID));
// test the requested ID against the valid interfaces.
#if defined(kAudioHardwarePlugInInterface5ID)
if(theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface5ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface4ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface3ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface2ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterfaceID) || theInterfaceUUID.IsEqual(IUnknownUUID))
#else
if(theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface4ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface3ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterface2ID) || theInterfaceUUID.IsEqual(kAudioHardwarePlugInInterfaceID) || theInterfaceUUID.IsEqual(IUnknownUUID))
#endif
{
// it's one of the interfaces we understand
// retain the object on behalf of the caller
thePlugIn->Retain();
// return the interface;
*outInterface = thePlugIn->GetInterface();
}
else
{
// not anything we understand
theError = E_NOINTERFACE;
}
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}
示例10: HP_HardwarePlugIn_ObjectIsPropertySettable
static OSStatus HP_HardwarePlugIn_ObjectIsPropertySettable(AudioHardwarePlugInRef inSelf, AudioObjectID inObjectID, const AudioObjectPropertyAddress* inAddress, Boolean* outIsSettable)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectIsPropertySettable: no plug-in");
ThrowIfNULL(inAddress, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectIsPropertySettable: no address");
ThrowIfNULL(outIsSettable, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectIsPropertySettable: no place to store return value");
// find the object for the given ID
HP_Object* theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectIsPropertySettable: no object with given ID");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inObjectID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
// re-find the object for the given ID since it may have changed while we blocked waiting for the lock
theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectIsPropertySettable: no object with given ID after locking");
}
// do the work
*outIsSettable = theObject->IsPropertySettable(*inAddress);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例11: HP_HardwarePlugIn_ObjectGetPropertyData
static OSStatus HP_HardwarePlugIn_ObjectGetPropertyData(AudioHardwarePlugInRef inSelf, AudioObjectID inObjectID, const AudioObjectPropertyAddress* inAddress, UInt32 inQualifierDataSize, const void* inQualifierData, UInt32* ioDataSize, void* outData)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectGetPropertyData: no plug-in");
ThrowIfNULL(inAddress, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectGetPropertyData: no address");
ThrowIfNULL(ioDataSize, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectGetPropertyData: no info about the size of the property data");
// find the object for the given ID
HP_Object* theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectGetPropertyData: no object with given ID");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inObjectID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
// re-find the object for the given ID since it may have changed while we blocked waiting for the lock
theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectGetPropertyData: no object with given ID after locking");
}
// do the work
theObject->GetPropertyData(*inAddress, inQualifierDataSize, inQualifierData, *ioDataSize, outData);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例12: HP_HardwarePlugIn_ObjectHasProperty
static Boolean HP_HardwarePlugIn_ObjectHasProperty(AudioHardwarePlugInRef inSelf, AudioObjectID inObjectID, const AudioObjectPropertyAddress* inAddress)
{
Boolean theAnswer = false;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectHasProperty: no plug-in");
ThrowIfNULL(inAddress, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_ObjectHasProperty: no address");
// find the object for the given ID
HP_Object* theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectHasProperty: no object with given ID");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inObjectID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
// re-find the object for the given ID since it may have changed while we blocked waiting for the lock
theObject = HP_Object::GetObjectByID(inObjectID);
ThrowIfNULL(theObject, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_ObjectHasProperty: no object with given ID after locking");
}
// do the work
theAnswer = theObject->HasProperty(*inAddress);
}
catch(const CAException& inException)
{
theAnswer = false;
}
catch(...)
{
theAnswer = false;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theAnswer;
}
示例13: HP_HardwarePlugIn_DeviceGetProperty
static OSStatus HP_HardwarePlugIn_DeviceGetProperty(AudioHardwarePlugInRef inSelf, AudioDeviceID inDeviceID, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32* ioPropertyDataSize, void* outPropertyData)
{
OSStatus theError = kAudioHardwareNoError;
CAMutex* theObjectStateMutex = NULL;
bool theObjectStateMutexNeedsUnlocking = false;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceGetProperty: no plug-in");
ThrowIfNULL(ioPropertyDataSize, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_DeviceGetProperty: no data size");
// get the object state mutex
theObjectStateMutex = HP_Object::GetObjectStateMutexByID(inDeviceID);
// lock the mutex
if(theObjectStateMutex != NULL)
{
theObjectStateMutexNeedsUnlocking = theObjectStateMutex->Lock();
}
// find the device for the given ID
HP_Device* theDevice = HP_Object::GetDeviceByID(inDeviceID);
ThrowIfNULL(theDevice, CAException(kAudioHardwareBadObjectError), "HP_HardwarePlugIn_DeviceGetProperty: no device with given ID after locking");
// construct a property address
CAPropertyAddress theAddress(inPropertyID, isInput == 0 ? kAudioDevicePropertyScopeOutput : kAudioDevicePropertyScopeInput, inChannel);
// do the work
theDevice->GetPropertyData(theAddress, 0, NULL, *ioPropertyDataSize, outPropertyData);
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
// unlock the object state mutex if we need to
if((theObjectStateMutex != NULL) && theObjectStateMutexNeedsUnlocking)
{
theObjectStateMutex->Unlock();
}
return theError;
}
示例14: HP_HardwarePlugIn_Release
static ULONG HP_HardwarePlugIn_Release(AudioHardwarePlugInRef inSelf)
{
ULONG theAnswer = 0;
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_Release: no plug-in");
// get the object out of the interface reference
HP_HardwarePlugIn* thePlugIn = HP_HardwarePlugIn::GetObject(inSelf);
// release it
theAnswer = thePlugIn->Release();
// note that thePlugIn is invalid now, so don't use it!
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theAnswer;
}
示例15: HP_HardwarePlugIn_Teardown
static OSStatus HP_HardwarePlugIn_Teardown(AudioHardwarePlugInRef inSelf)
{
OSStatus theError = kAudioHardwareNoError;
try
{
// check the function arguments
ThrowIfNULL(inSelf, CAException(kAudioHardwareIllegalOperationError), "HP_HardwarePlugIn_Teardown: no plug-in");
// get the object out of the interface reference
HP_HardwarePlugIn* thePlugIn = HP_HardwarePlugIn::GetObject(inSelf);
// do the work
thePlugIn->Teardown();
}
catch(const CAException& inException)
{
theError = inException.GetError();
}
catch(...)
{
theError = kAudioHardwareUnspecifiedError;
}
return theError;
}