sl@0: 
sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // TestPlayerUtils.h
sl@0: // Header file: Basic  tests.
sl@0: // 
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file TestPlayerUtils.h
sl@0: */
sl@0: 
sl@0: #ifndef TESTPLAYERCAPS_H__
sl@0: #define TESTPLAYERCAPS_H__
sl@0: 
sl@0: 
sl@0: #include "TSI_MMFACLNT.h"
sl@0: 
sl@0: const TInt	KMaxSvrMessageSize = 256;
sl@0: 
sl@0: /**
sl@0:  * Load and initialise an audio file.
sl@0:  *
sl@0:  * @class CTestMmfAclntCaps
sl@0:  *
sl@0:  */         
sl@0: class CTestMmfAclntCaps :  public CTestMmfAclntStep, public MMdaAudioPlayerCallback
sl@0: 	{
sl@0: private:
sl@0: 	enum InternalState 
sl@0: 		{
sl@0: 		EWaitingForServer=0,
sl@0: 		EInitPlayer,
sl@0: 		EPlaying
sl@0: 		};
sl@0: 		
sl@0: 		
sl@0: public:
sl@0: 	static CTestMmfAclntCaps* NewL(const TDesC& aTestName, const TDesC& aSectionName, const TDesC& aKeyName);
sl@0: 	static CTestMmfAclntCaps* NewLC(const TDesC& aTestName, const TDesC& aSectionName, const TDesC& aKeyName);
sl@0: 	
sl@0: 	~CTestMmfAclntCaps();
sl@0: 	virtual TVerdict DoTestStepL();
sl@0: 
sl@0: 	void CreatePlayer();
sl@0: 	void BeginPlayback();
sl@0: 	// from MMdaAudioPlayerCallback
sl@0: 	virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration);
sl@0: 	virtual void MapcPlayComplete(TInt aError);
sl@0: 	
sl@0: 	void DoProcess(TInt aError);
sl@0: 	
sl@0: 	class CServerMonitor : public CActive 
sl@0: 		{
sl@0: 	public:
sl@0: 		static CServerMonitor* NewL(CTestMmfAclntCaps* aParent);
sl@0: 		void ConstructL();
sl@0: 		void RunL();
sl@0: 		void DoCancel();
sl@0: 		
sl@0: 		TRequestStatus& ActiveStatus();
sl@0: 	private:
sl@0: 		CServerMonitor(CTestMmfAclntCaps* aParent);
sl@0: 	private:
sl@0: 		CTestMmfAclntCaps* iParent;
sl@0: 		};
sl@0: 
sl@0: private:
sl@0: 	CTestMmfAclntCaps(const TDesC& aTestName, const TDesC& aSectionName, const TDesC& aKeyName);
sl@0: 	
sl@0: private:
sl@0: 	CMdaAudioPlayerUtility* iPlayer;	
sl@0: 	CServerMonitor* iServerMonitor;
sl@0: 	TVerdict iVerdict;
sl@0: 
sl@0: 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
sl@0: 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
sl@0: 	InternalState iState;
sl@0: 	};
sl@0: #endif