os/mm/devsound/a3fcharacterisationtest/src/char_a3f_devsound_compliancesuiteconstants.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.
     1 // Copyright (c) 2008-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 //
    15 
    16 #ifndef CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
    17 #define CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
    18 
    19 
    20 // constant declarations
    21 const TInt KMaxStringLength = 255;	// Used to define DTMF length
    22 const TInt KSizeBuf = 256;
    23 const TInt KMicrosecsInTenSec = 10000000;
    24 const TInt KMicroSecsInOneSec = 1000000;
    25 const TInt KMicroSecsTwoSec = 2000000;
    26 const TInt KMinimumPriority = -100;
    27 const TInt KMaximumPriority = 100;
    28 const TInt KFourCCMaxBitDisplacement = 24;
    29 const TInt K8Bits = 8;
    30 const TInt KTFourCC = 4;
    31 const TInt KMaxSampleRateStringLength = 21;
    32 const TInt KMaxChannelsStringLength = 10;
    33 const TInt KExtraVolume = 50;
    34 // To compute elapsed time for some timed test cases
    35 const TInt64 KPlayVarianceTime = 1500000; // 1.5 seconds
    36 const TInt KMaxSpeakerBalanceValue = 100;
    37 const TInt KMinSpeakerBalanceValue = 0;
    38 const TInt KMaxRecordBalanceValue = 100;
    39 
    40 
    41 _LIT(KMsgDeleteDevsound, "---- Deleting DevSound object ----");
    42 _LIT(KMsgErrorGetParameter,"Error in getting parameter %S from INI file");
    43 _LIT(KMsgErrorDevSoundCallback,"DevSound called %S() callback with error = %d");
    44 _LIT(KMsgErrorFourccLength,"Error in getting parameter length from INI file %d");
    45 
    46 _LIT(KInitializeCompleteText, "InitializeComplete");
    47 _LIT(KPlayErrorText, "PlayError");
    48 _LIT(KRecordErrorText, "RecordError");
    49 _LIT(KToneFinishedText, "ToneFinished");
    50 
    51 // Section error name keys
    52 _LIT(KExpectedError, "ExpectedError");
    53 
    54 _LIT(KEMMFSampleRate8000Hz,"EMMFSampleRate8000Hz");
    55 _LIT(KEMMFSampleRate11025Hz,"EMMFSampleRate11025Hz");
    56 _LIT(KEMMFSampleRate16000Hz,"EMMFSampleRate16000Hz");
    57 _LIT(KEMMFSampleRate22050Hz,"EMMFSampleRate22050Hz");
    58 _LIT(KEMMFSampleRate32000Hz,"EMMFSampleRate32000Hz");
    59 _LIT(KEMMFSampleRate44100Hz,"EMMFSampleRate44100Hz");
    60 _LIT(KEMMFSampleRate48000Hz,"EMMFSampleRate48000Hz");
    61 _LIT(KEMMFSampleRate88200Hz,"EMMFSampleRate88200Hz");
    62 _LIT(KEMMFSampleRate96000Hz,"EMMFSampleRate96000Hz");
    63 _LIT(KEMMFSampleRate12000Hz,"EMMFSampleRate12000Hz");
    64 _LIT(KEMMFSampleRate24000Hz,"EMMFSampleRate24000Hz");
    65 _LIT(KEMMFSampleRate64000Hz,"EMMFSampleRate64000Hz");
    66 
    67 _LIT(KEMMFMono,"EMMFMono");
    68 _LIT(KEMMFStereo,"EMMFStereo");
    69 
    70 // Section name keys
    71 _LIT(KSampleRate, "SampleRate");
    72 _LIT(KChannel, "Channel");
    73 _LIT(KPriority, "Priority");
    74 _LIT(KVolume, "Volume");
    75 _LIT(KExVolume, "ExVolume");
    76 _LIT(KGain, "Gain");
    77 _LIT(KExGain, "ExGain");
    78 _LIT(KVolumeRamp, "VolumeRamp");
    79 _LIT(KRepeatCount, "RepeatCount");
    80 _LIT(KRepeatTrailingSilence, "RepeatTrailingSilence");
    81 _LIT(KToneOnLength, "ToneOnLength");
    82 _LIT(KToneOffLength, "ToneOffLength");
    83 _LIT(KPauseLength, "PauseLength");
    84 _LIT(KFilename, "Filename");
    85 _LIT(KOtherFilename, "OtherFilename");
    86 _LIT(KDuration, "Duration");
    87 _LIT(KFrequencyTone1, "FrequencyTone1");
    88 _LIT(KFrequencyTone2, "FrequencyTone2");
    89 _LIT(KDTMFString, "DTMFString");
    90 _LIT(KInvalidToneSequence,"InvalidToneSequence");
    91 _LIT(KLSpeakerBalance, "LSpeakerBalance");
    92 _LIT(KRSpeakerBalance, "RSpeakerBalance");
    93 _LIT(KLRecordBalance, "LRecordBalance");
    94 _LIT(KRRecordBalance, "RRecordBalance");
    95 _LIT(KExLSpeakerBalance, "ExLSpeakerBalance");
    96 _LIT(KExRSpeakerBalance, "ExRSpeakerBalance");
    97 _LIT(KExLRecordBalance, "ExLRecordBalance");
    98 _LIT(KExRRecordBalance, "ExRRecordBalance");
    99 _LIT(KFourccCode, "FourccCode");
   100 _LIT(KExSamplesPlayed, "ExSamplesPlayed");
   101 _LIT(KExSamplesRecorded, "ExSamplesRecorded");
   102 _LIT(KExCapChannels, "ExCapChannels");
   103 _LIT(KExCapRate, "ExCapRate");
   104 
   105 
   106 enum TPanicCodes
   107 	{
   108 	EFsmIncorrectErrorPassed = 0,
   109 	EInvalidCallbackCall
   110 	};
   111 
   112 // DevSound events
   113 enum TMmfDevSoundEvent
   114 	{
   115 	EEventInitialize = 0,
   116 	EEventInitComplete,
   117 	EEventBTBF,
   118 	EEventBTBE,
   119 	EResourceAvailable,
   120 	EEventTimerComplete
   121 	};
   122 
   123 // DevSound states
   124 enum TMmfDevSoundState
   125 	{
   126 	EStateInitial = 0,
   127 	EStateCreated,
   128 	EStateInitializing,
   129 	EStatePlaying,
   130 	EStateRecording,
   131 	EStatePause,
   132 	EStateResumePlaying
   133 	};
   134 
   135 // User defined "devSound client" error codes
   136 enum TMmfDevSoundClientErrorCodes
   137 	{
   138 	EInvalidClientFSMEvent = 1,
   139 	EInvalidClientFSMState,
   140 	EReadFileErrorInClient,
   141 	EWriteFileErrorInClient
   142 	};
   143 
   144 // Panic function
   145 static void Panic(const TDesC &aCategory, TInt aReason)
   146 	{
   147 	User::Panic(aCategory, aReason);
   148 	}
   149 
   150 #ifdef MM_TB101_L
   151 		// Valid data for tone sequence. This code should be used for non-ref tests. This is a valid tone sequence for HW
   152 		const TUint8 KFixedSequenceTestSequenceDataX[]=
   153 		{
   154 		0x02, 0x4A, 0x3A, 0x69, 0x39, 0xBD, 0xAD, 0xA5,
   155 		0x84, 0x81, 0xD1, 0xD5, 0xB9, 0x94, 0x04, 0x00,
   156 		0x27, 0x34, 0x41, 0x0B, 0x2A, 0x82, 0x68, 0x51,
   157 		0x72, 0x19, 0x22, 0xC9, 0x21, 0x47, 0x10, 0x4C,
   158 		0x85, 0x48, 0x71, 0x06, 0x90, 0x48, 0x85, 0x48,
   159 		0x68, 0x20, 0x00
   160 		};
   161 #else
   162 	// Valid data for tone sequence for reference platform. Below tone data may not work for HW devices
   163 	const TUint8 KFixedSequenceTestSequenceDataX[]=
   164 		{
   165 		0x53, 0x51, 0x4E, 0x43, // HEADER
   166 		0xFE, 0xFF, // -2 STARTLOOP INDICATOR
   167 		0x0A, 0x00,  // Number of times that the sequence will be played
   168 		/* Tone Data constitutes the following:
   169 		  ToneDur,    Freq1,      Vol1,       Freq2       Vol2
   170 		The sequence is arranged in blocks of 8 bits to represent 16 bit values,
   171 		which allows more dynamic range, frequency and time values.
   172 		The tag Low and High mean low and high byte block.
   173 		Low    Hi    Low   Hi   Low   Hi    Low   Hi    Low   Hi
   174 		*/
   175 		0x64, 0x00, 0xB8, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   176 		0x64, 0x00, 0xD2, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   177 		0x64, 0x00, 0xEE, 0x01, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   178 		0x64, 0x00, 0x0B, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   179 		0x64, 0x00, 0x2A, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   180 		0x64, 0x00, 0x4B, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   181 		0x64, 0x00, 0x6E, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   182 		0x64, 0x00, 0x93, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   183 		0x64, 0x00, 0xBA, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   184 		0x64, 0x00, 0xE4, 0x02, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   185 		0x64, 0x00, 0x3F, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   186 		0x64, 0x00, 0x70, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   187 		0x64, 0x00, 0xA4, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   188 		0x64, 0x00, 0xDC, 0x03, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   189 		0x64, 0x00, 0x17, 0x04, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
   190 		// Silence
   191 		// ToneDur,    Freq1,      Vol1,       Freq2       Vol2
   192 		0x70, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   193 		0xFD, 0xFF, // -3 ENDOFLOOP INDICATOR
   194 		// Another silence
   195 		// ToneDur,    Freq1,      Vol1,       Freq2       Vol2
   196 		0x70, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   197 		0xFF, 0xFF // -1 SEQ_CMD_RET INDICATOR
   198 		};
   199 
   200 
   201 #endif//#if defined(MM_TB101_L)
   202 
   203 
   204 #endif	// CHAR_A3F_DEVSOUND_COMPLIANCESUITECONSTANTS_H
   205