videofeeds/vcnsuiengine/inc/vcxnsstreaminghandler.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "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:   Streaming handler*
       
    15 */
       
    16 
       
    17 
       
    18 // Version : %version: 2 %
       
    19 
       
    20 
       
    21 #ifndef CVCXNSSTREAMINGHANDLER_H
       
    22 #define CVCXNSSTREAMINGHANDLER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <mpxplaybackutility.h>
       
    26 #include <mpxplaybackobserver.h>
       
    27 
       
    28 class CVcxNsContent;
       
    29 class CVcxNsUiEngine;
       
    30 
       
    31 /**
       
    32 *  Streaming handler. Listens playback events and
       
    33 *  sets and gets the play positions for the stream
       
    34 *
       
    35 *  @lib vcxnsuiengine.lib
       
    36 */
       
    37 NONSHARABLE_CLASS( CVcxNsStreamingHandler ) : public CBase,
       
    38                                               public MMPXPlaybackObserver,
       
    39                                               public MMPXPlaybackCallback
       
    40     {
       
    41     
       
    42 public:
       
    43 
       
    44     static CVcxNsStreamingHandler* NewL( CVcxNsUiEngine& aUiEngine );
       
    45 
       
    46     virtual ~CVcxNsStreamingHandler();
       
    47     
       
    48     /**
       
    49      * Start listening messages for a stream.
       
    50      * 
       
    51      * @param aContent Content to be watched.
       
    52      */
       
    53     void HandleOpenStreamL( CVcxNsContent* aContent );
       
    54 
       
    55     /**
       
    56      * Stop listening messages for a stream.
       
    57      */
       
    58     void HandleCloseStream();
       
    59 
       
    60 // From MMPXPlaybackObserver
       
    61 
       
    62     /**
       
    63      * From MMPXPlaybackObserver
       
    64      * Handle playback message
       
    65      *
       
    66      * @since 3.1
       
    67      * @param aMessage playback message
       
    68      * @param aErr system error code.
       
    69      */
       
    70     void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
       
    71 
       
    72 // From MMPXPlaybackCallback
       
    73 
       
    74     /**
       
    75      *  From MMPXPlaybackCallback
       
    76      *  Handle playback property.
       
    77      *
       
    78      *  @since S60 3.2.3
       
    79      *  @param aProperty the property
       
    80      *  @param aValue the value of the property
       
    81      *  @param aError error code
       
    82      */
       
    83     void HandlePropertyL(TMPXPlaybackProperty aProperty,
       
    84                                 TInt aValue, 
       
    85                                  TInt aError);
       
    86     
       
    87     /**
       
    88      *  From MMPXPlaybackCallback
       
    89      *  Method is called continously until aComplete=ETrue, signifying that 
       
    90      *  it is done and there will be no more callbacks.
       
    91      *  Only new items are passed each time.
       
    92      *
       
    93      *  @since S60 3.2.3
       
    94      *  @param aPlayer UID of the subplayer
       
    95      *  @param aSubPlayers a list of sub players
       
    96      *  @param aComplete ETrue no more sub players. EFalse more subplayer
       
    97      *                   expected
       
    98      *  @param aError error code
       
    99      */
       
   100     void HandleSubPlayerNamesL(TUid aPlayer, 
       
   101                                        const MDesCArray* aSubPlayers,
       
   102                                        TBool aComplete,
       
   103                                        TInt aError);
       
   104     
       
   105     /**
       
   106      *  From MMPXPlaybackCallback
       
   107      *  Call back of media request.
       
   108      *
       
   109      *  @since S60 3.2.3
       
   110      *  @param aMedia media 
       
   111      *  @param aError error code    
       
   112      */
       
   113     void HandleMediaL(const CMPXMedia& aProperties,
       
   114                               TInt aError);
       
   115 
       
   116 private:
       
   117     
       
   118     CVcxNsStreamingHandler( CVcxNsUiEngine& aUiEngine );
       
   119 
       
   120     void ConstructL();
       
   121      
       
   122     /**
       
   123      * Handle playback message
       
   124      * 
       
   125      * @param aMessage playback message
       
   126      */
       
   127     void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
       
   128     
       
   129     /**
       
   130      * Handle state change message.
       
   131      * 
       
   132      * @param aMessage playback message
       
   133      */
       
   134     void HandleStateChangedL( const CMPXMessage& aMessage );
       
   135     
       
   136     /**
       
   137      * Handle property change message.
       
   138      * 
       
   139      * @param aMessage playback message
       
   140      */
       
   141     void HandlePropertyChangedL( const CMPXMessage& aMessage );
       
   142 
       
   143     /**
       
   144      * Seek To Last PosL
       
   145      */
       
   146     void SeekToLastPosL();
       
   147 
       
   148     /**
       
   149      * Store Last PosL
       
   150      */
       
   151     void StoreLastPosL();
       
   152     
       
   153     /**
       
   154      * Get the current stream's duration
       
   155      */
       
   156     void GetDurationL();
       
   157 
       
   158      /**
       
   159       * MMPXPlaybackUtility
       
   160       * 
       
   161       * own.
       
   162       */
       
   163     MMPXPlaybackUtility* iPlaybackUtility;
       
   164     
       
   165     /**
       
   166      * CVcxNsContent
       
   167      * 
       
   168      * not own.
       
   169      */
       
   170     CVcxNsContent* iContent;
       
   171     
       
   172     /**
       
   173      * CVcxNsUiEngine
       
   174      */
       
   175     CVcxNsUiEngine& iUiEngine;
       
   176     
       
   177     /**
       
   178      * Should the last position be resumed when 
       
   179      * playback has been initialized
       
   180      */
       
   181     TBool iLastPosPending;
       
   182 
       
   183     /**
       
   184      * Position to be resumed, if the
       
   185      * iLastPosPending has been set.
       
   186      */
       
   187     TInt iResumePos;
       
   188     
       
   189     /**
       
   190      * Playback state.
       
   191      */
       
   192     TInt iCurrentState;
       
   193     
       
   194     /**
       
   195      * Played stream's total duration.
       
   196      */
       
   197     TInt iDuration;
       
   198     
       
   199     };
       
   200 
       
   201 #endif // CVCXNSSTREAMINGHANDLER_H