mmsharing/mmshui/src/musuilivesharingcontroller.cpp
branchRCL_3
changeset 9 ff8a573c0e2e
parent 6 c47a75a8cd72
child 14 0da2e08216b6
equal deleted inserted replaced
8:04980be5c5fe 9:ff8a573c0e2e
    40 
    40 
    41 using namespace NMusResourceApi;
    41 using namespace NMusResourceApi;
    42 using namespace MusSettingsKeys;
    42 using namespace MusSettingsKeys;
    43 
    43 
    44 
    44 
       
    45 const TInt KMusUiIntervalToPlay = 5000000;
    45 // -----------------------------------------------------------------------------
    46 // -----------------------------------------------------------------------------
    46 //
    47 //
    47 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    48 //
    49 //
    49 CMusUiLiveSharingController* CMusUiLiveSharingController::NewL(
    50 CMusUiLiveSharingController* CMusUiLiveSharingController::NewL(
   108                                          *this,
   109                                          *this,
   109                                          *this,
   110                                          *this,
   110                                          iSipProfileId );
   111                                          iSipProfileId );
   111 
   112 
   112     iSession->SetAudioRoutingObserver( this );
   113     iSession->SetAudioRoutingObserver( this );
       
   114     iSession->SetVolumeChangeObserver( this );
   113         
   115         
   114     if ( iSession->AudioRoutingCanBeChanged() )
   116     if ( iSession->AudioRoutingCanBeChanged() )
   115         {
   117         {
   116         iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue );
   118         iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue );
   117         }
   119         }
   140     MUS_LOG( "mus: [MUSUI ]  <- CMusUiLiveSharingController::PlayL" );
   142     MUS_LOG( "mus: [MUSUI ]  <- CMusUiLiveSharingController::PlayL" );
   141     }
   143     }
   142 
   144 
   143 
   145 
   144 // -----------------------------------------------------------------------------
   146 // -----------------------------------------------------------------------------
       
   147 // When orientation changed , Camera instances has to be recreated inorder
       
   148 // to receive proper orientated frames.
       
   149 // -----------------------------------------------------------------------------
       
   150 //
       
   151 void CMusUiLiveSharingController::RefreshCameraOrientationL()
       
   152     {
       
   153     MUS_LOG( "mus: [MUSUI ]  -> CMusUiLiveSharingController::RefreshCameraOrientationL" );
       
   154     if ( IsPlayingL() )
       
   155          {
       
   156          MUS_LOG( "mus: [MUSUI ]  -> Playing, pause/stop to restart camera" );
       
   157          TTimeIntervalMicroSeconds32 interval( KMusUiIntervalToPlay ); 
       
   158          PauseL();
       
   159          EnableDisplayL(false);
       
   160          EnableDisplayL(true);
       
   161          User::After( interval );
       
   162          PlayL();
       
   163          } 
       
   164      else
       
   165          {
       
   166          MUS_LOG( "mus: [MUSUI ]  -> Not Playing, try display to restart camera");
       
   167          if ( IsDisplayEnabledL() )
       
   168              {
       
   169              //Disabling of display will cause disabling of viewfinder and in its 
       
   170              //turn releasing of camera, enabling of display will recreate a camera
       
   171              //with new orientation
       
   172              MUS_LOG( "mus: [MUSUI ]  -> display is enabled, disable/enable it");
       
   173              EnableDisplayL(false);
       
   174              EnableDisplayL(true);
       
   175              }
       
   176          else
       
   177              {
       
   178              MUS_LOG( "mus: [MUSUI ]  -> Not refreshing ");
       
   179              }
       
   180          }
       
   181     MUS_LOG( "mus: [MUSUI ]  <- CMusUiLiveSharingController::RefreshCameraOrientationL" );
       
   182     }
   145 //
   183 //
   146 // -----------------------------------------------------------------------------
   184 // -----------------------------------------------------------------------------
   147 //
   185 //
   148 void CMusUiLiveSharingController::PauseL()
   186 void CMusUiLiveSharingController::PauseL()
   149     {
   187     {