videoplayback/hbvideoplaybackview/controlsrc/mpxvideoplaybackprogressbar.cpp
changeset 37 4eb2df7f7cbe
parent 36 8aed59de29f9
child 38 ff53afa8ad05
equal deleted inserted replaced
36:8aed59de29f9 37:4eb2df7f7cbe
    13 *
    13 *
    14 * Description:  Implementation of QMPXVideoPlaybackProgressBar
    14 * Description:  Implementation of QMPXVideoPlaybackProgressBar
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: da1mmcf#18 %
    18 // Version : %version: da1mmcf#21 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 
    22 
    23 #include <QTime>
    23 #include <QTime>
    24 #include <QTimer>
    24 #include <QTimer>
    25 #include <QGraphicsSceneMouseEvent>
    25 #include <QGraphicsSceneMouseEvent>
    26 
    26 
    27 #include <hblabel.h>
    27 #include <hblabel.h>
       
    28 #include <hbframeitem.h>
       
    29 #include <hbframedrawer.h>
    28 #include <hbprogressslider.h>
    30 #include <hbprogressslider.h>
    29 #include <hbextendedlocale.h>
    31 #include <hbextendedlocale.h>
    30 
    32 
    31 #include "mpxvideo_debug.h"
    33 #include "mpxvideo_debug.h"
    32 #include "mpxvideoplaybackprogressbar.h"
    34 #include "mpxvideoplaybackprogressbar.h"
    40 // -------------------------------------------------------------------------------------------------
    42 // -------------------------------------------------------------------------------------------------
    41 //
    43 //
    42 QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar( 
    44 QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar( 
    43         QMPXVideoPlaybackControlsController* controller )
    45         QMPXVideoPlaybackControlsController* controller )
    44     : mController( controller )
    46     : mController( controller )
       
    47     , mFrameItem( NULL )
    45     , mDuration( -1 )
    48     , mDuration( -1 )
    46     , mDraggingPosition( 0 )
    49     , mDraggingPosition( 0 )
    47     , mSetPosition( -1 )
    50     , mSetPosition( -1 )
    48     , mNeedToResumeAfterSetPosition( false )
    51     , mNeedToResumeAfterSetPosition( false )
    49     , mInitialized( false )
    52     , mInitialized( false )
    50     , mSliderDragging( false )
    53     , mSliderDragging( false )
    51     , mLongTimeFormat( false )
    54     , mLongTimeFormat( false )
    52     , mLiveStreaming( false )
    55     , mLiveStreaming( false )
       
    56     , mSeekingTimer( NULL )
    53 {
    57 {
    54     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
    58     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::QMPXVideoPlaybackProgressBar()"));
    55 }
    59 }
    56 
    60 
    57 // -------------------------------------------------------------------------------------------------
    61 // -------------------------------------------------------------------------------------------------
    60 //
    64 //
    61 QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
    65 QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()
    62 {
    66 {
    63     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
    67     MPX_ENTER_EXIT(_L("QMPXVideoPlaybackProgressBar::~QMPXVideoPlaybackProgressBar()"));
    64 
    68 
    65     disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
       
    66 
       
    67     if ( mSeekingTimer )
    69     if ( mSeekingTimer )
    68     {
    70     {
       
    71         disconnect( mSeekingTimer, SIGNAL( timeout() ), this, SLOT( handleSeekingTimeout() ) );
       
    72         
    69         if ( mSeekingTimer->isActive() )
    73         if ( mSeekingTimer->isActive() )
    70         {
    74         {
    71             mSeekingTimer->stop();
    75             mSeekingTimer->stop();
    72         }
    76         }
    73 
    77 
   122 
   126 
   123         //
   127         //
   124         // Set the position to 0 until we get position information
   128         // Set the position to 0 until we get position information
   125         //
   129         //
   126         positionChanged( 0 );
   130         positionChanged( 0 );
       
   131 
       
   132 
       
   133         //
       
   134         // Set framedrawer for semi transparent background
       
   135         //
       
   136         mFrameItem = new HbFrameItem ( parentItem() );
       
   137         mFrameItem->setGeometry( boundingRect() );
       
   138         mFrameItem->frameDrawer().setFrameGraphicsName( "qtg_fr_multimedia_trans" );
       
   139         mFrameItem->frameDrawer().setFrameType( HbFrameDrawer::NinePieces );
       
   140         mFrameItem->frameDrawer().setFillWholeRect( true );
       
   141         mFrameItem->setVisible( false );
   127     }
   142     }
   128 }
   143 }
   129 
   144 
   130 // -------------------------------------------------------------------------------------------------
   145 // -------------------------------------------------------------------------------------------------
   131 // QMPXVideoPlaybackProgressBar::durationChanged
   146 // QMPXVideoPlaybackProgressBar::durationChanged
   353 
   368 
   354     if ( details->mPlaybackMode == EMPXVideoLiveStreaming )
   369     if ( details->mPlaybackMode == EMPXVideoLiveStreaming )
   355     {
   370     {
   356         mProgressSlider->setEnabled( false );
   371         mProgressSlider->setEnabled( false );
   357     }
   372     }
   358     else if ( details->mTvOutConnected && ! details->mTvOutPlayAllowed )
       
   359     {
       
   360         mProgressSlider->setEnabled( false );
       
   361     }
       
   362     else if ( ! mProgressSlider->isEnabled() )
   373     else if ( ! mProgressSlider->isEnabled() )
   363     {
   374     {
   364         mProgressSlider->setEnabled( true );
   375         mProgressSlider->setEnabled( true );
   365     }
   376     }
       
   377 
       
   378     mFrameItem->setVisible( ( mController->viewMode() == EFullScreenView )? ETrue:EFalse );
   366 }
   379 }
   367 
   380 
   368 // -------------------------------------------------------------------------------------------------
   381 // -------------------------------------------------------------------------------------------------
   369 // QMPXVideoPlaybackProgressBar::updateState()
   382 // QMPXVideoPlaybackProgressBar::updateState()
   370 // -------------------------------------------------------------------------------------------------
   383 // -------------------------------------------------------------------------------------------------