mmsharing/mmshengine/src/musengsession.cpp
branchRCL_3
changeset 9 ff8a573c0e2e
parent 0 f0cf47e981f9
child 20 2d2c7d1515f7
--- a/mmsharing/mmshengine/src/musengsession.cpp	Fri Mar 12 15:42:21 2010 +0200
+++ b/mmsharing/mmshengine/src/musengsession.cpp	Mon Mar 15 12:40:08 2010 +0200
@@ -113,7 +113,7 @@
 //
 EXPORT_C TInt CMusEngSession::VolumeL() const
     {
-    return iTelephoneUtils->GetVolumeL();
+    return iTelephoneUtils->GetVolume();
     }
 
 
@@ -147,6 +147,16 @@
     iTelephoneUtils->SetAudioRoutingObserver( aObserver );
     }
 
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMusEngSession::SetVolumeChangeObserver( 
+                                   MMusEngVolumeChangeObserver* aObserver )
+    {
+    iVolumeObserver = aObserver;
+    }
+
 
 // -----------------------------------------------------------------------------
 // Increases CS call volume level by one.
@@ -155,7 +165,7 @@
 //
 EXPORT_C void CMusEngSession::VolumeUpL( )
     {
-    TInt currentVolume = iTelephoneUtils->GetVolumeL();
+    TInt currentVolume = iTelephoneUtils->GetVolume();
     iTelephoneUtils->SetVolumeL( currentVolume  + 1 );
     }
 
@@ -167,7 +177,7 @@
 //
 EXPORT_C void CMusEngSession::VolumeDownL( )
     {
-    TInt currentVolume = iTelephoneUtils->GetVolumeL();
+    TInt currentVolume = iTelephoneUtils->GetVolume();
     iTelephoneUtils->SetVolumeL( currentVolume - 1 );
     }
 
@@ -200,7 +210,18 @@
     {
     MUS_LOG( "mus: [ENGINE]  -> CMusEngSession::ConstructL()" )
     iTelephoneUtils = CMusEngTelephoneUtils::NewL();
+    iTelephoneUtils->SetVolumeChangeObserver( this );
     MUS_LOG( "mus: [ENGINE]  <- CMusEngSession::ConstructL()" )
     }
 
-
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CMusEngSession::VolumeChanged( TInt aVolume, TBool aAudioRouteChanged )
+    {
+    if ( iVolumeObserver )         
+        {
+        iVolumeObserver->VolumeChanged( aVolume, aAudioRouteChanged );
+        }
+    }