1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mmf/server/mmfdatapath2.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,140 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalTechnology
1.22 +*/
1.23 +
1.24 +#ifndef MMFDATAPATH2_H
1.25 +#define MMFDATAPATH2_H
1.26 +
1.27 +#include <mmf/common/mmfcontroller.h>
1.28 +#include <mmf/server/mmfdatasource.h>
1.29 +#include <mmf/server/mmfdatasink.h>
1.30 +#include <mmf/server/mmfcodec.h>
1.31 +#include <mmf/server/mmfbuffer.h>
1.32 +#include <mmf/common/mmfutilities.h>
1.33 +#include <mmf/server/mmfformat.h>
1.34 +#include <mmf/server/mmfsubthreadbase.h>
1.35 +#include <mmf/server/mmfdatapath.h>
1.36 +
1.37 +/**
1.38 +
1.39 +This class is an extended version of CMMFDataPath. CMMFDataPath is extended to implement the loop play
1.40 +functionality in the controller. This class overrides some of the virual functions of CMMFDataPath in order to
1.41 +implement the loop play functionality. All the controller plugins that require loop play functionality should
1.42 +use CMMFDataPath2 in place of CMMFDataPath.
1.43 +
1.44 +@see CMMFDataPath
1.45 +*/
1.46 +class CMMFDataPath2 : public CMMFDataPath
1.47 + {
1.48 +public:
1.49 + //CMMFDataPath2 constructor if codec Uid is not already known by CMMFController
1.50 + //and there is no data path ambiguity - ie only one data path is possible
1.51 + IMPORT_C static CMMFDataPath2* NewL(MAsyncEventHandler& aEventHandler);
1.52 +
1.53 + //CMMFDataPath2 constructor if codec Uid is not already known by CMMFController
1.54 + //and there is ambiguity ie more than one possible data path TMediaId used to select path
1.55 + IMPORT_C static CMMFDataPath2* NewL(TMediaId aMediaId, MAsyncEventHandler& aEventHandler);
1.56 +
1.57 + //CMMFDataPath2 constructor if codec Uid is already known by CMMFController
1.58 + //and there is no data path ambiguity - ie only one data path is possible
1.59 + IMPORT_C static CMMFDataPath2* NewL(TUid aCodecUid, MAsyncEventHandler& aEventHandler);
1.60 +
1.61 + //CMMFDataPath2 constructor if codec Uid is already known by CMMFController
1.62 + //and there is ambiguity ie more than one possible data path TMediaId used to select path
1.63 + IMPORT_C static CMMFDataPath2* NewL(TUid aCodecUid, TMediaId aMediaId, MAsyncEventHandler& aEventHandler);
1.64 +
1.65 + virtual ~CMMFDataPath2();
1.66 + virtual void BufferFilledL(CMMFBuffer* aBuffer); //called by the CMMFDataPath's MDataSource when it has filled the buffer
1.67 +
1.68 + virtual void PrimeL();
1.69 + virtual void PlayL();
1.70 + virtual void Pause();
1.71 + virtual void Stop();
1.72 + virtual void SetPositionL(const TTimeIntervalMicroSeconds& aPosition);
1.73 + virtual TTimeIntervalMicroSeconds Position() const;
1.74 + // Called when source and sink needs to be de-referenced
1.75 + virtual void ResetL();
1.76 + void RunL();
1.77 + // Set Repeats.
1.78 + IMPORT_C void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
1.79 + IMPORT_C void SetDrmProperties(MDataSource* iDrmSource, TBool *aDisableAutoIntent);
1.80 + IMPORT_C void RetainRepeatInfo();
1.81 + IMPORT_C void PreEmptionPause();
1.82 +
1.83 +protected:
1.84 + CMMFDataPath2(TMediaId aMediaId, MAsyncEventHandler& aEventHandler);
1.85 + void ConstructL(TUid aCodecUid = KNullUid);
1.86 + void FillSourceBufferL();
1.87 + void DoFillSourceBufferL();
1.88 + TTimeIntervalMicroSeconds CalculateAudioOutputPosition() const;
1.89 + //called when trailing silence playback is complete
1.90 + static TInt RepeatTrailingSilenceTimerComplete(TAny* aDataPath);
1.91 + TInt DoRepeatTrailingSilenceTimerCompleteL();
1.92 + void PlaySilence();
1.93 + void DoStopL();
1.94 + void DoPauseL();
1.95 + void DoCancel();
1.96 + TTimeIntervalMicroSeconds OutputPosition() const;
1.97 + void DoPreEmptionPauseL();
1.98 +
1.99 +
1.100 +protected:
1.101 + /**
1.102 + The number of times to repeat the audio sample.
1.103 + */
1.104 + TInt iNumberOfTimesToRepeat;
1.105 +
1.106 + /**
1.107 + The number of times played.
1.108 + */
1.109 + TInt iNumberOfTimesPlayed;
1.110 + /**
1.111 + The time interval of the trailing silence in microseconds.
1.112 + */
1.113 + TTimeIntervalMicroSeconds iTrailingSilence;
1.114 +
1.115 + /**
1.116 + The time interval of the trailing silence left to play in microseconds.
1.117 + */
1.118 + TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay;
1.119 +
1.120 + /**
1.121 + The time left for the play to be completed in a particular repeat
1.122 + */
1.123 + TTimeIntervalMicroSeconds iTimeLeftToPlayComplete;
1.124 +
1.125 + /**
1.126 + Timer used for trailing silences when repeating
1.127 + */
1.128 + CPeriodic* iRepeatTrailingSilenceTimer;
1.129 + //This variable stores the devsound time played when the play is repositioned
1.130 + TTimeIntervalMicroSeconds iDevSoundRepositionTime;
1.131 + //states when the silence period between repeats needs to be verified
1.132 + TBool iVerifyPlayComplete;
1.133 +
1.134 + //For Drm implementation during repeats
1.135 + MDataSource* iDrmSource;
1.136 + TBool* iDisableAutoIntent;
1.137 + TBool iRetainRepeatInfo;
1.138 + TBool iGetTimePlayedSupported;
1.139 + TBool iIsResumeSupported;
1.140 + TBool iIsUsingResumeSupport;
1.141 + };
1.142 +
1.143 +#endif