devsound/a3fintegrationtest/src/tsi_a3f_devsound_teststep.h
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2007-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 // Common header file for all A3F DevSound Integration test steps to share macros, static functions,
       
    15 // constants and enumerations.
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef TSI_A3F_DEVSOUND_TESTSTEP_H
       
    20 #define TSI_A3F_DEVSOUND_TESTSTEP_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 #include <testframework.h>
       
    25 #include <mmf/server/sounddevice.h>
       
    26 
       
    27 // STR_SWITCH... STR_CASE... STR_SWITCH_END macro can be used as switch case that would take string.
       
    28 #define STR_SWITCH(str)  {\
       
    29 		TBuf<100> __ps(str);\
       
    30 		while(1) {
       
    31 
       
    32 #define STR_SWITCH_END()  break; } }
       
    33 
       
    34 #define STR_CASE(str) if(__ps == str)
       
    35 
       
    36 #define DEFAULT_CASE()
       
    37 
       
    38 // Panic function
       
    39 static void Panic(const TDesC &aCategory, TInt aReason)
       
    40 	{
       
    41 	User::Panic(aCategory, aReason);
       
    42 	}
       
    43 
       
    44 // Constants declarations
       
    45 const TInt KNameSize = 25;
       
    46 const TInt KBufferLen = 256;
       
    47 const TInt KMicroSecsInOneSec = 1000000;
       
    48 const TInt KMicroSecsInTenSecs = 10000000;
       
    49 const TInt KMicroSecsInOneMinute = 60000000;
       
    50 const TInt KFrequency1 = 100;
       
    51 const TInt KFrequency2 = 200;
       
    52 const TInt KNULLVolume = 0;
       
    53 const TInt KNULLSamples = 0;
       
    54 
       
    55 // Enumerations
       
    56 enum TDevSoundPlayState
       
    57 	{
       
    58 	EStatePlayStart = 0,
       
    59 	EStatePlayInitializing,
       
    60 	EStatePlaying,
       
    61 	EStatePlayPaused,
       
    62 	EStatePlayStopped
       
    63 	};
       
    64 
       
    65 enum TDevSoundPlayEvents
       
    66 	{
       
    67 	EEventPlayStart = 0,
       
    68 	EEventInitCompletePlay,
       
    69 	EEventBTBF,
       
    70 	EEventPlayTimerComplete,
       
    71 	EEventPlayPaused,
       
    72 	EEventPlayStopped
       
    73 	};
       
    74 
       
    75 enum TPanicCodes
       
    76 	{
       
    77 	EFsmPausedTwice = 0,
       
    78 	EFsmIncorrectErrorPassed,
       
    79 	EInvalidCallbackCall
       
    80 	};
       
    81 
       
    82 #endif // TSI_A3F_DEVSOUND_TESTSTEP_H