Beispiel #1
0
OSStatus
PA_Stream::GetPropertyInfo(UInt32 inChannel,
			   AudioDevicePropertyID inPropertyID,
			   UInt32 *outSize,
			   Boolean *outWritable)
{
	AudioObjectPropertyAddress addr;
	OSStatus ret = kAudioHardwareNoError;
	
	addr.mSelector = inPropertyID;
	addr.mElement = inChannel;
	addr.mScope = 0;
	
	if (!HasProperty(&addr))
		return kAudioHardwareUnknownPropertyError;
	
	if (outWritable)
		ret = IsPropertySettable(&addr, outWritable);
	
	if (ret != kAudioHardwareNoError)
		return ret;
	
	if (outSize)
		ret = GetPropertyDataSize(&addr, 0, NULL, outSize);
	
	return ret;
}
Beispiel #2
0
void	HP_Object::SetPropertyData(const AudioObjectPropertyAddress& inAddress, UInt32 inQualifierDataSize, const void* inQualifierData, UInt32 inDataSize, const void* inData, const AudioTimeStamp* inWhen)
{
	ThrowIf(!IsPropertySettable(inAddress), CAException(kAudioHardwareIllegalOperationError), "HP_Object::SetPropertyData: address isn't settable");
	switch(inAddress.mSelector)
	{
		case kAudioObjectPropertyListenerAdded:
			ThrowIf(inDataSize != sizeof(AudioObjectPropertyAddress), CAException(kAudioHardwareBadPropertySizeError), "IOA_Device::SetPropertyData: wrong data size for kAudioObjectPropertyListenerAdded");
			PropertyListenerAdded(*(static_cast<const AudioObjectPropertyAddress*>(inData)));
			break;
		
		case kAudioObjectPropertyListenerRemoved:
			ThrowIf(inDataSize != sizeof(AudioObjectPropertyAddress), CAException(kAudioHardwareBadPropertySizeError), "IOA_Device::SetPropertyData: wrong data size for kAudioObjectPropertyListenerRemoved");
			PropertyListenerRemoved(*(static_cast<const AudioObjectPropertyAddress*>(inData)));
			break;
			
		default:
		{
			HP_Property* theProperty = FindActivePropertyByAddress(inAddress);
			if(theProperty != NULL)
			{
				theProperty->SetPropertyData(inAddress, inQualifierDataSize, inQualifierData, inDataSize, inData, inWhen);
			}
			else
			{
				DebugMessage("HP_Object::SetPropertyData: unknown property");
				Throw(CAException(kAudioHardwareUnknownPropertyError));
			}
		}
		break;
	};
}
Beispiel #3
0
bool	CAHALAudioDevice::IsHogModeSettable() const
{
	bool theAnswer = false;
	CAPropertyAddress theAddress(kAudioDevicePropertyHogMode);
	if(HasProperty(theAddress))
	{
		theAnswer = IsPropertySettable(theAddress);
	}
	return theAnswer;
}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// CurrentFormatIsSettable()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	bool Stream::CurrentFormatIsSettable() const
	{
		return IsPropertySettable(PropertyAddress(kCMIOStreamPropertyFormatDescription));
	}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// HogModeIsSettable()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	bool Device::HogModeIsSettable() const
	{
		return IsPropertySettable(PropertyAddress(kCMIODevicePropertyHogMode));
	}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// FeatureControl::AbsoluteValueSettable()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	bool FeatureControl::AbsoluteValueSettable() const
	{
		return IsPropertySettable(PropertyAddress(kCMIOFeatureControlPropertyAbsoluteValue));
	}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// FeatureControl::AutomaticManualSettable()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	bool FeatureControl::AutomaticManualSettable() const
	{
		return IsPropertySettable(PropertyAddress(kCMIOFeatureControlPropertyAutomaticManual));
	}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// FeatureControl::OnOffSettable()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	bool FeatureControl::OnOffSettable() const
	{
		return IsPropertySettable(PropertyAddress(kCMIOFeatureControlPropertyOnOff));
	}
Beispiel #9
0
bool	CAHALAudioDevice::DataSourceControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel) const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyDataSource, inScope, inChannel);
	return IsPropertySettable(theAddress);
}
Beispiel #10
0
bool	CAHALAudioDevice::iSubOwnerControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel) const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyDriverShouldOwniSub, inScope, inChannel);
	return IsPropertySettable(theAddress);
}
Beispiel #11
0
bool	CAHALAudioDevice::SubVolumeControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel) const
{
	CAPropertyAddress theAddress(kAudioDevicePropertySubVolumeScalar, inScope, inChannel);
	return IsPropertySettable(theAddress);
}
Beispiel #12
0
bool	CAHALAudioDevice::IsIOBufferSizeSettable() const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyBufferFrameSize);
	return IsPropertySettable(theAddress);
}
Beispiel #13
0
bool	CAHALAudioDevice::ClockSourceControlIsSettable() const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyClockSource);
	return IsPropertySettable(theAddress);
}
Beispiel #14
0
bool	CAHALAudioDevice::DataDestinationControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel) const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyPlayThruDestination, inScope, inChannel);
	return IsPropertySettable(theAddress);
}