videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackcontrolscontroller.cpp
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
    13 *
    13 *
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: da1mmcf#27 %
    18 // Version : %version: da1mmcf#29 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <coecntrl.h>
    23 #include <coecntrl.h>
    24 #include <bautils.h>
    24 #include <bautils.h>
    25 #include <barsread.h>
    25 #include <barsread.h>
    26 #include <StringLoader.h>
       
    27 #include <f32file.h>
    26 #include <f32file.h>
    28 
    27 
    29 #include <QTimer>
    28 #include <QTimer>
    30 #include <QFileInfo>
    29 #include <QFileInfo>
    31 #include <thumbnailmanager_qt.h>
    30 #include <thumbnailmanager_qt.h>
    34 #include <hbaction.h>
    33 #include <hbaction.h>
    35 #include <hbiconitem.h>
    34 #include <hbiconitem.h>
    36 #include <hbratingslider.h>
    35 #include <hbratingslider.h>
    37 #include <hbiconanimator.h>
    36 #include <hbiconanimator.h>
    38 #include <hbtransparentwindow.h>
    37 #include <hbtransparentwindow.h>
       
    38 #include <hbiconanimationmanager.h>
    39 
    39 
    40 #include "mpxvideoviewwrapper.h"
    40 #include "mpxvideoviewwrapper.h"
    41 #include "hbvideobaseplaybackview.h"
    41 #include "hbvideobaseplaybackview.h"
    42 #include "mpxvideoplaybackbuttonbar.h"
    42 #include "mpxvideoplaybackcontrolbar.h"
    43 #include "mpxvideoplaybackprogressbar.h"
       
    44 #include "mpxvideoplaybackcontrolpolicy.h"
    43 #include "mpxvideoplaybackcontrolpolicy.h"
    45 #include "mpxvideoplaybackdocumentloader.h"
    44 #include "mpxvideoplaybackdocumentloader.h"
    46 #include "mpxvideoplaybackviewfiledetails.h"
    45 #include "mpxvideoplaybackviewfiledetails.h"
    47 #include "mpxvideoplaybackstatuspanecontrol.h"
    46 #include "mpxvideoplaybackstatuspanecontrol.h"
    48 #include "mpxvideoplaybackfiledetailswidget.h"
    47 #include "mpxvideoplaybackfiledetailswidget.h"
   184 // -------------------------------------------------------------------------------------------------
   183 // -------------------------------------------------------------------------------------------------
   185 //
   184 //
   186 void QMPXVideoPlaybackControlsController::addFileDetails(
   185 void QMPXVideoPlaybackControlsController::addFileDetails(
   187     QMPXVideoPlaybackViewFileDetails* details )
   186     QMPXVideoPlaybackViewFileDetails* details )
   188 {
   187 {
       
   188     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackControlsController::addFileDetails"));
       
   189 
   189     //
   190     //
   190     // If it is not local, hide the star rating
   191     // If it is not local, hide the star rating
   191     //
   192     //
   192     if ( details->mPlaybackMode != EMPXVideoLocal )
   193     if ( details->mPlaybackMode != EMPXVideoLocal )
   193     {
   194     {
   479         case EMPXBufferingAnimation:
   480         case EMPXBufferingAnimation:
   480         {
   481         {
   481             //
   482             //
   482             // Buffering animation icon
   483             // Buffering animation icon
   483             //
   484             //
       
   485             HbIconAnimationManager* manager = HbIconAnimationManager::global();
       
   486             manager->addDefinitionFile(":/hbvideoplaybackview/animation.axml");
       
   487 			
   484             QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
   488             QGraphicsWidget *widget = mLoader->findWidget( QString( "bufferingIcon" ) );
   485             HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
   489             HbLabel *bufferingAnim = qobject_cast<HbLabel*>( widget );
   486             HbIconItem *iconItem = new HbIconItem( bufferingAnim->icon() );
       
   487             iconItem->animator().startAnimation();
       
   488 
   490 
   489             control = new QMPXVideoPlaybackFullScreenControl( this,
   491             control = new QMPXVideoPlaybackFullScreenControl( this,
   490                                                               controlIndex,
   492                                                               controlIndex,
   491                                                               bufferingAnim,
   493                                                               bufferingAnim,
   492                                                               properties );
   494                                                               properties );
   505                                                               properties );
   507                                                               properties );
   506             mControls.append( control );
   508             mControls.append( control );
   507 
   509 
   508             break;
   510             break;
   509         }
   511         }
   510         case EMPXButtonBar:
   512         case EMPXControlBar:
   511         {
   513         {
   512             //
   514             //
   513             // Button bar
   515             // Button bar
   514             //
   516             //
   515             QGraphicsWidget *widget = mLoader->findWidget( QString( "buttonBarLayout" ) );
   517             QGraphicsWidget *widget = mLoader->findWidget( QString( "controlBarLayout" ) );
   516             QMPXVideoPlaybackButtonBar *buttonBar = 
   518             QMPXVideoPlaybackControlBar *controlBar = 
   517                 qobject_cast<QMPXVideoPlaybackButtonBar*>( widget );
   519                 qobject_cast<QMPXVideoPlaybackControlBar*>( widget );
   518             buttonBar->initialize();
   520             controlBar->initialize();
   519 
   521 
   520             control = new QMPXVideoPlaybackFullScreenControl( this,
   522             control = new QMPXVideoPlaybackFullScreenControl( this,
   521                                                               controlIndex,
   523                                                               controlIndex,
   522                                                               buttonBar,
   524                                                               controlBar,
   523                                                               properties );
   525                                                               properties );
   524             mControls.append( control );
       
   525 
       
   526             break;
       
   527         }
       
   528         case EMPXProgressBar:
       
   529         {
       
   530             //
       
   531             // Progress bar
       
   532             //
       
   533             QGraphicsWidget *widget = mLoader->findWidget( QString( "progressBarLayout" ) );
       
   534             QMPXVideoPlaybackProgressBar *progressBar = 
       
   535                 qobject_cast<QMPXVideoPlaybackProgressBar*>( widget );
       
   536             progressBar->initialize();
       
   537 
       
   538             control = new QMPXVideoPlaybackFullScreenControl( this,
       
   539                                                               controlIndex,
       
   540                                                               progressBar,
       
   541                                                               properties );
       
   542 
       
   543             mControls.append( control );
   526             mControls.append( control );
   544 
   527 
   545             break;
   528             break;
   546         }
   529         }
   547         case EMPXFileDetailsWidget:
   530         case EMPXFileDetailsWidget:
   701 {
   684 {
   702     bool visible = EFalse;
   685     bool visible = EFalse;
   703 
   686 
   704     for ( int i = 0 ; i < mControls.count() ; i++ )
   687     for ( int i = 0 ; i < mControls.count() ; i++ )
   705     {
   688     {
   706         if ( mControls[i]->controlIndex() == EMPXButtonBar )
   689         if ( mControls[i]->controlIndex() == EMPXControlBar )
   707         {
   690         {
   708             if ( mControls[i]->isVisible() )
   691             if ( mControls[i]->isVisible() )
   709             {
   692             {
   710                 visible = ETrue;
   693                 visible = ETrue;
   711             }
   694             }