videoplayback/hbvideoplaybackview/viewsrc/hbvideobaseplaybackview.cpp
changeset 20 b9e04db066d4
parent 17 69946d1824c4
child 24 7d93ee07fb27
equal deleted inserted replaced
17:69946d1824c4 20:b9e04db066d4
    13 *
    13 *
    14 * Description:   Implementation of Video base playback view
    14 * Description:   Implementation of Video base playback view
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: da1mmcf#34 %
    18 // Version : %version: da1mmcf#38 %
    19 
    19 
    20 
    20 
    21 
    21 
    22 //  Include Files
    22 //  Include Files
    23 
    23 
    26 #include <QTimer>
    26 #include <QTimer>
    27 #include <QGraphicsSceneEvent>
    27 #include <QGraphicsSceneEvent>
    28 
    28 
    29 #include <hbmenu.h>
    29 #include <hbmenu.h>
    30 #include <hbaction.h>
    30 #include <hbaction.h>
    31 #include <hbgesture.h>
       
    32 #include <hbinstance.h>
    31 #include <hbinstance.h>
    33 #include <hbnotificationdialog.h>
    32 #include <hbnotificationdialog.h>
    34 #include <hblabel.h>
    33 #include <hblabel.h>
    35 
    34 
    36 #include <textresolver.h>
    35 #include <textresolver.h>
    86 //
    85 //
    87 HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
    86 HbVideoBasePlaybackView::~HbVideoBasePlaybackView()
    88 {
    87 {
    89     MPX_DEBUG(_L("HbVideoBasePlaybackView::~HbVideoBasePlaybackView()"));
    88     MPX_DEBUG(_L("HbVideoBasePlaybackView::~HbVideoBasePlaybackView()"));
    90 
    89 
    91     disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
       
    92 
       
    93     if ( mTimerForClosingView )
    90     if ( mTimerForClosingView )
    94     {
    91     {        
       
    92         disconnect( mTimerForClosingView, SIGNAL( timeout() ), this, SIGNAL( activatePreviousView() ) );
       
    93         
    95         if ( mTimerForClosingView->isActive() )
    94         if ( mTimerForClosingView->isActive() )
    96         {
    95         {
    97             mTimerForClosingView->stop();
    96             mTimerForClosingView->stop();
    98         }
    97         }
    99 
    98 
   100         delete mTimerForClosingView;
    99         delete mTimerForClosingView;
   101         mTimerForClosingView = NULL;
   100         mTimerForClosingView = NULL;
   102     }
   101     }
   103 
   102 
       
   103     if ( mVideoMpxWrapper )
       
   104     {
       
   105         delete mVideoMpxWrapper;
       
   106         mVideoMpxWrapper = NULL;
       
   107     }
   104 
   108 
   105     setParentItem( 0 );
   109     setParentItem( 0 );
   106 }
   110 }
   107 
   111 
   108 // -------------------------------------------------------------------------------------------------
   112 // -------------------------------------------------------------------------------------------------
   119     //  Request the needed Media from the Playback Plugin
   123     //  Request the needed Media from the Playback Plugin
   120     //
   124     //
   121     TRAP_IGNORE( mVideoMpxWrapper->RequestMediaL() ); 
   125     TRAP_IGNORE( mVideoMpxWrapper->RequestMediaL() ); 
   122     
   126     
   123     menu()->close();
   127     menu()->close();
   124 
       
   125     hideItems( Hb::ToolBarItem );
       
   126 
   128 
   127     //
   129     //
   128     // Landscape orientation
   130     // Landscape orientation
   129     //
   131     //
   130     hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal );  
   132     hbInstance->allMainWindows()[0]->setOrientation( Qt::Horizontal );  
   156 
   158 
   157     //
   159     //
   158     // go back to device orientation
   160     // go back to device orientation
   159     //
   161     //
   160     //hbInstance->allMainWindows()[0]->unsetOrientation();
   162     //hbInstance->allMainWindows()[0]->unsetOrientation();
   161 
       
   162     showItems( Hb::ToolBarItem );
       
   163 }
   163 }
   164 
   164 
   165 // -------------------------------------------------------------------------------------------------
   165 // -------------------------------------------------------------------------------------------------
   166 //   HbVideoBasePlaybackView::handleClosePlaybackView()
   166 //   HbVideoBasePlaybackView::handleClosePlaybackView()
   167 // -------------------------------------------------------------------------------------------------
   167 // -------------------------------------------------------------------------------------------------
   207         case KMPXVideoCallOngoingError:
   207         case KMPXVideoCallOngoingError:
   208         {
   208         {
   209             showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
   209             showDialog( hbTrId( "txt_videos_info_video_playback_is_not_allowed_duri" ), false );
   210             break;
   210             break;
   211         }
   211         }
   212         case KMPXVideoTvOutPlaybackNotAllowed:
       
   213         {
       
   214             showDialog( hbTrId( "txt_videos_info_protected_clip_can_not_be_played" ), false );
       
   215             break;
       
   216         }
       
   217         case KMPXVideoTvOutPlaybackNotAllowedClose:
       
   218         {
       
   219             showDialog( hbTrId( "txt_videos_info_protected_clip_can_not_be_played" ) );
       
   220             break;
       
   221         }
       
   222         default:
   212         default:
   223         {
   213         {
   224             TRAP_IGNORE(  
   214             TRAP_IGNORE(  
   225 
   215 
   226                 //
   216                 //