breakdeps/mmfclientaudioplayer.h
changeset 129 4a58d534bdaa
parent 125 657f02e590f1
equal deleted inserted replaced
128:8338c5c25b5b 129:4a58d534bdaa
    18 #define MMFCLIENTAUDIOPLAY_H
    18 #define MMFCLIENTAUDIOPLAY_H
    19 
    19 
    20 #include <e32std.h>
    20 #include <e32std.h>
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <mdaaudiosampleplayer.h>
    22 #include <mdaaudiosampleplayer.h>
    23 #include <mmf/common/mmfcontroller.h>
    23 //#include <mmf/common/mmfcontroller.h>
    24 #include <mmf/server/mmffile.h>
    24 #include <mmf/server/mmffile.h>
    25 #include <mmf/server/mmfdes.h>
    25 #include <mmf/server/mmfdes.h>
    26 #include <mmfcontrollerimplementationuids.hrh>
    26 //#include <mmfcontrollerimplementationuids.hrh>
    27 #include <mmf/common/mmfstandardcustomcommands.h>
    27 //#include <mmf/common/mmfstandardcustomcommands.h>
    28 #include <mmf/common/mmfdrmcustomcommands.h>
    28 //#include <mmf/common/mmfdrmcustomcommands.h>
    29 #include "mmfclientutility.h"
    29 //#include "mmfclientutility.h"
    30 #include <mmf/common/mmfdurationinfocustomcommands.h>
    30 //#include <mmf/common/mmfdurationinfocustomcommands.h>
    31 
    31 
    32 static const TUid KUidMmfAudioController = {KMmfUidControllerAudio}; 
    32 //static const TUid KUidMmfAudioController = {KMmfUidControllerAudio}; 
    33 
    33 
    34 /**
    34 /**
    35 Mixin class to allow notification that the timed silence has finished.
    35 Mixin class to allow notification that the timed silence has finished.
    36 */
    36 */
    37 class MRepeatTrailingSilenceTimerObs
    37 class MRepeatTrailingSilenceTimerObs
    85 
    85 
    86 /**
    86 /**
    87 Concrete implementation of the CMdaAudioPlayerUtility API.
    87 Concrete implementation of the CMdaAudioPlayerUtility API.
    88 @see CMdaAudioPlayerUtility
    88 @see CMdaAudioPlayerUtility
    89 */
    89 */
    90 class CMMFMdaAudioPlayerUtility;
    90 /*class CMMFMdaAudioPlayerUtility;
    91 NONSHARABLE_CLASS( CMMFMdaAudioPlayerUtility ): public CBase, 
    91 NONSHARABLE_CLASS( CMMFMdaAudioPlayerUtility ): public CBase, 
    92 								  				public MMMFControllerEventMonitorObserver,
    92 								  				public MMMFControllerEventMonitorObserver,
    93 								  				public MRepeatTrailingSilenceTimerObs,
    93 								  				public MRepeatTrailingSilenceTimerObs,
    94 								  				public MMMFFindAndOpenControllerObserver
    94 								  				public MMMFFindAndOpenControllerObserver
       
    95 */
       
    96 class CMMFMdaAudioPlayerUtility;
       
    97 NONSHARABLE_CLASS( CMMFMdaAudioPlayerUtility ): public CTimer 
    95 	{
    98 	{
    96 friend class CMdaAudioPlayerUtility;
    99 friend class CMdaAudioPlayerUtility;
    97 // friends for Unit testing only
   100 // friends for Unit testing only
    98 friend class CTestStepUnitMMFAudClient;
       
    99 
   101 
   100 public:
   102 public:
   101 	enum TMMFAudioPlayerState
   103 	enum TMMFAudioPlayerState
   102 		{
   104 		{
   103 		EStopped,
   105 		EStopped,
   179 	MMMFDRMCustomCommand* GetDRMCustomCommand();
   181 	MMMFDRMCustomCommand* GetDRMCustomCommand();
   180 
   182 
   181 	TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
   183 	TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
   182 	
   184 	
   183 	TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
   185 	TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
   184 	
   186 	void RunL();
   185 	// from MMMFControllerEventMonitorObserver
       
   186 	virtual void HandleEvent(const TMMFEvent& aEvent);
       
   187 	// from MRepeatTrailingSilenceTimerObs
       
   188 	virtual void RepeatTrailingSilenceTimerComplete();
       
   189 
       
   190 	// from MMMFFindAndOpenControllerObserver 
       
   191 	virtual void MfaocComplete(
       
   192 		TInt& aError, 
       
   193 		RMMFController* aController, 
       
   194 		TUid aControllerUid, 
       
   195 		TMMFMessageDestination* aSourceHandle, 
       
   196 		TMMFMessageDestination* aSinkHandle);
       
   197 
       
   198 protected:
   187 protected:
   199 	CMMFMdaAudioPlayerUtility(MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref);
   188 	CMMFMdaAudioPlayerUtility(MMdaAudioPlayerCallback& aCallback, TInt aPriority, TInt aPref);
   200 	void ConstructL();
   189 	void ConstructL();
   201 	void DoPlay();
   190 	void DoPlay();
   202 
   191 
   214 
   203 
   215 	MMdaAudioPlayerCallback& iCallback;
   204 	MMdaAudioPlayerCallback& iCallback;
   216 	CMMFMdaAudioPlayerCallBack* iAsyncCallBack;
   205 	CMMFMdaAudioPlayerCallBack* iAsyncCallBack;
   217 	MAudioLoadingObserver* iLoadingObserver;
   206 	MAudioLoadingObserver* iLoadingObserver;
   218 	MMMFAudioResourceNotificationCallback* iAudioResourceNotificationCallBack;
   207 	MMMFAudioResourceNotificationCallback* iAudioResourceNotificationCallBack;
   219 	RMMFController iController;
   208 	//RMMFController iController;
   220 	CMMFControllerEventMonitor* iControllerEventMonitor;
   209 	CMMFControllerEventMonitor* iControllerEventMonitor;
   221 	TMMFAudioPlayerState iState;
   210 	TMMFAudioPlayerState iState;
   222 	TTimeIntervalMicroSeconds iDuration; // Needed because of api "Duration()" that returns a reference
   211 	TTimeIntervalMicroSeconds iDuration; // Needed because of api "Duration()" that returns a reference
   223 	TMMFPrioritySettings iPrioritySettings;
   212 	TMMFPrioritySettings iPrioritySettings;
   224 
   213 
   227 	TTimeIntervalMicroSeconds iTrailingSilence;
   216 	TTimeIntervalMicroSeconds iTrailingSilence;
   228 	TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay;	
   217 	TTimeIntervalMicroSeconds iTrailingSilenceLeftToPlay;	
   229 	CRepeatTrailingSilenceTimer* iRepeatTrailingSilenceTimer;
   218 	CRepeatTrailingSilenceTimer* iRepeatTrailingSilenceTimer;
   230 
   219 
   231 	// Source and sink handle info
   220 	// Source and sink handle info
   232 	TMMFMessageDestination iSourceHandle;
   221 	//TMMFMessageDestination iSourceHandle;
   233 	TMMFMessageDestination iSinkHandle;
   222 	//TMMFMessageDestination iSinkHandle;
   234 
   223 
   235 	// Custom command handlers
   224 	// Custom command handlers
   236 	RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCommands;
   225 	//RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCommands;
   237 	RMMFAudioPlayControllerCustomCommands iAudioPlayControllerCommands;
   226 	//RMMFAudioPlayControllerCustomCommands iAudioPlayControllerCommands;
   238 	RMMFResourceNotificationCustomCommands iNotificationRegistrationCommands;
   227 	//RMMFResourceNotificationCustomCommands iNotificationRegistrationCommands;
   239 	RMMFDRMCustomCommands iDRMCustomCommands;
   228 	//RMMFDRMCustomCommands iDRMCustomCommands;
   240 	RMMFAudioPlayControllerSetRepeatsCustomCommands iAudioPlayControllerSetRepeatsCommands;
   229 	//RMMFAudioPlayControllerSetRepeatsCustomCommands iAudioPlayControllerSetRepeatsCommands;
   241 	
   230 	
   242 	// Current playback time so we can resume from where we were stopped
   231 	// Current playback time so we can resume from where we were stopped
   243 	TTimeIntervalMicroSeconds iPosition;
   232 	TTimeIntervalMicroSeconds iPosition;
   244 
   233 
   245 	// Play window start and end times and whether it has been set
   234 	// Play window start and end times and whether it has been set
   250 	
   239 	
   251 	CMMFControllerImplementationInformation* iControllerImplementationInformation;
   240 	CMMFControllerImplementationInformation* iControllerImplementationInformation;
   252 	TUid iControllerUid;
   241 	TUid iControllerUid;
   253 
   242 
   254 	// utility class to find and open a suitable controller asynchronously
   243 	// utility class to find and open a suitable controller asynchronously
   255 	CMMFFindAndOpenController* iFindAndOpenController;
   244 	//CMMFFindAndOpenController* iFindAndOpenController;
   256 	TUid iEventHolder;
   245 	TUid iEventHolder;
   257 	TBuf8<256> iNotificationDataHolder;
   246 	TBuf8<256> iNotificationDataHolder;
   258 	TBool iRepeatCancelled;
   247 	TBool iRepeatCancelled;
   259 	}; 
   248 	}; 
   260 
   249