videoplayback/videohelix/inc/mpxvideoplaybackmode.h
changeset 0 96612d01cf9f
child 14 55fa1ec415c6
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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:   This class plays files with the Helix Engine
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 14 %
       
    19 
       
    20 
       
    21 #ifndef _CMPXVIDEOPLAYBACKMODE_H_
       
    22 #define _CMPXVIDEOPLAYBACKMODE_H_
       
    23 
       
    24 //
       
    25 //  INCLUDES
       
    26 //
       
    27 #include <e32def.h>
       
    28 #include <e32base.h>
       
    29 
       
    30 #include "mpxhelixplaybackplugindefs.h"
       
    31 #include "mpxvideodlmgrif.h"
       
    32 #include "mpxvideo_debug.h"
       
    33 
       
    34 //
       
    35 //  FORWARD DECLARATIONS
       
    36 //
       
    37 class CMPXVideoPlaybackController;
       
    38 class CMPXVideoDlMgrIf;
       
    39 
       
    40 
       
    41 //
       
    42 //  CLASS DECLARATION
       
    43 //
       
    44 
       
    45 /*
       
    46  *  CMpxVideoPlaybackMode class
       
    47  */
       
    48 NONSHARABLE_CLASS( CMPXVideoPlaybackMode ) : public CBase
       
    49 {
       
    50     public:
       
    51         //
       
    52         //  Constructors and destructor
       
    53         //
       
    54 
       
    55         /*
       
    56          *  Destructor
       
    57          *  Destroy the object and release all memory objects
       
    58          */
       
    59         ~CMPXVideoPlaybackMode();
       
    60 
       
    61         inline virtual TInt GetMode();
       
    62         virtual void ConnectToDownloadL( CMPXCommand& aCmd );
       
    63         virtual void HandleOpenComplete();
       
    64         virtual void GetPdlStatusL( CMPXCommand& aCmd );
       
    65         virtual void UpdateSeekPosition( TInt64& aPosition );
       
    66         inline virtual TBool IsDownloadPaused();
       
    67         virtual void HandlePause();
       
    68         virtual void HandleBackground();
       
    69         virtual TBool IsNetworkMode2GL();
       
    70         virtual TBool CanPlayNow();
       
    71         virtual TBool IsTvOutAllowedL();
       
    72         virtual void OpenFileL( const TDesC& aMediaFile );
       
    73         virtual void OpenFileL( const RFile& aMediaFile );
       
    74 
       
    75 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
    76         virtual void OpenFile64L( const RFile64& aMediaFile );
       
    77 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
    78 
       
    79 
       
    80     protected:
       
    81         /*
       
    82          *  C++ default constructor
       
    83          */
       
    84         CMPXVideoPlaybackMode();
       
    85 
       
    86         /*
       
    87          *  the second phase constructor ConstructL to safely construct things
       
    88          *  that can leave
       
    89          */
       
    90         virtual void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
       
    91 
       
    92 
       
    93     protected:
       
    94         //
       
    95         //  Data
       
    96         //
       
    97         CMPXVideoPlaybackController*        iVideoPlaybackCtlr;   // not owned
       
    98 
       
    99 };
       
   100 
       
   101 /*******************************************************/
       
   102 /*         SUB CLASS DECLARATIONS                      */
       
   103 /*******************************************************/
       
   104 
       
   105 ////////////////////////////////////////////////////////
       
   106 ///     Declaration of CMPXLocalPlaybackMode
       
   107 ////////////////////////////////////////////////////////
       
   108 class CMPXLocalPlaybackMode : public CMPXVideoPlaybackMode
       
   109 {
       
   110     public:
       
   111         static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
       
   112         virtual ~CMPXLocalPlaybackMode();
       
   113 
       
   114         // Methods where video plabkack behavior varies for local media
       
   115         inline virtual TInt GetMode();
       
   116 };
       
   117 
       
   118 
       
   119 ////////////////////////////////////////////////////////
       
   120 ///     Declaration of CMPXStreamingPlaybackMode
       
   121 ////////////////////////////////////////////////////////
       
   122 class CMPXStreamingPlaybackMode : public CMPXVideoPlaybackMode
       
   123 {
       
   124     public:
       
   125         static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
       
   126         virtual ~CMPXStreamingPlaybackMode();
       
   127 
       
   128         // Methods where video plabkack behavior varies for streaming media
       
   129         inline virtual TInt GetMode();
       
   130         virtual TBool CanPlayNow();
       
   131         virtual void HandleOpenComplete();
       
   132         TBool IsTvOutAllowedL();
       
   133         void OpenFileL( const TDesC& aMediaFile );
       
   134         virtual void HandlePause();
       
   135 };
       
   136 
       
   137 ////////////////////////////////////////////////////////////
       
   138 ///     Declaration of CMPXLiveStreamingPlaybackMode
       
   139 ///
       
   140 ///     live streaming is a specialized streaming case
       
   141 ////////////////////////////////////////////////////////////
       
   142 class CMPXLiveStreamingPlaybackMode : public CMPXStreamingPlaybackMode
       
   143 {
       
   144     public:
       
   145         static CMPXVideoPlaybackMode* NewL(CMPXVideoPlaybackController* aVideoPlaybackCtlr);
       
   146         virtual ~CMPXLiveStreamingPlaybackMode();
       
   147 
       
   148         // Methods where video plabkack behavior varies for live streaming media
       
   149         inline virtual TInt GetMode();
       
   150         virtual void HandlePause();
       
   151         virtual void HandleBackground();
       
   152 };
       
   153 
       
   154 ////////////////////////////////////////////////////////////////////////////////
       
   155 //
       
   156 //     Declaration of CMPXProgressiveDLPlaybackMode
       
   157 //
       
   158 //     Progressive Download is a specialized local playback case
       
   159 //
       
   160 ////////////////////////////////////////////////////////////////////////////////
       
   161 class CMPXProgressiveDLPlaybackMode : public CMPXLocalPlaybackMode
       
   162 {
       
   163     public:
       
   164         static CMPXVideoPlaybackMode* NewL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
       
   165         virtual ~CMPXProgressiveDLPlaybackMode();
       
   166 
       
   167         inline virtual TInt GetMode();
       
   168         void ConnectToDownloadL( CMPXCommand& aCmd );
       
   169         void HandleOpenComplete();
       
   170         void GetPdlStatusL( CMPXCommand& aCmd );
       
   171         void UpdateSeekPosition( TInt64& aPosition );
       
   172         inline TBool IsDownloadPaused();
       
   173 
       
   174     private:
       
   175 
       
   176         void ConstructL( CMPXVideoPlaybackController* aVideoPlaybackCtlr );
       
   177 
       
   178     private:
       
   179         CMPXVideoDlMgrIf*  iDlMgrIf;   // owned
       
   180 };
       
   181 
       
   182 // INLINE METHODS
       
   183 
       
   184 inline
       
   185 TInt CMPXVideoPlaybackMode::GetMode()
       
   186 {
       
   187     MPX_DEBUG(_L("CMPXVideoPlaybackMode::GetMode()"));
       
   188     // sub-classes to return their respective value
       
   189     return EMPXNumberOfModes;
       
   190 }
       
   191 
       
   192 inline
       
   193 TInt CMPXLocalPlaybackMode::GetMode()
       
   194 {
       
   195     MPX_DEBUG(_L("CMPXLocalPlaybackMode::GetMode()"));
       
   196     return EMPXVideoLocal;
       
   197 }
       
   198 
       
   199 inline
       
   200 TInt CMPXStreamingPlaybackMode::GetMode()
       
   201 {
       
   202     MPX_DEBUG(_L("CMPXStreamingPlaybackMode::GetMode()"));
       
   203     return EMPXVideoStreaming;
       
   204 }
       
   205 
       
   206 inline
       
   207 TInt CMPXLiveStreamingPlaybackMode::GetMode()
       
   208 {
       
   209     MPX_DEBUG(_L("CMPXLiveStreamingPlaybackMode::GetMode()"));
       
   210     return EMPXVideoLiveStreaming;
       
   211 }
       
   212 
       
   213 inline
       
   214 TInt CMPXProgressiveDLPlaybackMode::GetMode()
       
   215 {
       
   216     MPX_DEBUG(_L("CMPXProgressiveDLPlaybackMode::GetMode()"));
       
   217     return EMPXVideoProgressiveDownload;
       
   218 }
       
   219 
       
   220 inline
       
   221 TBool CMPXVideoPlaybackMode::IsDownloadPaused()
       
   222 {
       
   223     return EFalse;
       
   224 }
       
   225 
       
   226 inline
       
   227 TBool CMPXProgressiveDLPlaybackMode::IsDownloadPaused()
       
   228 {
       
   229     return iDlMgrIf->IsDownloadPaused();
       
   230 }
       
   231 
       
   232 #endif  //_CMPXVIDEOPLAYBACKMODE_H_