khronosfws/openmax_al/src/mmf_adaptation/prefetchlevelupdatetimer.h
changeset 53 eabc8c503852
equal deleted inserted replaced
48:a493a607b5bf 53:eabc8c503852
       
     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 PREFETCHLEVELUPDATETIMER_H
       
    19 #define PREFETCHLEVELUPDATETIMER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "openmaxalwrapper.h"
       
    23 
       
    24 class CMdaAudioPlayerUtility;
       
    25 class CVideoPlayerUtility2;
       
    26 
       
    27 NONSHARABLE_CLASS(CPrefetchLevelUpdateTimer) : public CActive
       
    28 //class CPrefetchLevelUpdateTimer : public CActive
       
    29     {
       
    30 public:
       
    31     // Construct/destruct
       
    32     static CPrefetchLevelUpdateTimer* NewL(	CMdaAudioPlayerUtility* aAudioPlayer,
       
    33             								CVideoPlayerUtility2* aVideoPlayer);
       
    34     virtual ~CPrefetchLevelUpdateTimer();
       
    35 
       
    36 public:
       
    37     void SetContext(TAny* aCtx);
       
    38     void SetPrefetchLevelUpdatePeriod(XAmillisecond aPos);
       
    39 	void SetUpdateIncrement(XApermille inc);
       
    40     void SetCallbackEventMask(XAuint32 aMask);
       
    41     void RegisterCallback(xaPrefetchCallback aCallback);
       
    42     void Start();
       
    43     void Stop();
       
    44 
       
    45 	TInt GetLoadingProgress(TInt&);
       
    46 
       
    47     void UseAudioPlayer();
       
    48     void UseVideoPlayer();
       
    49     void ResetPlayer();
       
    50 protected:
       
    51     // From CActive
       
    52     void RunL();
       
    53     void DoCancel();
       
    54     TInt RunError(TInt aError);
       
    55 
       
    56 private:
       
    57     CPrefetchLevelUpdateTimer(	CMdaAudioPlayerUtility* aAudioPlayer,
       
    58             					CVideoPlayerUtility2* aVideoPlayer);
       
    59     void ConstructL();
       
    60 
       
    61 	void SendFillLevelChangeEvent();
       
    62 
       
    63 private:
       
    64     RTimer iTimer; // Has
       
    65     TAny* iCtx;
       
    66     XAuint32 iCallbackEventMask;
       
    67     xaPrefetchCallback iCallback;
       
    68     TTimeIntervalMicroSeconds32 iUpdatePeriod;
       
    69 
       
    70     CBase* iPlayerToUse;
       
    71     CMdaAudioPlayerUtility* iAudioPlayer;
       
    72     CVideoPlayerUtility2* iVideoPlayer;
       
    73 
       
    74 	TInt iNotifyIncrement;
       
    75 	TInt iLastIncrement;
       
    76 };
       
    77 
       
    78 #endif /* PREFETCHLEVELUPDATETIMER_H */