bluetoothappprofiles/avrcp/remconbeareravrcp/src/remconbeareravrcp.cpp
changeset 40 997690c3397a
parent 15 00f9ee97d895
child 49 9866e1d49556
equal deleted inserted replaced
37:91746b151f97 40:997690c3397a
   868 	{
   868 	{
   869 	LOG_FUNC
   869 	LOG_FUNC
   870 	Observer().SetRemoteAddressedClient(TUid::Uid(KRemConBearerAvrcpImplementationUid), aClientId);
   870 	Observer().SetRemoteAddressedClient(TUid::Uid(KRemConBearerAvrcpImplementationUid), aClientId);
   871 	}
   871 	}
   872 
   872 
       
   873 void CRemConBearerAvrcp::MrccciRegisterForLocalAddressedClientUpdates()
       
   874 	{
       
   875 	// Addressed player observers are registered with RemCon on a per-bearer basis
       
   876 	// so we aggregate interest from remote here
       
   877 	iRemotesInterestedInLocalAddressedClient++;
       
   878 	if(iRemotesInterestedInLocalAddressedClient == 1)
       
   879 		{
       
   880 		// Weren't any registered before, tell RemCon we care
       
   881 		Observer().RegisterLocalAddressedClientObserver(TUid::Uid(KRemConBearerAvrcpImplementationUid));
       
   882 		}
       
   883 	
       
   884 #ifdef __DEBUG
       
   885 	TInt numRemotes = 0;
       
   886 	CRcpRemoteDevice* remote = NULL;
       
   887 	
       
   888 	TDblQueIter<CRcpRemoteDevice> iter(iRemotes);
       
   889 	while (iter++)
       
   890 		{
       
   891 		numRemotes++;
       
   892 		}
       
   893 	__ASSERT_DEBUG(iRemotesInterestedInLocalAddressedClient <= numRemotes, AVRCP_PANIC(ETooManyRemotesRegisterForLocalAddressedPlayerUpdates));
       
   894 #endif
       
   895 	}
       
   896 
       
   897 void CRemConBearerAvrcp::MrccciUnregisterForLocalAddressedClientUpdates()
       
   898 	{
       
   899 #ifdef __DEBUG
       
   900 	TInt numRemotes = 0;
       
   901 	CRcpRemoteDevice* remote = NULL;
       
   902 	
       
   903 	TDblQueIter<CRcpRemoteDevice> iter(iRemotes);
       
   904 	while (iter++)
       
   905 		{
       
   906 		numRemotes++;
       
   907 		}
       
   908 	__ASSERT_DEBUG(iRemotesInterestedInLocalAddressedClient <= numRemotes, AVRCP_PANIC(ETooManyRemotesRegisterForLocalAddressedPlayerUpdates));
       
   909 	__ASSERT_DEBUG(iRemotesInterestedInLocalAddressedClient > 0, AVRCP_PANIC(ETooFewRemotesRegisterForLocalAddressedPlayerUpdates));
       
   910 #endif
       
   911 
       
   912 	iRemotesInterestedInLocalAddressedClient--;
       
   913 	if(iRemotesInterestedInLocalAddressedClient == 0)
       
   914 		{
       
   915 		// No-one left who cares.  Tell RemCon not to bother updating
       
   916 		// us anymore.
       
   917 		Observer().UnregisterLocalAddressedClientObserver(TUid::Uid(KRemConBearerAvrcpImplementationUid));
       
   918 		}
       
   919 	}
       
   920 
   873 /** Called from outgoing handlers to notify that a response
   921 /** Called from outgoing handlers to notify that a response
   874 for a notify command is ready for RemCon. 
   922 for a notify command is ready for RemCon. 
   875 
   923 
   876 @param aCommand The response that is ready.
   924 @param aCommand The response that is ready.
   877 */
   925 */