bluetoothappprofiles/avrcp/remconbeareravrcp/src/avrcpMetadataTransfer.cpp
changeset 1 6a1fe72036e3
parent 0 f63038272f30
child 20 2f88a7d66f50
equal deleted inserted replaced
0:f63038272f30 1:6a1fe72036e3
   869 	}
   869 	}
   870 
   870 
   871 TInt CControlCommand::GenerateMetadataGetCapabilitiesResponsePayloadL(MRemConBearerObserver& /* aObserver */, RBuf8& aFramePayload, const RBuf8& aResponseData)
   871 TInt CControlCommand::GenerateMetadataGetCapabilitiesResponsePayloadL(MRemConBearerObserver& /* aObserver */, RBuf8& aFramePayload, const RBuf8& aResponseData)
   872 	{
   872 	{
   873 	LOG_FUNC
   873 	LOG_FUNC
   874 	__ASSERT_DEBUG( iPlayerInfoManager != NULL, AvrcpUtils::Panic(EAvrcpNotFullyConstructed));
   874 	__ASSERT_DEBUG(iPlayerInfoManager, AVRCP_PANIC(EAvrcpNotFullyConstructed));
   875 	TPtr8 responseData = aResponseData.RightTPtr(aResponseData.Length() - KLengthErrorResponse);
   875 	TPtr8 responseData = aResponseData.RightTPtr(aResponseData.Length() - KLengthErrorResponse);
   876 
   876 
   877 	if(responseData[KCapabilityIdOffset] == ECapabilityIdEventsSupported)
   877 	if(responseData[KCapabilityIdOffset] == ECapabilityIdEventsSupported)
   878 		{
   878 		{
       
   879 		// Add supported events not handled in the player info API.
   879 		RBuf8 eventsBuf;
   880 		RBuf8 eventsBuf;
   880 		eventsBuf.CreateL(KNumberEventsNotInPlayerInfoApi);
   881 		eventsBuf.CreateL(KNumberEventsNotInPlayerInfoApi);
   881 		CleanupClosePushL(eventsBuf);
   882 		CleanupClosePushL(eventsBuf);
   882 		TInt count = 0;
   883 		TInt count = 0;
   883 		
   884 		
   884 		// if ClientId has been set it means that we've told the remote that
   885 		// If a specific player (i.e. a specific client ID)  has been indicated then
   885 		// commands are being addressed to a particular player, so return
   886 		// we add support for the event if supported by the specific player.
   886 		// player specific info.  Otherwise return generic support.
   887 		// If no specific player has been indicated (i.e. an invalid client ID), then
   887 		if(ClientId() == KNullClientId || iPlayerInfoManager->AbsoluteVolumeSupportedL(ClientId()))
   888 		// general support for the event is added if supported by any player.
       
   889 		// The player info manager APIs handles these different "support" semantics.
       
   890 		
       
   891 		if(iPlayerInfoManager->AbsoluteVolumeSupportedL(ClientId()))
   888 			{
   892 			{
   889 			count++;
   893 			count++;
   890 			eventsBuf.Append(ERegisterNotificationVolumeChanged );
   894 			eventsBuf.Append(ERegisterNotificationVolumeChanged );
   891 			}
   895 			}
   892 		
   896 		
   893 		if(ClientId() == KNullClientId || iPlayerInfoManager->BrowsingSupportedL(ClientId()))
   897 		if(iPlayerInfoManager->BrowsingSupportedL(ClientId()))
   894 			{
   898 			{
   895 			count += 2;
   899 			count += 2;
   896 			eventsBuf.Append(ERegisterNotificationNowPlayingContentChanged );
   900 			eventsBuf.Append(ERegisterNotificationNowPlayingContentChanged );
   897 			eventsBuf.Append(ERegisterNotificationUidsChanged );
   901 			eventsBuf.Append(ERegisterNotificationUidsChanged );
   898 			}
   902 			}