videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp
changeset 20 b9e04db066d4
parent 17 69946d1824c4
child 24 7d93ee07fb27
equal deleted inserted replaced
17:69946d1824c4 20:b9e04db066d4
    13 *
    13 *
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: da1mmcf#34 %
    18 // Version : %version: da1mmcf#37 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <coecntrl.h>
    23 #include <coecntrl.h>
    35 #include <hbratingslider.h>
    35 #include <hbratingslider.h>
    36 #include <hbiconanimator.h>
    36 #include <hbiconanimator.h>
    37 #include <hbvolumesliderpopup.h>
    37 #include <hbvolumesliderpopup.h>
    38 #include <hbtransparentwindow.h>
    38 #include <hbtransparentwindow.h>
    39 #include <hbiconanimationmanager.h>
    39 #include <hbiconanimationmanager.h>
       
    40 #include <shareui.h>
    40 
    41 
    41 #include "mpxvideoviewwrapper.h"
    42 #include "mpxvideoviewwrapper.h"
    42 #include "hbvideobaseplaybackview.h"
    43 #include "hbvideobaseplaybackview.h"
    43 #include "mpxvideoplaybackcontrolbar.h"
    44 #include "mpxvideoplaybackcontrolbar.h"
    44 #include "mpxvideoplaybackcontrolpolicy.h"
    45 #include "mpxvideoplaybackcontrolpolicy.h"
   266         changeViewMode( EAudioOnlyView, false );
   267         changeViewMode( EAudioOnlyView, false );
   267     }
   268     }
   268 
   269 
   269     if ( details->mTvOutConnected )
   270     if ( details->mTvOutConnected )
   270     {
   271     {
   271         handleEvent( EMPXControlCmdTvOutConnected, details->mTvOutPlayAllowed );
   272         handleEvent( EMPXControlCmdTvOutConnected );
   272     }
   273     }
   273 
   274 
   274     //
   275     //
   275     // Dimmed the volume control if it is video only
   276     // Dimmed the volume control if it is video only
   276     //
   277     //
   369         }
   370         }
   370         case EMPXControlCmdTvOutConnected:
   371         case EMPXControlCmdTvOutConnected:
   371         {
   372         {
   372             MPX_DEBUG(_L("    [EMPXControlCmdTvOutConnected]"));
   373             MPX_DEBUG(_L("    [EMPXControlCmdTvOutConnected]"));
   373 
   374 
   374             handleTvOutEvent( true, event, value );
   375             handleTvOutEvent( true, event );
   375             break;
   376             break;
   376         }
   377         }
   377         case EMPXControlCmdTvOutDisconnected:
   378         case EMPXControlCmdTvOutDisconnected:
   378         {
   379         {
   379             MPX_DEBUG(_L("    [EMPXControlCmdTvOutDisConnected]"));
   380             MPX_DEBUG(_L("    [EMPXControlCmdTvOutDisConnected]"));
   380 
   381 
   381             handleTvOutEvent( false, event, value );
   382             handleTvOutEvent( false, event );
   382             break;
   383             break;
   383         }
   384         }
   384         case EMPXControlCmdHandleErrors:
   385         case EMPXControlCmdHandleErrors:
   385         {
   386         {
   386             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
   387             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
  1070 // -------------------------------------------------------------------------------------------------
  1071 // -------------------------------------------------------------------------------------------------
  1071 //   QMPXVideoPlaybackControlsController::handleTvOutEvent
  1072 //   QMPXVideoPlaybackControlsController::handleTvOutEvent
  1072 // -------------------------------------------------------------------------------------------------
  1073 // -------------------------------------------------------------------------------------------------
  1073 //
  1074 //
  1074 void QMPXVideoPlaybackControlsController::handleTvOutEvent(
  1075 void QMPXVideoPlaybackControlsController::handleTvOutEvent(
  1075         bool connected, TMPXVideoPlaybackControlCommandIds event, int value )
  1076         bool connected, TMPXVideoPlaybackControlCommandIds event )
  1076 {
  1077 {
  1077     Q_UNUSED( event );
  1078     Q_UNUSED( event );
  1078 
  1079 
  1079     MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTvOutEvent()"));
  1080     MPX_DEBUG(_L("QMPXVideoPlaybackControlsController::handleTvOutEvent()"));
  1080 
  1081 
  1083     setDefaultBitmap();
  1084     setDefaultBitmap();
  1084 
  1085 
  1085     if ( mFileDetails->mTvOutConnected )
  1086     if ( mFileDetails->mTvOutConnected )
  1086     {
  1087     {
  1087         generateThumbNail();
  1088         generateThumbNail();
  1088         mFileDetails->mTvOutPlayAllowed = value;
       
  1089     }
       
  1090     else
       
  1091     {
       
  1092         mFileDetails->mTvOutPlayAllowed = ETrue;
       
  1093     }
  1089     }
  1094 
  1090 
  1095     //
  1091     //
  1096     // Change the view. 
  1092     // Change the view. 
  1097     // If Tv-out is connected, go to AudioOnlyView.
  1093     // If Tv-out is connected, go to AudioOnlyView.
  1364 // QMPXVideoPlaybackControlsController::attachVideo()
  1360 // QMPXVideoPlaybackControlsController::attachVideo()
  1365 // -------------------------------------------------------------------------------------------------
  1361 // -------------------------------------------------------------------------------------------------
  1366 //
  1362 //
  1367 void QMPXVideoPlaybackControlsController::attachVideo()
  1363 void QMPXVideoPlaybackControlsController::attachVideo()
  1368 {
  1364 {
  1369     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"));
  1365     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::attachVideo()"),
       
  1366                    _L("file = %s"), mFileDetails->mClipName.data() );
  1370     
  1367     
  1371 	//
  1368     //
  1372 	// close and release resources
  1369     // close playback view
  1373 	//
  1370     //
  1374     handleCommand( EMPXPbvCmdClose );
  1371     mView->closePlaybackView();
  1375 	
  1372 	
  1376 	//
  1373     //
  1377 	// emit signal to launch videoservices itemSelected() slot
  1374     // emit signal to launch videoservices itemSelected() slot
  1378 	//
  1375     //
  1379     emit( attachVideoPath( mFileDetails->mClipName ) );
  1376     emit( attachVideoPath( mFileDetails->mClipName ) );
  1380     
  1377     
  1381 }
  1378 }
  1382 
  1379 
       
  1380 // -------------------------------------------------------------------------------------------------
       
  1381 // QMPXVideoPlaybackControlsController::sendVideo()
       
  1382 // -------------------------------------------------------------------------------------------------
       
  1383 //
       
  1384 void QMPXVideoPlaybackControlsController::sendVideo()
       
  1385 {
       
  1386     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::sendVideo()"),
       
  1387                    _L("file = %s"), mFileDetails->mClipName.data() );
       
  1388     
       
  1389     //
       
  1390     // pause playback
       
  1391     //
       
  1392     handleCommand( EMPXPbvCmdPause );
       
  1393     
       
  1394     // 
       
  1395     // send video to shareUI
       
  1396     //
       
  1397     ShareUi dlg;
       
  1398     QStringList fileList;
       
  1399     fileList.append( mFileDetails->mClipName );
       
  1400     dlg.send( fileList, true );   
       
  1401 }
       
  1402 
  1383 // End of File
  1403 // End of File