os/mm/mmlibs/mmfw/tsrc/mmfintegrationtest/ACLNT/playtruepause.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef PLAYTRUEPAUSE_H_
sl@0
    17
#define PLAYTRUEPAUSE_H_
sl@0
    18
sl@0
    19
#include <testframework.h>
sl@0
    20
#include <mmf/server/sounddevice.h>
sl@0
    21
#include "mdaaudiosampleplayer.h" 
sl@0
    22
#include "TSI_MMFACLNT.h"
sl@0
    23
#include "truepauseconstants.h"
sl@0
    24
sl@0
    25
// Panic function
sl@0
    26
static void Panic(const TDesC &aCategory, TInt aReason)
sl@0
    27
	{
sl@0
    28
	User::Panic(aCategory, aReason);
sl@0
    29
	}
sl@0
    30
sl@0
    31
/*
sl@0
    32
 *========================================================================================================
sl@0
    33
 * Base class for TruePause Tone utility test steps in this suite.
sl@0
    34
 *========================================================================================================
sl@0
    35
 */
sl@0
    36
sl@0
    37
class RMdaPlayerUtilityTestBase: public RAsyncTestStep, public MMdaAudioPlayerCallback
sl@0
    38
	{
sl@0
    39
public:
sl@0
    40
	// from RAsyncTestStep
sl@0
    41
	void KickoffTestL();
sl@0
    42
	void CloseTest();
sl@0
    43
protected:
sl@0
    44
	RMdaPlayerUtilityTestBase(const TDesC& aTestName, const TDesC& aSectName);
sl@0
    45
	~RMdaPlayerUtilityTestBase();
sl@0
    46
	virtual void DoKickoffTestL() = 0;
sl@0
    47
	virtual void DoTimerCallback();
sl@0
    48
	static TInt TimerCallback(TAny*);
sl@0
    49
	void StartTimer(TTimeIntervalMicroSeconds32 aWaitTime);
sl@0
    50
sl@0
    51
	// Executes events of MdaToneUtility using a Finite State Machine
sl@0
    52
	virtual void Fsm(TMdaAudioUtilityEvent aMdaAudioUtilityEvent, TInt aError);
sl@0
    53
	
sl@0
    54
	// From MMdaAudioPlayerCallback
sl@0
    55
	void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/);
sl@0
    56
	void MapcPlayComplete(TInt aError);
sl@0
    57
sl@0
    58
	//Auxiliary functions
sl@0
    59
	static void Panic(const TDesC &aCategory, TInt aReason);
sl@0
    60
protected:
sl@0
    61
	TMdaAudioUtilityState iAudioUtilityState;
sl@0
    62
	CMdaAudioPlayerUtility* iPlayerUtility;
sl@0
    63
	CPeriodic* iTimer;
sl@0
    64
	TFileName iFilename;
sl@0
    65
	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
sl@0
    66
protected:
sl@0
    67
	TBool iStop;
sl@0
    68
	TBool iQuery;
sl@0
    69
	TInt iVolume;
sl@0
    70
	TInt iBalance;
sl@0
    71
	TBool iResume;
sl@0
    72
	TInt iPauseResumeTimes;
sl@0
    73
	TBool iPauseApplied;
sl@0
    74
	TInt iDuration;
sl@0
    75
	TInt iAllFormat;
sl@0
    76
	TBool iPositionSupported;
sl@0
    77
	TBool iMiliSec;
sl@0
    78
	};
sl@0
    79
sl@0
    80
/*
sl@0
    81
 *========================================================================================================
sl@0
    82
 * MM-MMF-ACLNT-I-0185-HP
sl@0
    83
 *========================================================================================================
sl@0
    84
 */
sl@0
    85
sl@0
    86
class RMdaPlayerUtiliyPauseStopAndPlayWavTest : public RMdaPlayerUtilityTestBase
sl@0
    87
	{
sl@0
    88
public:
sl@0
    89
	static RMdaPlayerUtiliyPauseStopAndPlayWavTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
    90
private:
sl@0
    91
	RMdaPlayerUtiliyPauseStopAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
    92
	void DoKickoffTestL();
sl@0
    93
	};
sl@0
    94
sl@0
    95
/*
sl@0
    96
 *========================================================================================================
sl@0
    97
 * MM-MMF-ACLNT-I-0186-HP
sl@0
    98
 *========================================================================================================
sl@0
    99
 */
sl@0
   100
sl@0
   101
class RMdaPlayerUtilityQueryPauseAndPlayWavTest : public RMdaPlayerUtilityTestBase
sl@0
   102
	{
sl@0
   103
public:
sl@0
   104
	static RMdaPlayerUtilityQueryPauseAndPlayWavTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   105
private:
sl@0
   106
	RMdaPlayerUtilityQueryPauseAndPlayWavTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   107
	void DoKickoffTestL();
sl@0
   108
	};
sl@0
   109
sl@0
   110
/*
sl@0
   111
 *========================================================================================================
sl@0
   112
 * MM-MMF-ACLNT-I-0187-HP
sl@0
   113
 *========================================================================================================
sl@0
   114
 */
sl@0
   115
sl@0
   116
class RMdaPlayerUtilityPauseAndPlaySqnTest : public RMdaPlayerUtilityTestBase
sl@0
   117
	{
sl@0
   118
public:
sl@0
   119
	static RMdaPlayerUtilityPauseAndPlaySqnTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   120
private:
sl@0
   121
	RMdaPlayerUtilityPauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   122
	void DoKickoffTestL();
sl@0
   123
	};
sl@0
   124
sl@0
   125
/*
sl@0
   126
 *========================================================================================================
sl@0
   127
 * MM-MMF-ACLNT-I-0188-HP
sl@0
   128
 *========================================================================================================
sl@0
   129
 */
sl@0
   130
sl@0
   131
class RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest : public RMdaPlayerUtilityTestBase
sl@0
   132
	{
sl@0
   133
public:
sl@0
   134
	static RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   135
private:
sl@0
   136
	RMdaPlayerUtilityPauseAndPlayThreeTimesSqnTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   137
	void DoKickoffTestL();
sl@0
   138
	};
sl@0
   139
sl@0
   140
/*
sl@0
   141
 *========================================================================================================
sl@0
   142
 * MM-MMF-ACLNT-I-0189-HP
sl@0
   143
 *========================================================================================================
sl@0
   144
 */
sl@0
   145
sl@0
   146
class RMdaPlayerUtilityPauseStopAndPlaySqnTest : public RMdaPlayerUtilityTestBase
sl@0
   147
	{
sl@0
   148
public:
sl@0
   149
	static RMdaPlayerUtilityPauseStopAndPlaySqnTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   150
private:
sl@0
   151
	RMdaPlayerUtilityPauseStopAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   152
	void DoKickoffTestL();
sl@0
   153
	};
sl@0
   154
sl@0
   155
/*
sl@0
   156
 *========================================================================================================
sl@0
   157
 * MM-MMF-ACLNT-I-0190-HP
sl@0
   158
 *========================================================================================================
sl@0
   159
 */
sl@0
   160
sl@0
   161
class RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest : public RMdaPlayerUtilityTestBase
sl@0
   162
	{
sl@0
   163
public:
sl@0
   164
	static RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   165
private:
sl@0
   166
	RMdaPlayerUtilityGetVolumeAndBalancePauseAndPlaySqnTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   167
	void DoKickoffTestL();
sl@0
   168
	};
sl@0
   169
sl@0
   170
/*
sl@0
   171
 *========================================================================================================
sl@0
   172
 * MM-MMF-ACLNT-I-0191-HP
sl@0
   173
 *========================================================================================================
sl@0
   174
 */
sl@0
   175
sl@0
   176
class RMdaPlayerUtilityPauseAndPlayFormatsTest : public RMdaPlayerUtilityTestBase
sl@0
   177
	{
sl@0
   178
public:
sl@0
   179
	static RMdaPlayerUtilityPauseAndPlayFormatsTest* NewL(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   180
private:
sl@0
   181
	RMdaPlayerUtilityPauseAndPlayFormatsTest(const TDesC& aTestName, const TDesC& aSectName);
sl@0
   182
	void DoKickoffTestL();
sl@0
   183
	// From MMdaAudioPlayerCallback
sl@0
   184
	void MapcPlayComplete(TInt aError);
sl@0
   185
	};
sl@0
   186
sl@0
   187
#endif// __PLAYTRUEPAUSE_H__
sl@0
   188