bluetoothengine/btsac/btrcc/src/btrccLinker.cpp
changeset 33 837dcc42fd6a
parent 15 00f9ee97d895
child 45 b0aebde9b1fb
equal deleted inserted replaced
19:43824b19ee35 33:837dcc42fd6a
    23 #include <remconaddress.h> 
    23 #include <remconaddress.h> 
    24 #include <remconcoreapitarget.h>
    24 #include <remconcoreapitarget.h>
    25 #include <apacmdln.h>
    25 #include <apacmdln.h>
    26 #include <apgcli.h>
    26 #include <apgcli.h>
    27 #include "btaudioremconpskeys.h"
    27 #include "btaudioremconpskeys.h"
       
    28 #include "btrccLegacyVolumeLevelController.h"
    28 #include "btrccAbsoluteVolumeLevelController.h"
    29 #include "btrccAbsoluteVolumeLevelController.h"
    29 #include "btrccLinker.h"
    30 #include "btrccLinker.h"
    30 #include "btrccplayerstarter.h"
    31 #include "btrccplayerstarter.h"
    31 #include "btrccBrowsingAdapter.h"
    32 #include "btrccBrowsingAdapter.h"
    32 #include "debug.h"
    33 #include "debug.h"
    84     iVolController = NULL;
    85     iVolController = NULL;
    85     iRegisterVolumeChangeNotificationCounter = 0;
    86     iRegisterVolumeChangeNotificationCounter = 0;
    86     if (iAccObserver.IsAvrcpVolCTSupported())
    87     if (iAccObserver.IsAvrcpVolCTSupported())
    87         {
    88         {
    88         iAbsoluteVolController = CBTRCCAbsoluteVolumeLevelController::NewL(*iInterfaceSelector, *this);
    89         iAbsoluteVolController = CBTRCCAbsoluteVolumeLevelController::NewL(*iInterfaceSelector, *this);
       
    90         TRACE_INFO((_L("CBTRCCLinker::ConstructL, absolute volume controller created.")))
       
    91 
       
    92         // If also legacy is configured into use, prepare to use it with legacy devices. 
       
    93         if(iAccObserver.IsAvrcpLegacyVolCTSupported())
       
    94             {
       
    95             iLegacyVolController = CBTRCCLegacyVolumeLevelController::NewL(*iInterfaceSelector, *this);
       
    96             TRACE_INFO((_L("CBTRCCLinker::ConstructL, legacy volume controller created.")))
       
    97         	}
    89         }
    98         }
    90     else 
    99     else 
    91    		{
   100    		{
    92         // If volume control is not supported, we'll need another interface selector session for disconnecting. 
   101         // If volume control is not supported, we'll need another interface selector session for disconnecting. 
    93         iInterfaceSelectorForDisconnectingTargetSession = CRemConInterfaceSelector::NewL(); 
   102         iInterfaceSelectorForDisconnectingTargetSession = CRemConInterfaceSelector::NewL(); 
   123 	TRACE_FUNC_ENTRY
   132 	TRACE_FUNC_ENTRY
   124     if (iClientRequest)
   133     if (iClientRequest)
   125         User::RequestComplete(iClientRequest, KErrAbort);
   134         User::RequestComplete(iClientRequest, KErrAbort);
   126 	
   135 	
   127     delete iAbsoluteVolController;
   136     delete iAbsoluteVolController;
       
   137     delete iLegacyVolController;
   128 	delete iPlayerStarter;
   138 	delete iPlayerStarter;
   129 	Cancel();
   139 	Cancel();
   130     iStateArray.ResetAndDestroy();
   140     iStateArray.ResetAndDestroy();
   131     iStateArray.Close();
   141     iStateArray.Close();
   132 	delete iInterfaceSelector;
   142 	delete iInterfaceSelector;
   430     {
   440     {
   431     TRACE_FUNC
   441     TRACE_FUNC
   432     if (iAccObserver.IsAvrcpVolCTSupported())
   442     if (iAccObserver.IsAvrcpVolCTSupported())
   433         {
   443         {
   434         // Choose based on SDP result whether to create 
   444         // Choose based on SDP result whether to create 
   435         // absolute controller or not.
   445         // absolute controller or legacy controller.
   436         if(!iVolController)
   446         if(!iVolController)
   437             {
   447             {
   438             if (iAccObserver.IsAbsoluteVolumeSupported(iRemoteAddr))
   448             if (iAccObserver.IsAbsoluteVolumeSupported(iRemoteAddr))
   439                 {
   449                 {
   440                 iVolController = iAbsoluteVolController;
   450                 iVolController = iAbsoluteVolController;
   441                 TRACE_INFO(_L("Absolute volume supported, taking it into use."))
   451                 TRACE_INFO(_L("Absolute volume supported, taking it into use."))
   442                 }
   452                 }
   443             else 
   453            	else 
   444             	{
   454                 {
   445                 TRACE_INFO(_L("No absolute volume supported, so no volume control."))
   455                 iVolController = iLegacyVolController; // iLegacyVolController may be NULL, depends on the configuration. 
   446             	}
   456                 }
   447             }
   457             }
   448         }
   458         }
   449     if (iVolController)
   459     if (iVolController)
   450         {
   460         {
   451         iVolController->Start();
   461         iVolController->Start();