コード例 #1
0
ファイル: HP_Stream.cpp プロジェクト: briancline/jackosx
CFStringRef	HP_Stream::CopyElementNumberName(const AudioObjectPropertyAddress& inAddress) const
{
	//	This routine returns a human readable, localized name of the number of the given element
	//	this routine shouldn't throw an exception. Just return NULL if the value doesn't exist
	AudioObjectPropertyAddress theAddress = inAddress;
	ChangeStreamPropertyAddressIntoDevicePropertyAddress(theAddress);
	return GetOwningDevice()->CopyElementNumberName(theAddress);
}
コード例 #2
0
ファイル: HP_Stream.cpp プロジェクト: briancline/jackosx
CFStringRef	HP_Stream::CopyStreamManufacturerName() const
{
	//	This routine should return a CFStringRef that contains a string
	//	that is the human readable and localized name of the stream's manufacturer.
	//	Note that the caller will CFRelease the returned object, so be
	//	sure that the object's ref count is correct.
	return GetOwningDevice()->CopyDeviceManufacturerName();
}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// SetPropertyData()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	void ClientSyncDiscontinuity::SetPropertyData(const CMIOObjectPropertyAddress& address, UInt32 /*qualifierDataSize*/, const void* /*qualifierData*/, UInt32 dataSize, const void* data)
	{
		switch (address.mSelector)
		{
			case kCMIODevicePropertyClientSyncDiscontinuity:
				ThrowIf(dataSize != sizeof(Boolean), CAException(kCMIOHardwareBadPropertySizeError), "CMIO::DP::ClientSyncDiscontinuity::SetPropertyData: wrong data size for kCMIODevicePropertyClientSyncDiscontinuity");
				Boolean forceDiscontinuity = *(static_cast<const Boolean*>(data));
				
				if (forceDiscontinuity != mForceDiscontinuity)
				{
					// Instruct the device that the force discontinuity state is changing
					GetOwningDevice().SetForceDiscontinuity(forceDiscontinuity);
					mForceDiscontinuity = forceDiscontinuity;
					
					// Notify that the property changed
					PropertyAddress changedAddress(kCMIODevicePropertyClientSyncDiscontinuity);
					GetOwningDevice().PropertiesChanged(1, &changedAddress);
				}
				break;
		};
	}
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	// SetForceDiscontinuity()
	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	void ClientSyncDiscontinuity::SetForceDiscontinuity(Boolean forceDiscontinuity, bool sendChangeNotifications) 
	{
		// Send out property change notifications if the master is different
		if (forceDiscontinuity != mForceDiscontinuity)
		{
			mForceDiscontinuity = forceDiscontinuity;
			
			if (sendChangeNotifications)
			{
				PropertyAddress changedAddress(kCMIODevicePropertyClientSyncDiscontinuity);
				GetOwningDevice().PropertiesChanged(1, &changedAddress);
			}
		}
	}