mmsharing/mmshui/src/musuiclipsharingcontroller.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Application's UI class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "musuiclipsharingcontroller.h"
       
    21 #include "musuicallbackservice.h"
       
    22 #include "musuieventobserver.h"
       
    23 #include "musuisharingobserver.h"
       
    24 #include "musuisendobserver.h"
       
    25 #include "musuiclipsharingobserver.h"
       
    26 #include "musuidialogutil.h"
       
    27 #include "musengclipsession.h"
       
    28 #include "mussettings.h"
       
    29 #include "mussettingskeys.h"
       
    30 #include "musuiresourcehandler.h"
       
    31 #include "musui.hrh"
       
    32 #include "muslogger.h" // debug logging
       
    33 #include "musuiactivetimer.h"
       
    34 #include "musuigeneralview.h"
       
    35 
       
    36 #include <musui.rsg>
       
    37 #include <StringLoader.h>
       
    38 #include <AknUtils.h>
       
    39 
       
    40 #include <badesca.h>
       
    41 #include <avkon.hrh>
       
    42 
       
    43 // CONSTANTS
       
    44 const TInt KMusTimeToCloseAfterClipEndedStandard  = 60 * 1000000; // 60 seconds
       
    45 const TInt KMusTimeToCloseAfterClipEndedOpVariant =  1 * 1000000; //  1 second
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 CMusUiClipSharingController* CMusUiClipSharingController::NewL(
       
    52                                 MMusUiEventObserver& aEventObserver,
       
    53                                 MMusUiSharingObserver& aSharingObserver,
       
    54         	                    MMusUiSendObserver& aSendObserver,
       
    55                                 MMusUiClipSharingObserver& aClipObserver,
       
    56                                 const TRect& aRect )
       
    57     {
       
    58     CMusUiClipSharingController* self =
       
    59             new( ELeave ) CMusUiClipSharingController( aEventObserver,
       
    60                                                        aSharingObserver,
       
    61                                                        aSendObserver,
       
    62                                                        aClipObserver );
       
    63     CleanupStack::PushL( self );
       
    64     self->ConstructL( aRect );
       
    65     CleanupStack::Pop( self );
       
    66     return self;
       
    67     }
       
    68 
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CMusUiClipSharingController::~CMusUiClipSharingController()
       
    75     {
       
    76     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::~CMusUiClipSharingController" );
       
    77     delete iCloseTimer;
       
    78     DeleteEngineSession();
       
    79     delete iFileName;
       
    80     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::~CMusUiClipSharingController" );
       
    81     }
       
    82 
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 CMusUiClipSharingController::CMusUiClipSharingController(
       
    89                                 MMusUiEventObserver& aEventObserver,
       
    90                                 MMusUiSharingObserver& aSharingObserver,
       
    91                                 MMusUiSendObserver& aSendObserver,
       
    92                                 MMusUiClipSharingObserver& aClipObserver )
       
    93     :CMusUiSendController( aEventObserver, aSharingObserver, aSendObserver ),
       
    94     iClipObserver( aClipObserver )
       
    95     {
       
    96     }
       
    97 
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void CMusUiClipSharingController::ConstructL( const TRect& aRect )
       
   104     {
       
   105     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::ConstructL" );
       
   106     
       
   107     CMusUiSendController::ConstructL(); // Base class construction
       
   108                             
       
   109     iRect = aRect;  
       
   110     iSession = CMusEngClipSession::NewL( iRect,
       
   111                                          *this,
       
   112                                          *this,
       
   113                                          *this,
       
   114                                          iSipProfileId );
       
   115     iSession->SetAudioRoutingObserver( this );
       
   116     
       
   117     if ( iSession->AudioRoutingCanBeChanged() )
       
   118         {
       
   119         iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue );
       
   120         }
       
   121     
       
   122     if ( iVideoCodec && iVideoCodec->Length() > 0 )
       
   123         {
       
   124         iSession->SetSupportedVideoCodecListL( *iVideoCodec );
       
   125         }
       
   126     
       
   127    	iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery );
       
   128    	
       
   129    	iCloseTimer = CMusUiActiveTimer::NewL( this );
       
   130    	
       
   131     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::ConstructL" );
       
   132     }
       
   133 
       
   134 
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 void CMusUiClipSharingController::HandleAsyncEventL( TMusUiAsyncEvent aEventId )
       
   140     {
       
   141     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::HandleAsyncEventL" );
       
   142     switch ( aEventId )
       
   143         {
       
   144         case EMusUiAsyncStartMediaGallery:
       
   145             {
       
   146             iTranscode = EFalse;
       
   147             iTranscodingGoing = EFalse;
       
   148             
       
   149             if ( !iSession )
       
   150                 {
       
   151                 iSession = CMusEngClipSession::NewL( iRect, 
       
   152                                                      *this, 
       
   153                                                      *this, 
       
   154                                                      *this, 
       
   155                                                      iSipProfileId );
       
   156                 iSession->SetAudioRoutingObserver( this );
       
   157                 }
       
   158                         
       
   159             // Do fetching guarded. If registration completes during fetching,
       
   160             // there is no need to do anything.
       
   161             iFileFetchingOngoing = ETrue;
       
   162             iClipObserver.RunFetchDialogL();
       
   163             iFileFetchingOngoing = EFalse;
       
   164             
       
   165             TRAPD( error,
       
   166                    iSession->SetClipL( *iFileName ) )
       
   167             MUS_LOG_TDESC( "mus: [MUSUI ]     File name: ",
       
   168                            iFileName->Des() )
       
   169             if ( error == KErrNone)
       
   170                 {
       
   171 				if ( iSession->AudioRoutingCanBeChanged() )
       
   172                     {
       
   173                     iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue );
       
   174                     }
       
   175                 iClipEnded = EFalse;                   
       
   176                 StartInvitationL();	
       
   177                 }
       
   178             else if ( error == KErrPermissionDenied )
       
   179                 {
       
   180                 MusUiDialogUtil::ShowInformationDialogL( 
       
   181                                         R_MUS_VIEW_DRM_INFO_SEND_FORBID );
       
   182                 DeleteEngineSession();
       
   183                 delete iFileName;
       
   184                 iFileName = NULL;
       
   185  				iSession = CMusEngClipSession::NewL( iRect,
       
   186                                                      *this,
       
   187                                                      *this,
       
   188                                                      *this,
       
   189                                                      iSipProfileId );
       
   190                 iSession->SetAudioRoutingObserver( this );
       
   191                 if ( iSession->AudioRoutingCanBeChanged() )
       
   192                     {
       
   193                     iSession->EnableLoudspeakerL( ELoudspeakerEnabled, ETrue );
       
   194                     }
       
   195                 iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery );
       
   196                 }
       
   197             else
       
   198                 {
       
   199                 HandleExitL();
       
   200                 }
       
   201                 
       
   202             break;
       
   203             }
       
   204         case EMusUiAsyncStartTranscoding:
       
   205             {
       
   206             // Parse Target Filename for the transcoding result
       
   207             // and start transcoding:
       
   208             //iSession->TranscodeL( VideoFileNameL() );
       
   209             // Show progress dialog:
       
   210             //iObserver->ShowTranscodingProgressDialogL();
       
   211             iTranscodingGoing = ETrue;
       
   212             break;
       
   213             }  
       
   214         
       
   215         default:
       
   216             {
       
   217             // Not clip specific, let the base class handle
       
   218             CMusUiSendController::HandleAsyncEventL( aEventId );
       
   219             }
       
   220         }
       
   221     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::HandleAsyncEventL" );
       
   222     }
       
   223 
       
   224 
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 // -----------------------------------------------------------------------------
       
   228 //
       
   229 void CMusUiClipSharingController::DeleteEngineSession()
       
   230     {
       
   231     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::DeleteEngineSession" );
       
   232     
       
   233     CMusUiSendController::DeleteEngineSession();
       
   234     
       
   235     // Cancel transcoding
       
   236     if ( iSession && iTranscodingGoing )
       
   237         {
       
   238         MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::DeleteEngineSession:\
       
   239                             Canceling transcoding..." );
       
   240         DismissWaitDialog();
       
   241         TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( 
       
   242                                 R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT );
       
   243                      iSession->CancelTranscodeL() );
       
   244         }
       
   245         
       
   246     delete iSession;
       
   247     iSession = NULL;
       
   248     
       
   249     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::DeleteEngineSession" );
       
   250 	}
       
   251 
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 //
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 CMusEngMceOutSession* CMusUiClipSharingController::EngineOutSession()
       
   258     {
       
   259     return iSession; // Clip session is CMusEngMceOutSession
       
   260     }
       
   261 
       
   262 
       
   263 // -----------------------------------------------------------------------------
       
   264 // Handles status changes specific to sending sharing types.
       
   265 // Calls base class version for status changes that are not sending specific. 
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 void CMusUiClipSharingController::HandleChangedStatusL(
       
   269                         TMusAvailabilityStatus aStatus )
       
   270     {
       
   271     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::HandleChangedStatusL" )
       
   272    
       
   273     switch( aStatus )
       
   274         {
       
   275         case EMultimediaSharingAvailable:
       
   276             {
       
   277             MUS_LOG( "mus: [MUSUI ]     EMultimediaSharingAvailable" )
       
   278             
       
   279             if ( iSipRegistrationPending )
       
   280                 {
       
   281                 iSipRegistrationPending = EFalse;
       
   282             
       
   283                 // If fecth dialog is still open, there is no need to do anything
       
   284                 if ( !iFileFetchingOngoing )
       
   285                 	{
       
   286                 	iSipRegistrationPending = EFalse;
       
   287                     // Set callback service, Call StartInvitationL when wait dialog dismissed
       
   288                 	TRAPD( err, iSharingObserver.SetWaitDialogCallbackL( 
       
   289                 	            &iWaitDialogCallback ) );
       
   290                     // Dismiss pending wait note
       
   291             	    iSharingObserver.DismissWaitDialogL();
       
   292             	    if ( err == KErrNotReady )
       
   293             	        {
       
   294             	        StartInvitationL();	
       
   295             	        }
       
   296                 	}
       
   297                 }
       
   298             break;
       
   299             }   
       
   300         default:
       
   301             {
       
   302             // Not clip specific, let the base class handle
       
   303             CMusUiSendController::HandleChangedStatusL( aStatus );
       
   304             break;
       
   305             }
       
   306         }
       
   307     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::HandleChangedStatusL" )
       
   308     }
       
   309 
       
   310 
       
   311 // -----------------------------------------------------------------------------
       
   312 //
       
   313 // -----------------------------------------------------------------------------
       
   314 //
       
   315 void CMusUiClipSharingController::InviteL( const TDesC& aRecipient )
       
   316     {
       
   317     MUS_LOG_TDESC( "mus: [MUSUI ]    -> CMusUiClipSharingController::InviteL:",
       
   318                             aRecipient );
       
   319 
       
   320     // Registration must not be pending in this phase
       
   321     __ASSERT_ALWAYS( !iSipRegistrationPending, 
       
   322                      iEventObserver.HandleError( KErrNotReady ) );
       
   323                      
       
   324     delete iAddress;
       
   325     iAddress = NULL;
       
   326     iAddress = aRecipient.AllocL();
       
   327     
       
   328     
       
   329     TRAPD( err, iSession->InviteL( aRecipient ) );
       
   330     MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::InviteL: After TRAPD" );
       
   331 
       
   332     // If address is in wrong format, Manual Address Entry Dialog
       
   333     // is displayed
       
   334     if ( err != KErrNone )
       
   335         {
       
   336         DismissWaitDialog();
       
   337         MusUiDialogUtil::ShowGlobalErrorDialogL(
       
   338                                 R_MUS_LIVE_SHARING_VIEW_NOTE_INVITE_ERROR );
       
   339         if ( ( ++iTriedInvitations < 2 )  && ( err == KErrArgument ) )
       
   340             {
       
   341             MUS_LOG( "mus: [MUSUI ]     CMusUiLiveSharingController::InviteL: iTriedInvitations < 2" );
       
   342             iManualAddressTyped = ETrue;
       
   343             iResourceHandler->RequestKeypadL( ETrue );
       
   344 
       
   345             // If the address has to be queried again...:
       
   346             iTranscode = EFalse;
       
   347             
       
   348             MUS_LOG_TDESC( "mus: [MUSUI ]     CMusUiClipSharingController::InviteL: ",
       
   349                        iFileName->Des() )
       
   350                                                  
       
   351             iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal );
       
   352             return;
       
   353             }
       
   354         else
       
   355             {
       
   356             MUS_LOG( "mus: [MUSUI ]     CMusUiLiveSharingController::InviteL: ++iTriedInvitations > 1" );
       
   357             DeleteEngineSession();
       
   358             HandleExitL();
       
   359             return;
       
   360             }
       
   361         }
       
   362         
       
   363 
       
   364     if( iTranscode )
       
   365         {
       
   366         MUS_LOG( "mus: [MUSUI ]     Starting transcode..." );
       
   367         iTranscode = EFalse;
       
   368         // Show progress dialog:
       
   369         iClipObserver.ShowTranscodingProgressDialogL();
       
   370         // Start transcoding
       
   371         iTranscodingGoing = ETrue;
       
   372         
       
   373         SetFileNameL( VideoFileNameL() );
       
   374         TRAPD( err, iSession->TranscodeL( *iFileName ) );
       
   375         
       
   376         if ( err != KErrNone )
       
   377             {
       
   378             MUS_LOG1( "mus: [MUSUI ]     Transcoding failed: %d", err );
       
   379             iTranscodingGoing = EFalse;
       
   380             if ( err == KErrNotFound )  // No Video Editor Engine
       
   381                 {
       
   382                 DismissWaitDialog();
       
   383                 MusUiDialogUtil::ShowGlobalErrorDialogL(
       
   384                     R_MUS_LIVE_SHARING_VIEW_NOTE_TRANSCODING_NOT_SUPPORTED );
       
   385                 DeleteEngineSession();
       
   386                 iVideoToBeSaved = EFalse;
       
   387                 HandleExitL();
       
   388                 }
       
   389             else
       
   390                 {
       
   391                 // Unable to convert clip, if transc. leaves.
       
   392                 // After note return back to the media gallery.
       
   393                 TranscodingFailed();
       
   394                 }
       
   395             return;
       
   396             }
       
   397         }
       
   398     else
       
   399         {
       
   400         SetConnectionInitialized( ETrue );
       
   401         ShowInvitingWaitDialogL();
       
   402         }
       
   403         
       
   404     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::InviteL" );
       
   405     }
       
   406 
       
   407 
       
   408 // -----------------------------------------------------------------------------
       
   409 //
       
   410 // -----------------------------------------------------------------------------
       
   411 //
       
   412 void CMusUiClipSharingController::HandleSliderValueChangeL( TInt aNewLevel )
       
   413     {
       
   414     MUS_LOG1( "mus: [MUSUI ]  -> CMusUiClipSharingController::HandleSliderValueChangeL(%d)",
       
   415               aNewLevel )
       
   416 
       
   417     __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) );
       
   418     __ASSERT_ALWAYS( iConnectionEstablished, User::Leave( KErrNotReady ) );
       
   419         
       
   420     iSession->SetPositionL( TTimeIntervalSeconds( aNewLevel ) );
       
   421     
       
   422     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::HandleSliderValueChangeL" )
       
   423     }
       
   424 
       
   425 
       
   426 
       
   427 void CMusUiClipSharingController::OfferToolbarEventL( TInt aCommand )
       
   428     {
       
   429     MUS_LOG1( "mus: [MUSUI ]  -> CMusUiClipSharingController::OfferToolbarEventL [%d]",
       
   430                             aCommand );
       
   431                                                     
       
   432     switch ( aCommand )
       
   433         {
       
   434         case EMusuiCmdToolbarPause:
       
   435             {
       
   436             HandleCommandL( EMusuiCmdViewPause );
       
   437             iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPause,
       
   438                                                     EMusuiCmdToolbarUnPause,
       
   439                                                     ETrue );
       
   440             break;
       
   441             }
       
   442         case EMusuiCmdToolbarUnPause:
       
   443             {
       
   444             HandleCommandL( EMusuiCmdViewContinue );
       
   445             iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarUnPause,
       
   446                                                     EMusuiCmdToolbarPause,
       
   447                                                     ETrue );
       
   448             break;
       
   449             }
       
   450         case EMusuiCmdToolbarFFRev:
       
   451             {
       
   452             iToolbarFFRevSelected = !iToolbarFFRevSelected; 
       
   453             iClipObserver.SetDurationValue( iSession->DurationL().Int() );
       
   454             if ( iToolbarFFRevSelected )
       
   455                 {
       
   456                 iWasPlayingBeforeWinding = iSession->IsPlayingL();
       
   457                 PauseL();
       
   458                 }
       
   459             else
       
   460                 {
       
   461                 StopWindingL();
       
   462                 if ( iWasPlayingBeforeWinding )
       
   463                     {
       
   464                     PlayL();
       
   465                     }
       
   466                 }
       
   467 //            iClipObserver.SetDurationVisible();
       
   468             iSharingObserver.HighlightSelectedToolbarItem( EMusuiCmdToolbarFFRev );
       
   469             break;
       
   470             }
       
   471         default:    // Not clip specific, let the base class handle
       
   472             {
       
   473             CMusUiEventController::OfferToolbarEventL( aCommand );
       
   474             break;
       
   475             }    
       
   476         }
       
   477         
       
   478     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::OfferToolbarEventL" );
       
   479     }
       
   480 
       
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 //
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 void CMusUiClipSharingController::HandleCommandL(TInt aCommand)
       
   487     {
       
   488     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::HandleCommandL" );
       
   489     
       
   490     __ASSERT_ALWAYS( !ExitOccured(), User::Leave( KErrDied ) );
       
   491 
       
   492     switch ( aCommand )
       
   493         {
       
   494         case EMusuiCmdViewPause:
       
   495             {
       
   496             PauseL();
       
   497             iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause );
       
   498             break;
       
   499             }
       
   500         case EMusuiCmdViewContinue:
       
   501             {
       
   502             PlayL();
       
   503             iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPlay );
       
   504             break;
       
   505             }
       
   506 
       
   507         case EMusuiCmdViewReplay:
       
   508             {
       
   509             if( !MUS_NO_TOOLBAR )
       
   510                 {
       
   511     			if (!AknLayoutUtils::PenEnabled())
       
   512     				{
       
   513     				iEventObserver.SetToolbarVisibility( ETrue );
       
   514             		}
       
   515     
       
   516                 if ( ClipEnded() )
       
   517                     {
       
   518                     iEventObserver.SetToolbarVisibility( ETrue );
       
   519                     // Simulate press of play in toolbar
       
   520                     OfferToolbarEventL( EMusuiCmdToolbarUnPause );             
       
   521                     }
       
   522                 }
       
   523             break;
       
   524             }
       
   525 
       
   526         case EMusuiCmdViewShareVideo:
       
   527             {
       
   528             PauseL();
       
   529             // TODO: Change to video sharing
       
   530             break;
       
   531             }
       
   532         case EMusuiCmdViewShareImage:
       
   533             {
       
   534             PauseL();
       
   535             // TODO: Change to image sharing
       
   536             break;
       
   537             }
       
   538         case EMusuiCmdViewShareLive:
       
   539             {
       
   540             // TODO: Change to live sharing
       
   541             break;
       
   542             }
       
   543 
       
   544         case EMusuiCmdViewAudioNormal:
       
   545             {
       
   546             if( !MUS_NO_TOOLBAR )
       
   547                 {
       
   548     			if (!AknLayoutUtils::PenEnabled())
       
   549     				{
       
   550     				iEventObserver.SetToolbarVisibility( ETrue );
       
   551             		}
       
   552                 }
       
   553             iSession->UnmuteL();
       
   554             break;
       
   555             }
       
   556         case EMusuiCmdViewAudioMute:
       
   557             {
       
   558 			if (!AknLayoutUtils::PenEnabled())
       
   559 				{
       
   560 				iEventObserver.SetToolbarVisibility( ETrue );
       
   561         		}
       
   562 
       
   563             iSession->MuteL();
       
   564             break;
       
   565             }
       
   566         case EMusuiCmdViewFastForward:
       
   567             {
       
   568             MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastForward" );
       
   569             if ( DoFastForwardingL( ETrue ) )
       
   570                 {
       
   571                 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconForward );
       
   572                 iClipObserver.SetPositionValueL( iSession->PositionL().Int() );
       
   573                 //iClipObserver.SetDurationVisible();
       
   574                 }
       
   575             MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastForward END" );
       
   576             break;
       
   577             }
       
   578         case EMusuiCmdViewFastReverse:
       
   579             {
       
   580             MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastReverse" );
       
   581             if ( DoFastRewindingL( ETrue ) )
       
   582                 {
       
   583                 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconRew );
       
   584                 iClipObserver.SetPositionValueL( iSession->PositionL().Int() );
       
   585                 //iClipObserver.SetDurationVisible();
       
   586                 }
       
   587             MUS_LOG( "mus: [MUSUI ]     CMusUiClipSharingController::HandleCommandL: EMusuiCmdViewFastReverse END" );
       
   588             break;
       
   589             }
       
   590         case EMusuiCmdViewFastForwardEnd:
       
   591             {
       
   592             if ( DoFastForwardingL( EFalse ) )
       
   593                 {
       
   594                 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause );
       
   595                 PauseL();
       
   596                 }
       
   597             break;
       
   598             }
       
   599         case EMusuiCmdViewFastReverseEnd:
       
   600             {
       
   601             if ( DoFastRewindingL( EFalse ) )
       
   602                 {
       
   603                 iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause );
       
   604                 PauseL();
       
   605                 }
       
   606             break;
       
   607             }
       
   608         default:
       
   609             {
       
   610             // Try more general handling
       
   611             CMusUiEventController::HandleCommandL( aCommand );
       
   612             break;
       
   613             }
       
   614         }
       
   615         
       
   616     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::HandleCommandL" );
       
   617     }
       
   618     
       
   619 
       
   620 // -----------------------------------------------------------------------------
       
   621 //
       
   622 // -----------------------------------------------------------------------------
       
   623 //
       
   624 void CMusUiClipSharingController::SetFileNameL( const TDesC& aFileName )
       
   625     {
       
   626     iFileName = aFileName.AllocL();
       
   627     }
       
   628 
       
   629 
       
   630 // -----------------------------------------------------------------------------
       
   631 //
       
   632 // -----------------------------------------------------------------------------
       
   633 //
       
   634 TBool CMusUiClipSharingController::ClipEnded()
       
   635     {
       
   636     return iClipEnded;
       
   637     }
       
   638 
       
   639 
       
   640 // -----------------------------------------------------------------------------
       
   641 //
       
   642 // -----------------------------------------------------------------------------
       
   643 //
       
   644 TBool CMusUiClipSharingController::ClipMutedL()
       
   645     {
       
   646     return iSession->IsMutedL();
       
   647     }
       
   648 
       
   649 
       
   650 // -----------------------------------------------------------------------------
       
   651 //
       
   652 // -----------------------------------------------------------------------------
       
   653 //
       
   654 TBool CMusUiClipSharingController::ClipContainsAudioL()
       
   655     {
       
   656     if ( !iConnectionInitialized || !iSession )
       
   657         {
       
   658         return EFalse; // We cannot be sure yet
       
   659         }
       
   660         
       
   661     return iSession->ContainsAudioL();
       
   662     }
       
   663     
       
   664     
       
   665 // -----------------------------------------------------------------------------
       
   666 //
       
   667 // -----------------------------------------------------------------------------
       
   668 //
       
   669 void CMusUiClipSharingController::CancelTranscodingL()
       
   670     {
       
   671     if ( iSession && iTranscodingGoing )
       
   672         {
       
   673         iTranscodingGoing = EFalse;
       
   674         iSession->CancelTranscodeL();
       
   675         }
       
   676     iVideoToBeSaved = EFalse;
       
   677     HandleExitL();
       
   678     }
       
   679 
       
   680 
       
   681 // -----------------------------------------------------------------------------
       
   682 //
       
   683 // -----------------------------------------------------------------------------
       
   684 //
       
   685 void CMusUiClipSharingController::StopWindingL()
       
   686     {
       
   687     MUS_LOG( "mus: [MUSUI ] -> CMusUiClipSharingController::StopWindingL" );
       
   688     
       
   689     if ( DoFastForwardingL( EFalse ) || DoFastRewindingL( EFalse ) )
       
   690         {
       
   691         iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPause );
       
   692         }
       
   693         
       
   694     MUS_LOG( "mus: [MUSUI ] <- CMusUiClipSharingController::StopWindingL" );
       
   695     }
       
   696     
       
   697 
       
   698 // -----------------------------------------------------------------------------
       
   699 //
       
   700 // -----------------------------------------------------------------------------
       
   701 //
       
   702 TBool CMusUiClipSharingController::ToolbarFFRevSelected()
       
   703     {
       
   704     return iToolbarFFRevSelected;
       
   705     }
       
   706 
       
   707 
       
   708 // -----------------------------------------------------------------------------
       
   709 //
       
   710 // -----------------------------------------------------------------------------
       
   711 //
       
   712 void CMusUiClipSharingController::TranscodingProgressedL( TInt aPercentage )
       
   713     {
       
   714     MUS_LOG1( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingProgressedL ( %d )", aPercentage );
       
   715     if ( aPercentage < KMusOneHundredPercent )
       
   716         {
       
   717         iTranscodingGoing = ETrue;
       
   718         iClipObserver.UpdateClipTranscodingPercentageL( aPercentage );
       
   719         }
       
   720     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingProgressedL" );
       
   721     }
       
   722 
       
   723 
       
   724 // -----------------------------------------------------------------------------
       
   725 //
       
   726 // -----------------------------------------------------------------------------
       
   727 //
       
   728 void CMusUiClipSharingController::TranscodingCompletedInitL()
       
   729     {
       
   730     MUS_LOG( 
       
   731         "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingCompletedInitL" );
       
   732     if ( iTranscodingGoing )
       
   733         {
       
   734         iVideoToBeSaved = ETrue;
       
   735         iTranscodingGoing = EFalse;
       
   736         iClipObserver.CancelTranscodingDialogL();
       
   737         MusUiDialogUtil::ShowInformationDialogL( R_MUS_VIEW_NOTE_TRANSCODING_COMPLETE );
       
   738         }
       
   739     MUS_LOG( 
       
   740         "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingCompletedInitL" );
       
   741     }
       
   742 
       
   743 // -----------------------------------------------------------------------------
       
   744 //
       
   745 // -----------------------------------------------------------------------------
       
   746 //
       
   747 void CMusUiClipSharingController::TranscodingCompletedFinalizeL()
       
   748     {
       
   749     MUS_LOG( 
       
   750         "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingCompletedFinalizeL" );
       
   751     SetConnectionInitialized( ETrue );
       
   752     if ( !iTranscodingGoing )
       
   753         {
       
   754         ShowInvitingWaitDialogL();
       
   755         }
       
   756     MUS_LOG( 
       
   757         "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingCompletedFinalizeL" );
       
   758     }
       
   759     
       
   760 // -----------------------------------------------------------------------------
       
   761 //
       
   762 // -----------------------------------------------------------------------------
       
   763 //
       
   764 const TDesC& CMusUiClipSharingController::FormattedDurationString(
       
   765                             const TTimeIntervalSeconds& aDurationSeconds,
       
   766                             const TTimeIntervalSeconds& aPositionSeconds )
       
   767     {
       
   768     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::FormattedDurationString" );
       
   769     _LIT( KDurationAndPositionSeparator, "/" );
       
   770 
       
   771     iDurationStringBuffer.SetLength( 0 );
       
   772     TLocale locale;
       
   773     _LIT( KZeroSymbol, "0" );
       
   774 
       
   775     TInt durationMinutes( 0 );
       
   776     TInt durationSeconds( aDurationSeconds.Int() );
       
   777     if ( aDurationSeconds.Int() > ( KMusOneMinuteInSeconds - 1 ) )
       
   778         {
       
   779         durationMinutes = (int)( aDurationSeconds.Int() / KMusOneMinuteInSeconds );
       
   780         durationSeconds = durationSeconds - ( durationMinutes * KMusOneMinuteInSeconds );
       
   781         }
       
   782 
       
   783     iDurationStringBuffer.AppendNum( durationMinutes );
       
   784     iDurationStringBuffer.Append( locale.TimeSeparator( KMusLocaleMinutesAndSecondsSeparator ) );
       
   785     if ( durationSeconds < KMusNumberValueTen )
       
   786         {
       
   787         iDurationStringBuffer.Append( KZeroSymbol );
       
   788         }
       
   789     iDurationStringBuffer.AppendNum( durationSeconds );
       
   790     iDurationStringBuffer.Append( KDurationAndPositionSeparator );
       
   791 
       
   792     TInt positionMinutes( 0 );
       
   793     TInt positionSeconds( aPositionSeconds.Int() );
       
   794     if ( aPositionSeconds.Int() > ( KMusOneMinuteInSeconds - 1 ) )
       
   795         {
       
   796         positionMinutes = (int)( aPositionSeconds.Int() / KMusOneMinuteInSeconds );
       
   797         positionSeconds = positionSeconds - ( positionMinutes * KMusOneMinuteInSeconds );
       
   798         }
       
   799 
       
   800     iDurationStringBuffer.AppendNum( positionMinutes );
       
   801     iDurationStringBuffer.Append( locale.TimeSeparator( KMusLocaleMinutesAndSecondsSeparator ) );
       
   802     if ( positionSeconds < KMusNumberValueTen )
       
   803         {
       
   804         iDurationStringBuffer.Append( KZeroSymbol );
       
   805         }
       
   806     iDurationStringBuffer.AppendNum( positionSeconds );
       
   807 
       
   808 
       
   809     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::FormattedDurationString" );
       
   810     return iDurationStringBuffer;
       
   811     }
       
   812 
       
   813 
       
   814 // -----------------------------------------------------------------------------
       
   815 //
       
   816 // -----------------------------------------------------------------------------
       
   817 //
       
   818 void CMusUiClipSharingController::EndOfClip()
       
   819     {
       
   820     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::EndOfClip" );
       
   821     iClipEnded = ETrue;
       
   822     
       
   823         TRAP_IGNORE( iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconStop ) );
       
   824         if(!MUS_NO_TOOLBAR)
       
   825             {
       
   826             iSharingObserver.ReplaceToolbarCommand( EMusuiCmdToolbarPause,
       
   827                                                     EMusuiCmdToolbarUnPause,
       
   828                                                     ETrue );
       
   829             }
       
   830     iCloseTimer->Cancel();
       
   831     iCloseTimer->After( iOperatorSpecificFunctionality ?
       
   832                                    KMusTimeToCloseAfterClipEndedOpVariant : 
       
   833                                    KMusTimeToCloseAfterClipEndedStandard );
       
   834     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::EndOfClip" );
       
   835     }
       
   836 
       
   837 
       
   838 // -----------------------------------------------------------------------------
       
   839 //
       
   840 // -----------------------------------------------------------------------------
       
   841 //
       
   842 void CMusUiClipSharingController::TranscodingNeeded()
       
   843     {
       
   844     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingNeeded" );
       
   845     iTranscode = ETrue;
       
   846     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingNeeded" );
       
   847     }
       
   848 
       
   849 
       
   850 // -----------------------------------------------------------------------------
       
   851 //
       
   852 // -----------------------------------------------------------------------------
       
   853 //
       
   854 void CMusUiClipSharingController::TranscodingProgressed( TInt aPercentage )
       
   855     {
       
   856     MUS_LOG1( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingProgressed %d",
       
   857                             aPercentage );
       
   858     TRAP_IGNORE( TranscodingProgressedL( aPercentage ) )
       
   859     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingProgressed" );
       
   860     }
       
   861 
       
   862 
       
   863 // -----------------------------------------------------------------------------
       
   864 //
       
   865 // -----------------------------------------------------------------------------
       
   866 //
       
   867 void CMusUiClipSharingController::TranscodingCompletedInit()
       
   868     {
       
   869     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingCompleted" );
       
   870     TRAPD( error, TranscodingCompletedInitL() );
       
   871     if ( error != KErrNone )
       
   872         {
       
   873         HandleError( error );
       
   874         }
       
   875     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingCompleted" );
       
   876     }
       
   877     
       
   878 
       
   879 // -----------------------------------------------------------------------------
       
   880 //
       
   881 // -----------------------------------------------------------------------------
       
   882 //
       
   883 void CMusUiClipSharingController::TranscodingCompletedFinalize()
       
   884     {
       
   885     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingCompleted" );
       
   886     TRAPD( error, TranscodingCompletedFinalizeL() );
       
   887     if ( error != KErrNone )
       
   888         {
       
   889         HandleError( error );
       
   890         }
       
   891     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingCompleted" );
       
   892     }
       
   893     
       
   894 // -----------------------------------------------------------------------------
       
   895 //
       
   896 // -----------------------------------------------------------------------------
       
   897 //
       
   898 void CMusUiClipSharingController::TranscodingFailed()
       
   899     {
       
   900     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::TranscodingFailed" );
       
   901     iTranscodingGoing = EFalse;
       
   902     DismissWaitDialog();
       
   903     TRAP_IGNORE( iClipObserver.CancelTranscodingDialogL();
       
   904                  MusUiDialogUtil::ShowGlobalErrorModalDialogL( 
       
   905                                     R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) );
       
   906     DeleteEngineSession();
       
   907     delete iFileName;
       
   908     iFileName = NULL;
       
   909     TRAPD( error,
       
   910            iCallbackService->AsyncEventL( EMusUiAsyncStartMediaGallery ) );
       
   911     if ( error != KErrNone )
       
   912         {
       
   913         HandleError( error );
       
   914         }
       
   915     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::TranscodingFailed" );
       
   916     }
       
   917 
       
   918 
       
   919 // -----------------------------------------------------------------------------
       
   920 //
       
   921 // -----------------------------------------------------------------------------
       
   922 //
       
   923 void CMusUiClipSharingController::SessionRecipientNotFound()
       
   924     {
       
   925     MUS_LOG1( "mus: [MUSUI ]     -> CMusUiClipSharingController::SessionRecipientNotFound [%d]", iTriedInvitations );
       
   926     
       
   927     // If the address has to be queried again...:
       
   928     iTranscode = EFalse;    
       
   929     
       
   930     CMusUiSendController::SessionRecipientNotFound();
       
   931         
       
   932     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionRecipientNotFound" );
       
   933     }
       
   934 
       
   935 
       
   936 // -----------------------------------------------------------------------------
       
   937 //
       
   938 // -----------------------------------------------------------------------------
       
   939 //
       
   940 void CMusUiClipSharingController::SessionTerminated()
       
   941     {
       
   942     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionTerminated" );
       
   943     DismissWaitDialog();
       
   944     if ( iTranscodingGoing )
       
   945         {
       
   946         TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( 
       
   947                                 R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) );
       
   948         }
       
   949     
       
   950     TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) );
       
   951         
       
   952     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionTerminated" );
       
   953     }
       
   954 
       
   955 
       
   956 // -----------------------------------------------------------------------------
       
   957 //
       
   958 // -----------------------------------------------------------------------------
       
   959 //
       
   960 void CMusUiClipSharingController::SessionConnectionLost()
       
   961     {
       
   962     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionConnectionLost" );
       
   963     DismissWaitDialog();
       
   964     TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( 
       
   965                             R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_LOST ) );
       
   966     
       
   967     TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) );
       
   968         
       
   969     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionConnectionLost" );
       
   970     }
       
   971 
       
   972 
       
   973 // -----------------------------------------------------------------------------
       
   974 //
       
   975 // -----------------------------------------------------------------------------
       
   976 //
       
   977 void CMusUiClipSharingController::SessionFailed()
       
   978     {
       
   979     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionFailed" );
       
   980     DismissWaitDialog();
       
   981     if ( iTranscodingGoing )
       
   982         {
       
   983         TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( 
       
   984                             R_MUS_VIEW_NOTE_UNABLE_TO_CONVERT ) );
       
   985         }
       
   986     
       
   987     TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) );
       
   988         
       
   989     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionFailed" );
       
   990     }
       
   991 
       
   992 
       
   993 // -----------------------------------------------------------------------------
       
   994 //
       
   995 // -----------------------------------------------------------------------------
       
   996 //
       
   997 void CMusUiClipSharingController::StreamIdle()
       
   998     {
       
   999     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::StreamIdle" );
       
  1000     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::StreamIdle" );
       
  1001     }
       
  1002 
       
  1003 
       
  1004 // -----------------------------------------------------------------------------
       
  1005 //
       
  1006 // -----------------------------------------------------------------------------
       
  1007 //
       
  1008 void CMusUiClipSharingController::StreamStreaming()
       
  1009     {
       
  1010     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::StreamStreaming" );
       
  1011     TRAPD( error, StreamStreamingL() );
       
  1012     if ( error != KErrNone )
       
  1013         {
       
  1014         iEventObserver.HandleError( error );
       
  1015         }
       
  1016     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::StreamStreaming" );
       
  1017     }
       
  1018 
       
  1019 
       
  1020 // -----------------------------------------------------------------------------
       
  1021 //
       
  1022 // -----------------------------------------------------------------------------
       
  1023 //
       
  1024 void CMusUiClipSharingController::SessionTimeChanged(
       
  1025                         const TTimeIntervalSeconds& aSeconds )
       
  1026     {
       
  1027     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionTimeChanged" );
       
  1028     TRAP_IGNORE( SessionTimeChangedL( aSeconds ) );
       
  1029     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionTimeChanged" );
       
  1030     }
       
  1031 
       
  1032 
       
  1033 // -----------------------------------------------------------------------------
       
  1034 //
       
  1035 // -----------------------------------------------------------------------------
       
  1036 //
       
  1037 void CMusUiClipSharingController::InactivityTimeout()
       
  1038     {
       
  1039     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::InactivityTimeout" );
       
  1040     DismissWaitDialog();
       
  1041     TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( 
       
  1042                             R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) );
       
  1043     
       
  1044     TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) );
       
  1045         
       
  1046     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::InactivityTimeout" );
       
  1047     }
       
  1048 
       
  1049 
       
  1050 // -----------------------------------------------------------------------------
       
  1051 // Called when predefined time elapsed 
       
  1052 // after the clip had reached the end
       
  1053 // -----------------------------------------------------------------------------
       
  1054 //
       
  1055 void CMusUiClipSharingController::TimerComplete( CMusUiActiveTimer* /*aTimer*/ )
       
  1056     {
       
  1057     MUS_LOG( "mus: [MUSUI ]  Close time elapsed from clip ending => \
       
  1058              closing session" );
       
  1059     TRAP_IGNORE( HandleExitL() )
       
  1060     }
       
  1061 
       
  1062 
       
  1063 // -----------------------------------------------------------------------------
       
  1064 //
       
  1065 // -----------------------------------------------------------------------------
       
  1066 //
       
  1067 void CMusUiClipSharingController::StreamStreamingL()
       
  1068     {
       
  1069     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::StreamStreamingL" );
       
  1070     
       
  1071     if ( ConnectionEstablished() )
       
  1072         {
       
  1073         iClipEnded = EFalse;
       
  1074         iCloseTimer->Cancel();    
       
  1075         iEventObserver.ShowNaviPaneIconL( EMusUiNaviIconPlay );
       
  1076         }
       
  1077         
       
  1078     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::StreamStreamingL" );
       
  1079     }
       
  1080 
       
  1081 
       
  1082 // -----------------------------------------------------------------------------
       
  1083 //
       
  1084 // -----------------------------------------------------------------------------
       
  1085 //
       
  1086 void CMusUiClipSharingController::SessionTimeChangedL( const TTimeIntervalSeconds& aSeconds )
       
  1087     {
       
  1088     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionTimeChangedL" );
       
  1089     if ( aSeconds.Int() > -1 )
       
  1090         {
       
  1091         TTimeIntervalSeconds clipDuration = iSession->DurationL();
       
  1092         TTimeIntervalSeconds clipPosition = iSession->PositionL();
       
  1093                 
       
  1094         iSharingObserver.UpdateSessionTime( SessionTimeFormatted( aSeconds ) );
       
  1095         iClipObserver.UpdateClipPositionL( clipPosition.Int(),
       
  1096                                           FormattedDurationString(  
       
  1097                                                 clipPosition, 
       
  1098                                                 clipDuration ) );
       
  1099         }
       
  1100     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionTimeChangedL" );
       
  1101     }
       
  1102 
       
  1103 
       
  1104 // -----------------------------------------------------------------------------
       
  1105 // CMusUiClipSharingController::SessionEstablished()
       
  1106 // -----------------------------------------------------------------------------
       
  1107 //
       
  1108 void CMusUiClipSharingController::SessionEstablished()
       
  1109     {
       
  1110     MUS_LOG( "mus: [MUSUI ]  -> CMusUiClipSharingController::SessionEstablished" );
       
  1111     
       
  1112     TRAPD( error, iResourceHandler->RequestVideoPlayerL( ETrue ) );
       
  1113     if ( error != KErrNone )
       
  1114         {
       
  1115         MUS_LOG1( "mus: [MUSUI ]     RequestVideoPlayerL leave code: %d", error )
       
  1116         }
       
  1117     
       
  1118     // Duration setting visible
       
  1119     TRAP( error, iClipObserver.SetDurationValue( iSession->DurationL().Int() ) )
       
  1120     if ( error != KErrNone )
       
  1121         {
       
  1122         HandleError( error );
       
  1123         }
       
  1124     iClipObserver.SetDurationVisible();
       
  1125 
       
  1126     // General handling
       
  1127     CMusUiSendController::SessionEstablished(); // Base class handling    
       
  1128     
       
  1129     MUS_LOG( "mus: [MUSUI ]  <- CMusUiClipSharingController::SessionEstablished" );
       
  1130     }
       
  1131 
       
  1132 
       
  1133 // -----------------------------------------------------------------------------
       
  1134 // CMusUiClipSharingController::DoFastForwardingL()
       
  1135 // -----------------------------------------------------------------------------
       
  1136 //
       
  1137 TBool CMusUiClipSharingController::DoFastForwardingL( TBool aUseWinding )
       
  1138     {
       
  1139     if( iFastForward ^ aUseWinding ) 
       
  1140         {
       
  1141         iSession->FastForwardL( aUseWinding );
       
  1142         iFastForward = aUseWinding;
       
  1143         return ETrue;
       
  1144         }
       
  1145     return EFalse;
       
  1146     }
       
  1147 
       
  1148 
       
  1149 // -----------------------------------------------------------------------------
       
  1150 // CMusUiClipSharingController::DoFastRewindingL()
       
  1151 // -----------------------------------------------------------------------------
       
  1152 //    
       
  1153 TBool CMusUiClipSharingController::DoFastRewindingL( TBool aUseWinding )
       
  1154     {
       
  1155     if( iFastRewind ^ aUseWinding ) 
       
  1156         {
       
  1157         iSession->FastRewindL( aUseWinding );
       
  1158         iFastRewind = aUseWinding;
       
  1159         return ETrue;
       
  1160         }
       
  1161     return EFalse;
       
  1162     }
       
  1163     
       
  1164 
       
  1165 // End of file
       
  1166