mmsharing/mmshengine/src/musengsession.cpp
branchRCL_3
changeset 9 ff8a573c0e2e
parent 0 f0cf47e981f9
child 20 2d2c7d1515f7
equal deleted inserted replaced
8:04980be5c5fe 9:ff8a573c0e2e
   111 //
   111 //
   112 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   113 //
   113 //
   114 EXPORT_C TInt CMusEngSession::VolumeL() const
   114 EXPORT_C TInt CMusEngSession::VolumeL() const
   115     {
   115     {
   116     return iTelephoneUtils->GetVolumeL();
   116     return iTelephoneUtils->GetVolume();
   117     }
   117     }
   118 
   118 
   119 
   119 
   120 // -----------------------------------------------------------------------------
   120 // -----------------------------------------------------------------------------
   121 //
   121 //
   145                                     MMusEngAudioRoutingObserver* aObserver )
   145                                     MMusEngAudioRoutingObserver* aObserver )
   146     {
   146     {
   147     iTelephoneUtils->SetAudioRoutingObserver( aObserver );
   147     iTelephoneUtils->SetAudioRoutingObserver( aObserver );
   148     }
   148     }
   149 
   149 
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 // -----------------------------------------------------------------------------
       
   153 //
       
   154 EXPORT_C void CMusEngSession::SetVolumeChangeObserver( 
       
   155                                    MMusEngVolumeChangeObserver* aObserver )
       
   156     {
       
   157     iVolumeObserver = aObserver;
       
   158     }
       
   159 
   150 
   160 
   151 // -----------------------------------------------------------------------------
   161 // -----------------------------------------------------------------------------
   152 // Increases CS call volume level by one.
   162 // Increases CS call volume level by one.
   153 // Leaves if error occurs when accessing central repository.
   163 // Leaves if error occurs when accessing central repository.
   154 // -----------------------------------------------------------------------------
   164 // -----------------------------------------------------------------------------
   155 //
   165 //
   156 EXPORT_C void CMusEngSession::VolumeUpL( )
   166 EXPORT_C void CMusEngSession::VolumeUpL( )
   157     {
   167     {
   158     TInt currentVolume = iTelephoneUtils->GetVolumeL();
   168     TInt currentVolume = iTelephoneUtils->GetVolume();
   159     iTelephoneUtils->SetVolumeL( currentVolume  + 1 );
   169     iTelephoneUtils->SetVolumeL( currentVolume  + 1 );
   160     }
   170     }
   161 
   171 
   162 
   172 
   163 // -----------------------------------------------------------------------------
   173 // -----------------------------------------------------------------------------
   165 // Leaves if error occurs when accessing central repository.
   175 // Leaves if error occurs when accessing central repository.
   166 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   167 //
   177 //
   168 EXPORT_C void CMusEngSession::VolumeDownL( )
   178 EXPORT_C void CMusEngSession::VolumeDownL( )
   169     {
   179     {
   170     TInt currentVolume = iTelephoneUtils->GetVolumeL();
   180     TInt currentVolume = iTelephoneUtils->GetVolume();
   171     iTelephoneUtils->SetVolumeL( currentVolume - 1 );
   181     iTelephoneUtils->SetVolumeL( currentVolume - 1 );
   172     }
   182     }
   173 
   183 
   174 // -----------------------------------------------------------------------------
   184 // -----------------------------------------------------------------------------
   175 // Set CS call volume value
   185 // Set CS call volume value
   198 //
   208 //
   199 void CMusEngSession::ConstructL() // second-phase constructor
   209 void CMusEngSession::ConstructL() // second-phase constructor
   200     {
   210     {
   201     MUS_LOG( "mus: [ENGINE]  -> CMusEngSession::ConstructL()" )
   211     MUS_LOG( "mus: [ENGINE]  -> CMusEngSession::ConstructL()" )
   202     iTelephoneUtils = CMusEngTelephoneUtils::NewL();
   212     iTelephoneUtils = CMusEngTelephoneUtils::NewL();
       
   213     iTelephoneUtils->SetVolumeChangeObserver( this );
   203     MUS_LOG( "mus: [ENGINE]  <- CMusEngSession::ConstructL()" )
   214     MUS_LOG( "mus: [ENGINE]  <- CMusEngSession::ConstructL()" )
   204     }
   215     }
   205 
   216 
   206 
   217 // -----------------------------------------------------------------------------
       
   218 //
       
   219 // -----------------------------------------------------------------------------
       
   220 //
       
   221 void CMusEngSession::VolumeChanged( TInt aVolume, TBool aAudioRouteChanged )
       
   222     {
       
   223     if ( iVolumeObserver )         
       
   224         {
       
   225         iVolumeObserver->VolumeChanged( aVolume, aAudioRouteChanged );
       
   226         }
       
   227     }