khronosfws/openmax_al/src/mmf_adaptation/positionupdatetimer.h
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
child 21 999b2818a0eb
equal deleted inserted replaced
19:095bea5f582e 20:0ac9a5310753
     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 "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: Handles marker timer implementation 
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CPOSITIONUPDATETIMER_H
       
    19 #define CPOSITIONUPDATETIMER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "openmaxalwrapper.h"
       
    23 
       
    24 class CMdaAudioPlayerUtility;
       
    25 class CVideoPlayerUtility2;
       
    26 
       
    27 NONSHARABLE_CLASS(CPositionUpdateTimer) : public CActive
       
    28     {
       
    29 public:
       
    30     // Construct/destruct
       
    31     static CPositionUpdateTimer* NewL(CMdaAudioPlayerUtility* aAudioPlayer,
       
    32             CVideoPlayerUtility2* aVideoPlayer);
       
    33     virtual ~CPositionUpdateTimer();
       
    34 
       
    35 public:
       
    36     void SetContext(TAny* aCtx);
       
    37     void SetPositionUpdatePeriod(XAmillisecond aPos);
       
    38     void SetCallbackEventMask(XAuint32 aMask);
       
    39     void RegisterCallback(xaPlayCallback aCallback);
       
    40     void UseAudioPlayer();
       
    41     void UseVideoPlayer();
       
    42     void ResetPlayer();
       
    43     TInt Start();
       
    44     void Stop();
       
    45 
       
    46 protected:
       
    47     // From CActive
       
    48     void RunL();
       
    49     void DoCancel();
       
    50     TInt RunError(TInt aError);
       
    51 
       
    52 private:
       
    53     CPositionUpdateTimer(CMdaAudioPlayerUtility* aAudioPlayer,
       
    54             CVideoPlayerUtility2* aVideoPlayer);
       
    55     void CostructL();
       
    56     TInt GetCurrentPlayPosition(TTimeIntervalMicroSeconds& aPos);
       
    57 
       
    58 private:
       
    59     RTimer iTimer; // Has
       
    60     TAny* iCtx;
       
    61     CMdaAudioPlayerUtility* iAudioPlayer;
       
    62     CVideoPlayerUtility2* iVideoPlayer;
       
    63     CBase* iPlayerToUse;
       
    64     XAmillisecond iPositionUpdatePeriod;
       
    65     XAuint32 iCallbackEventMask;
       
    66     xaPlayCallback iCallback;
       
    67     TTimeIntervalMicroSeconds32 iDelay;
       
    68     TBool iSyncToPlayHead;
       
    69     TTimeIntervalMicroSeconds iSyncToPlayHeadStartPos;
       
    70     };
       
    71 
       
    72 #endif /* CPOSITIONUPDATETIMER_H */