videoplayback/videohelix/inc/mpxvideohelixplayback.h
changeset 0 96612d01cf9f
child 11 5294c000a26d
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: 8 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _CMPXVIDEOHELIXPLAYBACK_H_
       
    23 #define _CMPXVIDEOHELIXPLAYBACK_H_
       
    24 
       
    25 //
       
    26 //  INCLUDES
       
    27 //
       
    28 #include <mpxplaybackplugin.h>
       
    29 #include <mmf/common/mmfcontroller.h>
       
    30 #include <mpxplaybackpluginversion2.h>
       
    31 #include <mpxplaybackpluginobserver.h>
       
    32 
       
    33 #include "mpxvideo_debug.h"
       
    34 #include "mpxhelixplaybackplugindefs.h"
       
    35 #include "mpxvideoplaybackcontroller.h"
       
    36 
       
    37 //
       
    38 //  FORWARD DECLARATIONS
       
    39 //
       
    40 class CMPXVideoPlaybackController;
       
    41 
       
    42 //
       
    43 //  CLASS DECLARATION
       
    44 //
       
    45 
       
    46 /*
       
    47  *  CMpxVideoHelixPlayback class
       
    48  *
       
    49  *  Plug-in basically handles Video Playback with the Helix Engine
       
    50  *  @lib mpxvideohelixplayback.lib
       
    51  *
       
    52  */
       
    53 
       
    54 NONSHARABLE_CLASS( CMPXVideoHelixPlayback ) : public CMPXPlaybackPluginVersion2
       
    55 {
       
    56     public:
       
    57         //
       
    58         //  Constructors and destructor
       
    59         //
       
    60 
       
    61         /*
       
    62          *  Two-phased constructor.
       
    63          *  @param aInitParams, initialization parameter
       
    64          *  @return a pointer to the created instance
       
    65          */
       
    66         static CMPXVideoHelixPlayback* NewL( TAny* aInitParams );
       
    67 
       
    68         /*
       
    69          *  Destructor
       
    70          *  Destroy the object and release all memory objects
       
    71          */
       
    72         ~CMPXVideoHelixPlayback();
       
    73 
       
    74     private:
       
    75         //
       
    76         //  CMPXPlaybackPlugin Implementation
       
    77         //
       
    78 
       
    79         /*
       
    80          *  Set observer
       
    81          *
       
    82          *  @param aObs observer
       
    83          */
       
    84         inline void SetObserver( MMPXPlaybackPluginObserver& aObs );
       
    85 
       
    86         /*
       
    87          *  Initializes a clip for playback
       
    88          *  @param aSong the song path
       
    89          */
       
    90         void InitialiseL( const TDesC& aSong );
       
    91 
       
    92         /*
       
    93          *  Initializes a song for playback
       
    94          *  @param aFile file handle of a song
       
    95          */
       
    96         void InitialiseL( RFile& aFile );
       
    97 
       
    98         /*
       
    99          *  Executes a command on the selected song
       
   100          * @param aCmd a command
       
   101          * @param aData, data
       
   102          */
       
   103         void CommandL( CMPXCommand& aCmd );
       
   104 
       
   105         // Supposedly being deprecated
       
   106         // We're forced to implement this as its declared as a
       
   107         // pure virtual function by the MPX framework
       
   108         void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0);
       
   109 
       
   110         /*
       
   111          *  Sets a property of the plugin
       
   112          *  @param aProperty a property
       
   113          *  @param aValue the value of the setting
       
   114          */
       
   115         void SetL( TMPXPlaybackProperty aProperty , TInt aValue );
       
   116 
       
   117         /*
       
   118          *  Gets a property of the plugin (async)
       
   119          *  @param aProperty a property
       
   120          */
       
   121         void PropertyL( TMPXPlaybackProperty aProperty ) const;
       
   122 
       
   123         /*
       
   124          *  Gets a list of sub players
       
   125          *  @return a list of names of sub players
       
   126          */
       
   127         inline void SubPlayerNamesL();
       
   128 
       
   129         /*
       
   130          *  Select a sub player
       
   131          *  @param aIndex index to the sub player
       
   132          */
       
   133         void SelectSubPlayerL( TInt aIndex );
       
   134 
       
   135         /*
       
   136          *  Returns current sub player name
       
   137          *  @return friendly name of the current the sub player
       
   138          */
       
   139         const TDesC& SubPlayerName();
       
   140 
       
   141         /*
       
   142          *  Current sub player index
       
   143          *  @return index to the sub player
       
   144          */
       
   145         inline TInt SubPlayerIndex() const;
       
   146 
       
   147         /*
       
   148          *  Media properties of the current file (async)
       
   149          *  @param aAttrs attributes requested
       
   150          */
       
   151         void MediaL( const TArray<TMPXAttribute>& aAttrs );
       
   152 
       
   153         /*
       
   154          * Cancel async request
       
   155          */
       
   156         void CancelRequest();
       
   157 
       
   158         /**
       
   159         * Initializes a file for playback.
       
   160         *
       
   161         * @since S60 9.2
       
   162         * @param aUri URI of the item
       
   163         * @param aType the mime type of the item
       
   164         * @param aAccessPoint the access point
       
   165         */
       
   166         void InitStreamingL(const TDesC& aUri, const TDesC8& aType, TInt aAccessPoint);
       
   167 
       
   168         /**
       
   169         * Initializes a file handle for playback.
       
   170         *
       
   171         * @since S60 9.2
       
   172         * @param aFile file handle of a file
       
   173         * @param aAccessPoint the access point
       
   174         */
       
   175         void InitStreamingL(RFile& aFile, TInt aAccessPoint);
       
   176 
       
   177         /**
       
   178         * Initializes filename and handle
       
   179         *
       
   180         * @since S60 9.2
       
   181         * @param aUri URI of the item
       
   182         */
       
   183         RFile& OpenFileHandleL( const TDesC& aUri );
       
   184         
       
   185         /**
       
   186         * Open file handle
       
   187         *
       
   188         * @since S60 9.2
       
   189         * @param aUri URI of the item
       
   190         * @param aFile a 32-bit file handle
       
   191         */
       
   192         void OpenFileHandleL( const TDesC& aUri, RFile& aFile );
       
   193 
       
   194         /**
       
   195         * Handle open file handle
       
   196         *
       
   197         * @since S60 9.2
       
   198         * @param aError open file error
       
   199         */
       
   200         void HandleOpenFileHandleL( TInt aError );
       
   201         
       
   202 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   203 
       
   204         /*
       
   205          *  Initializes a song for playback
       
   206          *  @param aFile RFile64 of a song
       
   207          */
       
   208         void Initialise64L( RFile64& aFile );
       
   209 
       
   210         /**
       
   211         * Initializes a file handle for playback.
       
   212         *
       
   213         * @since S60 9.2
       
   214         * @param aFile RFile64 of a file
       
   215         * @param aAccessPoint the access point
       
   216         */
       
   217         void InitStreaming64L(RFile64& aFile, TInt aAccessPoint);
       
   218 
       
   219         /**
       
   220         * Initializes filename and handle
       
   221         *
       
   222         * @since S60 9.2
       
   223         * @param aUri URI of the item
       
   224         */
       
   225         RFile64& OpenFileHandle64L( const TDesC& aUri );
       
   226 
       
   227         /**
       
   228         * Open file handle
       
   229         *
       
   230         * @since S60 9.2
       
   231         * @param aUri URI of the item
       
   232         * @param aFile a 64-bit file handle
       
   233         */
       
   234         void OpenFileHandle64L( const TDesC& aUri, RFile64& aFile );
       
   235         
       
   236 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API        
       
   237 
       
   238 
       
   239     private:
       
   240         /*
       
   241          *  C++ default constructor
       
   242          */
       
   243         CMPXVideoHelixPlayback();
       
   244 
       
   245         /*
       
   246          *  the second phase constructor ConstructL to safely construct things
       
   247          *  that can leave
       
   248          */
       
   249         void ConstructL();
       
   250         
       
   251     private:
       
   252         //
       
   253         //  Data
       
   254         //
       
   255     	CMPXVideoPlaybackController*  iVideoPlaybackCtlr;
       
   256         RFs                           iFs;
       
   257 };
       
   258 
       
   259 // INLINE METHODS
       
   260 
       
   261 inline
       
   262 void CMPXVideoHelixPlayback::SetObserver( MMPXPlaybackPluginObserver& aObs )
       
   263 {
       
   264     MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SetObserver()"));
       
   265     iObs = &aObs;
       
   266     iVideoPlaybackCtlr->SetMPXObserver(aObs);
       
   267 }
       
   268 
       
   269 inline
       
   270 TInt CMPXVideoHelixPlayback::SubPlayerIndex() const
       
   271 {
       
   272    MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SubPlayerIndex()"));
       
   273    return KErrNotFound;
       
   274 }
       
   275 
       
   276 inline
       
   277 const TDesC& CMPXVideoHelixPlayback::SubPlayerName()
       
   278 {
       
   279     MPX_ENTER_EXIT(_L("CMPXVideoHelixPlayback::SubPlayerName()"));
       
   280     return KNullDesC;
       
   281 }
       
   282 
       
   283 #endif