bluetoothengine/btsac/btrcc/src/btrccVolumeLevelControllerBase.cpp
branchRCL_3
changeset 21 0ba996a9b75d
parent 15 53b7818cd282
equal deleted inserted replaced
20:eede1356aa52 21:0ba996a9b75d
   120     TRACE_FUNC
   120     TRACE_FUNC
   121     return;
   121     return;
   122     }
   122     }
   123 
   123 
   124 // -----------------------------------------------------------------------------
   124 // -----------------------------------------------------------------------------
   125 // CBTRCCVolumeLevelControllerBase::GetLocalMaxVolume
   125 // CBTRCCVolumeLevelControllerBase::GetLocalMaxVolumeL
   126 // -----------------------------------------------------------------------------
   126 // -----------------------------------------------------------------------------
   127 //
   127 //
   128 TInt CBTRCCVolumeLevelControllerBase::GetLocalMaxVolume() 
   128 TInt CBTRCCVolumeLevelControllerBase::GetLocalMaxVolumeL() 
   129     {
   129     {
   130     TRACE_FUNC
   130     TRACE_FUNC
   131     if(iLocalMaxVolume == 0)
   131     // fetch max volume from adaptation and cache it.
   132         {
   132     CMMFDevSound* devSound = CMMFDevSound::NewL();
   133         // fetch max volume from adaptation and cache it.
   133     iLocalMaxVolume = devSound->MaxVolume();
   134         CMMFDevSound* devSound = NULL;
   134     TRACE_INFO((_L("Maximum volume is %d"), iLocalMaxVolume))
   135         TRAPD( err, devSound  = CMMFDevSound::NewL() );
   135     delete devSound; // This is not needed for anything else.
   136         if(!err)
   136     if( iLocalMaxVolume <= 0 )
   137             {
   137         {
   138             iLocalMaxVolume = devSound->MaxVolume();
   138         TRACE_INFO((_L("Error, Maximum volume value is invalid")))
   139             TRACE_INFO((_L("Maximum volume is %d"), iLocalMaxVolume))
   139         User::Leave(KErrNotSupported);
   140             delete devSound; // This is not needed for anything else.
       
   141             }
       
   142         }
   140         }
   143     return iLocalMaxVolume; 
   141     return iLocalMaxVolume; 
   144     }
   142     }
   145 
   143 
   146 // -----------------------------------------------------------------------------
   144 // -----------------------------------------------------------------------------