videoplayback/videoplaybackview/viewinc/mpxvideoviewwrapper.h
author hgs
Mon, 23 Aug 2010 14:27:29 +0300
changeset 55 4bfa887905cf
parent 50 21fe8338c6bf
child 63 4707a0db12f6
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  MPX Video base playback view
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
55
hgs
parents: 50
diff changeset
    18
// Version : %version:  da1mmcf#24 %
44
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
// This file defines the API for .dll
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#ifndef __MPXVIDEOVIEWWRAPPER_H__
hgs
parents:
diff changeset
    25
#define __MPXVIDEOVIEWWRAPPER_H__
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
//  Include Files
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
#include <e32base.h>	// CBase
hgs
parents:
diff changeset
    30
#include <e32std.h>	 // TBuf
hgs
parents:
diff changeset
    31
#include <mpxplaybackobserver.h>
hgs
parents:
diff changeset
    32
#include <mpxvideoplaybackdefs.h>
hgs
parents:
diff changeset
    33
#include <mpxviewactivationobserver.h>
hgs
parents:
diff changeset
    34
#include <mpxcollectionobserver.h>
hgs
parents:
diff changeset
    35
hgs
parents:
diff changeset
    36
#include "videoplaybackcontrol.hrh"
hgs
parents:
diff changeset
    37
hgs
parents:
diff changeset
    38
enum TMPXMediaRequestStatus
hgs
parents:
diff changeset
    39
{
hgs
parents:
diff changeset
    40
    MediaNotRequested,
hgs
parents:
diff changeset
    41
    MediaRequested,
hgs
parents:
diff changeset
    42
    MediaDelivered
hgs
parents:
diff changeset
    43
};
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
//  Forward Declarations
hgs
parents:
diff changeset
    46
class MMPXPlaybackUtility;
hgs
parents:
diff changeset
    47
class MMPXCollectionUtility;
hgs
parents:
diff changeset
    48
class VideoBasePlaybackView;
55
hgs
parents: 50
diff changeset
    49
class CVideoPlaybackDisplayHandler;
44
hgs
parents:
diff changeset
    50
class VideoPlaybackViewFileDetails;
55
hgs
parents: 50
diff changeset
    51
class CVideoPlaybackUserInputHandler;
44
hgs
parents:
diff changeset
    52
class VideoPlaybackControlsController;
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
//  Class Definitions
hgs
parents:
diff changeset
    55
hgs
parents:
diff changeset
    56
class CMPXVideoViewWrapper : public CBase,
hgs
parents:
diff changeset
    57
                             public MMPXPlaybackObserver,
hgs
parents:
diff changeset
    58
                             public MMPXViewActivationObserver,
hgs
parents:
diff changeset
    59
                             public MMPXPlaybackCallback,
hgs
parents:
diff changeset
    60
                             public MMPXCollectionObserver
hgs
parents:
diff changeset
    61
{
hgs
parents:
diff changeset
    62
    public:
hgs
parents:
diff changeset
    63
        static CMPXVideoViewWrapper* NewL( VideoBasePlaybackView* aView );
hgs
parents:
diff changeset
    64
        virtual ~CMPXVideoViewWrapper();
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
    private:
hgs
parents:
diff changeset
    67
        CMPXVideoViewWrapper( VideoBasePlaybackView* aView );
hgs
parents:
diff changeset
    68
        void ConstructL();
hgs
parents:
diff changeset
    69
hgs
parents:
diff changeset
    70
    public:
hgs
parents:
diff changeset
    71
        virtual void HandleCommandL( TInt aCommand );
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
        void RetrieveFileNameAndModeL( CMPXCommand* aCmd );
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
        /*
hgs
parents:
diff changeset
    76
         *  From MMPXViewActivationObserver
hgs
parents:
diff changeset
    77
         *  Handle view activation.
hgs
parents:
diff changeset
    78
         *
hgs
parents:
diff changeset
    79
         *  @param aCurrentViewType Current view type Uid.
hgs
parents:
diff changeset
    80
         *  @param aPreviousViewType Previous view type Uid.
hgs
parents:
diff changeset
    81
         */
hgs
parents:
diff changeset
    82
        inline void HandleViewActivation( const TUid& /*aCurrentViewType*/,
hgs
parents:
diff changeset
    83
                                          const TUid& /*aPreviousViewType*/ ) {}
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
        /**
hgs
parents:
diff changeset
    86
        * From MMPXPlaybackObserver
hgs
parents:
diff changeset
    87
        * Handle playback message
hgs
parents:
diff changeset
    88
        *
hgs
parents:
diff changeset
    89
        * @param aMessage Playback Message
hgs
parents:
diff changeset
    90
        * @param aErr system error code.
hgs
parents:
diff changeset
    91
        */
hgs
parents:
diff changeset
    92
        virtual void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
        /**
hgs
parents:
diff changeset
    95
        *  From MMPXPlaybackCallback
hgs
parents:
diff changeset
    96
        *  Handle playback property
hgs
parents:
diff changeset
    97
        *
hgs
parents:
diff changeset
    98
        *  @param aProperty the property
hgs
parents:
diff changeset
    99
        *  @param aValue the value of the property
hgs
parents:
diff changeset
   100
        *  @param aError error code
hgs
parents:
diff changeset
   101
        */
hgs
parents:
diff changeset
   102
    	void HandlePropertyL( TMPXPlaybackProperty aProperty,
hgs
parents:
diff changeset
   103
                              TInt aValue,
hgs
parents:
diff changeset
   104
                              TInt aError );
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
        /**
hgs
parents:
diff changeset
   107
        *  Method is called continously until aComplete=ETrue, signifying that
hgs
parents:
diff changeset
   108
        *  it is done and there will be no more callbacks
hgs
parents:
diff changeset
   109
        *  Only new items are passed each time
hgs
parents:
diff changeset
   110
        *
hgs
parents:
diff changeset
   111
        *  @param aPlayer UID of the subplayer
hgs
parents:
diff changeset
   112
        *  @param aSubPlayers a list of sub players
hgs
parents:
diff changeset
   113
        *  @param aComplete ETrue no more sub players. EFalse more subplayer
hgs
parents:
diff changeset
   114
        *                   expected
hgs
parents:
diff changeset
   115
        *  @param aError error code
hgs
parents:
diff changeset
   116
        */
hgs
parents:
diff changeset
   117
        inline void HandleSubPlayerNamesL( TUid /*aPlayer*/,
hgs
parents:
diff changeset
   118
                                           const MDesCArray* /*aSubPlayers*/,
hgs
parents:
diff changeset
   119
                                           TBool /*aComplete*/,
hgs
parents:
diff changeset
   120
                                           TInt /*aError*/ )
hgs
parents:
diff changeset
   121
        {}
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
        /**
hgs
parents:
diff changeset
   124
        *  Call back of media request
hgs
parents:
diff changeset
   125
        *
hgs
parents:
diff changeset
   126
        *  @param aMedia media
hgs
parents:
diff changeset
   127
        *  @param aError error code
hgs
parents:
diff changeset
   128
        */
hgs
parents:
diff changeset
   129
        void HandleMediaL( const CMPXMedia& aProperties, TInt aError );
hgs
parents:
diff changeset
   130
hgs
parents:
diff changeset
   131
hgs
parents:
diff changeset
   132
        /**
hgs
parents:
diff changeset
   133
        *  Handle completion of a asynchronous command
hgs
parents:
diff changeset
   134
        *  @param aCommandResult result of the command, NULL if error
hgs
parents:
diff changeset
   135
        *  @param aError error code
hgs
parents:
diff changeset
   136
        */
hgs
parents:
diff changeset
   137
        void HandlePlaybackCommandComplete( CMPXCommand* /*aCommandResult*/,
hgs
parents:
diff changeset
   138
                                            TInt /*aError*/);
hgs
parents:
diff changeset
   139
        /*
hgs
parents:
diff changeset
   140
         *  From base class MMPXCollectionMediaObserver
hgs
parents:
diff changeset
   141
         *  (via MMPXCollectionObserver)
hgs
parents:
diff changeset
   142
         *  Handle extended media properties
hgs
parents:
diff changeset
   143
         *
hgs
parents:
diff changeset
   144
         *  @param aMedia media
hgs
parents:
diff changeset
   145
         *  @param aError error code
hgs
parents:
diff changeset
   146
         */
hgs
parents:
diff changeset
   147
        inline void HandleCollectionMediaL( const CMPXMedia& /*aMedia*/, TInt /*aError*/ ) {}
hgs
parents:
diff changeset
   148
hgs
parents:
diff changeset
   149
        /*
hgs
parents:
diff changeset
   150
         *  From base class MMPXCollectionObserver
hgs
parents:
diff changeset
   151
         */
hgs
parents:
diff changeset
   152
        inline void HandleCollectionMessage( CMPXMessage* /*aMsg*/, TInt /*aErr*/ ) {}
hgs
parents:
diff changeset
   153
hgs
parents:
diff changeset
   154
        inline void HandleOpenL( const CMPXMedia& /*aEntries*/,
hgs
parents:
diff changeset
   155
                                 TInt /*aIndex*/,
hgs
parents:
diff changeset
   156
                                 TBool /*aComplete*/,
hgs
parents:
diff changeset
   157
                                 TInt /*aError*/ ) {}
hgs
parents:
diff changeset
   158
hgs
parents:
diff changeset
   159
        inline void HandleOpenL( const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/ ) {}
hgs
parents:
diff changeset
   160
hgs
parents:
diff changeset
   161
        /**
hgs
parents:
diff changeset
   162
        * Set property
hgs
parents:
diff changeset
   163
        */
hgs
parents:
diff changeset
   164
        void SetPropertyL( TMPXPlaybackProperty aProperty, TInt aValue );
hgs
parents:
diff changeset
   165
        virtual void RetrievePdlInformationL();
hgs
parents:
diff changeset
   166
hgs
parents:
diff changeset
   167
        TBool IsLive();
hgs
parents:
diff changeset
   168
hgs
parents:
diff changeset
   169
        TBool IsPlaylist();
hgs
parents:
diff changeset
   170
50
hgs
parents: 49
diff changeset
   171
        void IssueVideoAppForegroundCmdL( TBool aViewForeground, TBool aAppForegournd );
44
hgs
parents:
diff changeset
   172
hgs
parents:
diff changeset
   173
        void RequestMediaL();
hgs
parents:
diff changeset
   174
hgs
parents:
diff changeset
   175
        void CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync = ETrue );
hgs
parents:
diff changeset
   176
hgs
parents:
diff changeset
   177
        void ActivateClosePlayerActiveObject();
hgs
parents:
diff changeset
   178
hgs
parents:
diff changeset
   179
        void CreateControlsL();
hgs
parents:
diff changeset
   180
hgs
parents:
diff changeset
   181
        TBool IsMultiItemPlaylist();
hgs
parents:
diff changeset
   182
hgs
parents:
diff changeset
   183
        void UpdateVideoRect( TInt aX, TInt aY, TInt aWidth, TInt aHeight, TBool transitionEffect );
hgs
parents:
diff changeset
   184
hgs
parents:
diff changeset
   185
        void UpdateVideoRectDone();
hgs
parents:
diff changeset
   186
hgs
parents:
diff changeset
   187
        void HandlePluginError( TInt aError );
hgs
parents:
diff changeset
   188
hgs
parents:
diff changeset
   189
        void ClosePlaybackViewL();
hgs
parents:
diff changeset
   190
hgs
parents:
diff changeset
   191
        void HandleBufferingStateL();
hgs
parents:
diff changeset
   192
hgs
parents:
diff changeset
   193
        /*
hgs
parents:
diff changeset
   194
         *  Provides the static function for the callback to close the player
hgs
parents:
diff changeset
   195
         *  Called by CIdle iIdle
hgs
parents:
diff changeset
   196
         *  @since 3.2
hgs
parents:
diff changeset
   197
         *  @param aPtr Pointer to callback class
hgs
parents:
diff changeset
   198
         *  @return KErrNone
hgs
parents:
diff changeset
   199
         */
hgs
parents:
diff changeset
   200
        static TInt ClosePlayer( TAny* aPtr );
hgs
parents:
diff changeset
   201
hgs
parents:
diff changeset
   202
        /*
hgs
parents:
diff changeset
   203
         *  Called to stop and exit the player
hgs
parents:
diff changeset
   204
         *  @since 3.2
hgs
parents:
diff changeset
   205
         *  @return void
hgs
parents:
diff changeset
   206
         */
hgs
parents:
diff changeset
   207
        void DoClosePlayer();
hgs
parents:
diff changeset
   208
hgs
parents:
diff changeset
   209
        void HandleVideoPlaybackMessage( CMPXMessage* aMessage );
50
hgs
parents: 49
diff changeset
   210
44
hgs
parents:
diff changeset
   211
        TBool IsResumingPlaybackAfterTermination();
hgs
parents:
diff changeset
   212
50
hgs
parents: 49
diff changeset
   213
        void SurfacedAttached( TBool aAttached );
hgs
parents: 49
diff changeset
   214
44
hgs
parents:
diff changeset
   215
    private:
hgs
parents:
diff changeset
   216
hgs
parents:
diff changeset
   217
        /**
hgs
parents:
diff changeset
   218
        *  Handle playback message
hgs
parents:
diff changeset
   219
        *
hgs
parents:
diff changeset
   220
        *  @param aMsg playback message
hgs
parents:
diff changeset
   221
        */
hgs
parents:
diff changeset
   222
        virtual void DoHandlePlaybackMessageL( CMPXMessage* aMessage );
hgs
parents:
diff changeset
   223
hgs
parents:
diff changeset
   224
        /**
hgs
parents:
diff changeset
   225
        *  Handle playback error message
hgs
parents:
diff changeset
   226
        *
hgs
parents:
diff changeset
   227
        *  @param aErr system error code.
hgs
parents:
diff changeset
   228
        */
hgs
parents:
diff changeset
   229
        void DoHandleErrorPlaybackMessageL( TInt aError );
hgs
parents:
diff changeset
   230
hgs
parents:
diff changeset
   231
        void DisplayFileDetailsDialogL();
hgs
parents:
diff changeset
   232
hgs
parents:
diff changeset
   233
        /**
hgs
parents:
diff changeset
   234
        *  Handle media properties.
hgs
parents:
diff changeset
   235
        *
hgs
parents:
diff changeset
   236
        *  @param aMedia media properties
hgs
parents:
diff changeset
   237
        *  @param aError error code
hgs
parents:
diff changeset
   238
        */
hgs
parents:
diff changeset
   239
        virtual void DoHandleMediaL( const CMPXMedia& aMedia, TInt aError );
hgs
parents:
diff changeset
   240
hgs
parents:
diff changeset
   241
        void CreateVideoSpecificCmdL( TMPXVideoPlaybackCommand aCmd );
hgs
parents:
diff changeset
   242
hgs
parents:
diff changeset
   243
        void ParseMetaDataL( const CMPXMedia& aMedia );
hgs
parents:
diff changeset
   244
hgs
parents:
diff changeset
   245
        void DoHandleStateChangeL( TInt aNewState );
hgs
parents:
diff changeset
   246
hgs
parents:
diff changeset
   247
        void HandleGeneralPlaybackMessageL( CMPXMessage* aMessage );
hgs
parents:
diff changeset
   248
hgs
parents:
diff changeset
   249
        void SetAspectRatioL( TMPXVideoPlaybackCommand aCmd );
hgs
parents:
diff changeset
   250
hgs
parents:
diff changeset
   251
        void HandleVolumeCmdL( TMPXPlaybackCommand aCmd );
hgs
parents:
diff changeset
   252
hgs
parents:
diff changeset
   253
        void HandleShortPressBackwardL();
hgs
parents:
diff changeset
   254
hgs
parents:
diff changeset
   255
        void IssuePlayCommandL();
hgs
parents:
diff changeset
   256
hgs
parents:
diff changeset
   257
        void RequestPlaybackMediaL();
hgs
parents:
diff changeset
   258
hgs
parents:
diff changeset
   259
        void RequestCollectionMediaL();
hgs
parents:
diff changeset
   260
hgs
parents:
diff changeset
   261
        TBool IsInMemoryPlugin();
hgs
parents:
diff changeset
   262
hgs
parents:
diff changeset
   263
        void UpdatePbPluginMediaL( TBool aSeek );
50
hgs
parents: 49
diff changeset
   264
49
hgs
parents: 44
diff changeset
   265
        TInt GetMediaId();
50
hgs
parents: 49
diff changeset
   266
44
hgs
parents:
diff changeset
   267
    protected: // data
hgs
parents:
diff changeset
   268
        MMPXPlaybackUtility*                 iPlaybackUtility;
hgs
parents:
diff changeset
   269
        MMPXCollectionUtility*               iCollectionUtility;
hgs
parents:
diff changeset
   270
        TMPXPlaybackState                    iPlaybackState;
hgs
parents:
diff changeset
   271
hgs
parents:
diff changeset
   272
        VideoPlaybackViewFileDetails*        iFileDetails;
hgs
parents:
diff changeset
   273
        CIdle*                               iCloseAO;
hgs
parents:
diff changeset
   274
hgs
parents:
diff changeset
   275
        VideoBasePlaybackView*               iView;
55
hgs
parents: 50
diff changeset
   276
        CVideoPlaybackDisplayHandler*        iDisplayHandler;
hgs
parents: 50
diff changeset
   277
        CVideoPlaybackUserInputHandler*      iUserInputHandler;
44
hgs
parents:
diff changeset
   278
        VideoPlaybackControlsController*     iControlsController;
hgs
parents:
diff changeset
   279
hgs
parents:
diff changeset
   280
        TMPXMediaRequestStatus               iMediaRequestStatus;
hgs
parents:
diff changeset
   281
        TBool                                iCollectionMediaRequested;
hgs
parents:
diff changeset
   282
        TBool                                iPlaylistView;
hgs
parents:
diff changeset
   283
        int                                  iPlayPosition;
50
hgs
parents: 49
diff changeset
   284
44
hgs
parents:
diff changeset
   285
    public:
50
hgs
parents: 49
diff changeset
   286
        friend class VideoBasePlaybackView;
44
hgs
parents:
diff changeset
   287
};
hgs
parents:
diff changeset
   288
hgs
parents:
diff changeset
   289
#endif  // __MPXVIDEOVIEWWRAPPER_H__
hgs
parents:
diff changeset
   290
hgs
parents:
diff changeset
   291
// EOF