os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/TestPlayerFileSource.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // The tests are for opening the audio file with TMMFileSource/TMMFileHandleSource
    15 // and playing.
    16 // Header file: Basic tests.
    17 // 
    18 //
    19 
    20 /**
    21  @file TestPlayerFileSource.h
    22 */
    23 
    24 #ifndef __TESTPLAYERFILESOURCE_H__
    25 #define __TESTPLAYERFILESOURCE_H__
    26 
    27 
    28 #include "TSI_MMFACLNT.h"
    29 
    30 //
    31 // CTestMmfAclntFileSource
    32 //
    33 
    34 /**
    35  * Load and initialise an audio file.
    36  *
    37  * @class CTestMmfAclntFileSource
    38  *
    39  */
    40 class CTestMmfAclntFileSource :  public CTestMmfAclntStep, public MMdaAudioPlayerCallback
    41 	{
    42 public:
    43 	static CTestMmfAclntFileSource* NewL(const TDesC& aTestName, const TDesC& aSectName, 
    44         const TDesC& aKeyName, const TBool aPlay,const TInt aExpectedError);
    45 
    46     static CTestMmfAclntFileSource* NewLC(const TDesC& aTestName, const TDesC& aSectName, 
    47         const TDesC& aKeyName, const TBool aPlay, const TInt aExpectedError);
    48 
    49     virtual TVerdict DoTestStepL();
    50 
    51     // from MMdaAudioPlayerCallback
    52     virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    53     virtual void MapcPlayComplete(TInt aError);
    54 
    55 private:
    56 	CTestMmfAclntFileSource(const TDesC& aTestName, const TDesC& aSectName, 
    57         const TDesC& aKeyName,const TBool aPlay, const TInt aExpectedError);
    58 
    59 private:
    60 	TInt iError;
    61 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
    62 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
    63 	TTimeIntervalMicroSeconds iDuration;// Stores duration of audio
    64 	const TBool iPlay;					// Does this test require playing the audio
    65 	const TInt	iExpectedError;			// Is this a negative test
    66 	};
    67 
    68 //
    69 // CTestMmfAclntFileHandleSource
    70 //
    71 
    72 /**
    73  * Load and initialise an audio file.
    74  *
    75  * @class CTestMmfAclntFileHandleSource
    76  *
    77  */
    78 class CTestMmfAclntFileHandleSource :  public CTestMmfAclntStep, public MMdaAudioPlayerCallback
    79 	{
    80 public:
    81 	static CTestMmfAclntFileHandleSource* NewL(const TDesC& aTestName, const TDesC& aSectName, 
    82         const TDesC& aKeyName, const TBool aPlay, const TInt aExpectedError);
    83 
    84     static CTestMmfAclntFileHandleSource* NewLC(const TDesC& aTestName, const TDesC& aSectName,
    85         const TDesC& aKeyName,const TBool aPlay, const TInt aExpectedError);
    86 
    87     virtual TVerdict DoTestStepL();
    88 
    89     // from MMdaAudioPlayerCallback
    90     virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    91     virtual void MapcPlayComplete(TInt aError);
    92 
    93 private:
    94 	CTestMmfAclntFileHandleSource(const TDesC& aTestName, const TDesC& aSectName, 
    95         const TDesC& aKeyName, const TBool aPlay, const TInt aExpectedError);
    96 
    97 private:
    98 	TInt iError;
    99 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
   100 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
   101 	TTimeIntervalMicroSeconds iDuration;// Stores duration of audio
   102 	const TBool iPlay;					// Does this test require playing the audio
   103 	const TInt	iExpectedError;			// Is this a negative test
   104 	};
   105 
   106 #endif