os/mm/devsound/a3facf/inc/tonedata.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/a3facf/inc/tonedata.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,269 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedPartner 
    1.24 + @released
    1.25 +*/
    1.26 +
    1.27 +#ifndef TTONEDATA_H
    1.28 +#define TTONEDATA_H
    1.29 +
    1.30 +#include <e32base.h>
    1.31 +
    1.32 +const TInt KMdaInfiniteDurationDTMFToneOnLength = -1;
    1.33 +
    1.34 +/*
    1.35 + *  Includes information about tone type, data, length.
    1.36 + *  @lib ttonedata.lib
    1.37 + */
    1.38 +class TToneData
    1.39 +{
    1.40 +public:
    1.41 +
    1.42 +enum TToneType
    1.43 +	{
    1.44 +	/* Simple Tone */    
    1.45 +	ESimple = 0,
    1.46 +	/* Dual Tone */
    1.47 +	EDual = 1,
    1.48 +	/* TMF String Tone */
    1.49 +	EDtmfString = 2,
    1.50 +	/* Sequence */
    1.51 +	ESequence = 3,
    1.52 +	/* Fixed Sequence*/
    1.53 +	EFixedSequence = 4 
    1.54 +	};
    1.55 +
    1.56 +
    1.57 +	IMPORT_C TToneData();
    1.58 +
    1.59 +	/*
    1.60 +	 * Sets type of the tone. (Simple, Dual, Sequence etc.)
    1.61 +	 * 
    1.62 +	 * @param aType Type of the tone.
    1.63 +	 */
    1.64 +	IMPORT_C void SetType(TToneType aType);
    1.65 +
    1.66 +	/*
    1.67 +	 * Sets tone duration in micro seconds.
    1.68 +	 * 
    1.69 +	 * @param aDuration Tone duration in microseconds.
    1.70 +	 */
    1.71 +	IMPORT_C void SetDuration(TTimeIntervalMicroSeconds aDuration);
    1.72 +
    1.73 +	/*
    1.74 +	 * Sets tone one freqyency.
    1.75 +	 *
    1.76 +	 * @param aFrequencyOne Frequency of the tone one.
    1.77 +	 */
    1.78 +	IMPORT_C void SetFrequencyOne(TInt aFrequencyOne);
    1.79 +
    1.80 +	/*
    1.81 +	 * Sets tone two freqyency.
    1.82 +	 *
    1.83 +	 * @param aFrequencyOne Frequency of the tone two.
    1.84 +	 */
    1.85 +	IMPORT_C void SetFrequencyTwo(TInt aFrequencyTwo);
    1.86 +
    1.87 +	/*
    1.88 +	 * Sets tone sequence number.
    1.89 +	 *
    1.90 +	 * @param aSequenceNumber Number of the sequence.
    1.91 +	 */
    1.92 +	IMPORT_C void SetSequenceNumber(TInt aSequenceNumber);
    1.93 +
    1.94 +	/*
    1.95 +	 * Sets tone sequence data.
    1.96 +	 *
    1.97 +	 * @param aSequenceData Reference of the sequence data.
    1.98 +	 */
    1.99 +	IMPORT_C void SetSequenceData(TDesC8& aSequenceData);
   1.100 +
   1.101 +	/*
   1.102 +	 * Sets tone repeat count, if count is KMdaRepeatForever, tone will be repeated indefinitely.
   1.103 +	 *
   1.104 +	 * @param aRepeatCount Repeat count of the tone.
   1.105 +	 */
   1.106 +	IMPORT_C void SetRepeatCount(TInt aRepeatCount);
   1.107 +
   1.108 +	/*
   1.109 +	 * Sets tone trailing silence. 
   1.110 +	 * 
   1.111 +	 * @param aRepeatTrailingSilence An interval of silence which will be played after each tone. 
   1.112 +	 */
   1.113 +	IMPORT_C void SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrailingSilence);
   1.114 +
   1.115 +	/*
   1.116 +	 * Defines the duration of tone on, tone off and tone pause to be used during the DTMF tone playback operation.
   1.117 +	 *
   1.118 +	 * @param aToneOnLength The period over which the tone will be played. If this is set to zero, then the tone is not played.
   1.119 +	 * @param aToneOffLength The period over which the no tone will be played.
   1.120 +	 * @param aPauseLength The period over which the tone playing will be paused.
   1.121 +	 */
   1.122 +	IMPORT_C void SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength, TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength);
   1.123 +
   1.124 +	/*
   1.125 +	 * Sets tone DTMF string.
   1.126 +	 *
   1.127 +	 * @param aDTMFString Reference of the DTMF string.
   1.128 +	 */
   1.129 +	IMPORT_C void SetDTMFString(TDesC& aDTMFString);
   1.130 +
   1.131 +	/*
   1.132 +	 * Gets tone type. (Simple, Dual, Sequence etc.)
   1.133 +	 *
   1.134 +	 * @param aType Type of the tone.
   1.135 +	 */
   1.136 +	IMPORT_C void GetType(TToneType& aType);
   1.137 +	
   1.138 +	/*
   1.139 +	 * Gets tone duration in micro seconds.
   1.140 +	 *
   1.141 +	 * @param aDuration Tone duration in microseconds.
   1.142 +	 */
   1.143 +	IMPORT_C void GetDuration(TTimeIntervalMicroSeconds& aDuration);
   1.144 +
   1.145 +	/*
   1.146 +	 * Gets frequency of the tone one.
   1.147 +	 *
   1.148 +	 * @return Frequency of the tone one.
   1.149 +	 */
   1.150 +	IMPORT_C TInt GetFrequencyOne();
   1.151 +	
   1.152 +	/*
   1.153 +	 * Gets frequency of the tone two.
   1.154 +	 *
   1.155 +	 * @return Frequency of the tone two.
   1.156 +	 */
   1.157 +	IMPORT_C TInt GetFrequencyTwo();
   1.158 +	
   1.159 +	/*
   1.160 +	 * Gets sequence number.
   1.161 +	 *
   1.162 +	 * @return Sequence number.
   1.163 +	 */
   1.164 +	IMPORT_C TInt GetSequenceNumber();
   1.165 +		  
   1.166 +	/*
   1.167 +	 * Gets sequence data of the tone.
   1.168 +	 * Client should not delete this pointer.
   1.169 +	 *
   1.170 +	 * @return Pointer to tone sequence data.
   1.171 +	 */
   1.172 +	IMPORT_C TDesC8* GetSequenceData();
   1.173 +			
   1.174 +	/*
   1.175 +	 * Gets tone repeat count.
   1.176 +	 *
   1.177 +	 * @return Repeat count.
   1.178 +	 */
   1.179 +	IMPORT_C TInt GetRepeatCount();
   1.180 +	
   1.181 +	/*
   1.182 +	 * Gets tone trailing silence duration.
   1.183 +	 *
   1.184 +	 * @param aRepeatTrailingSilence Trailing silence duration.
   1.185 +	 */
   1.186 +	IMPORT_C void GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
   1.187 +			   
   1.188 +	/*
   1.189 +	 * Gets tone DTMF lengts duration.
   1.190 +	 *
   1.191 +	 * @param aToneOnLength The period over which the tone will be played.
   1.192 +	 * @param aToneOffLength The period over which the no tone will be played.
   1.193 +	 * @param aPauseLength The period over which the tone playing will be paused.
   1.194 +	 */
   1.195 +	IMPORT_C void GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength, TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength);
   1.196 +
   1.197 +	/*
   1.198 +	 * Gets DTMF string of the tone.
   1.199 +	 * Client should not delete this pointer
   1.200 +	 *
   1.201 +	 * @return Pointer to tone DTMF string.
   1.202 +	 */
   1.203 +	IMPORT_C TDesC* GetDTMFString();
   1.204 +
   1.205 +	private: // data
   1.206 +
   1.207 +
   1.208 +	/* Type of the tone. */
   1.209 +
   1.210 +	TToneType iType;
   1.211 +
   1.212 +	
   1.213 +	/* Duration of the tone. */
   1.214 +	 
   1.215 +	TTimeIntervalMicroSeconds iDuration;
   1.216 +
   1.217 +	
   1.218 +	/* Frequency of the tone one. */
   1.219 +	 
   1.220 +	TInt iFrequencyOne;
   1.221 +
   1.222 +	
   1.223 +	/* Frequency of the tone two. */
   1.224 +	 
   1.225 +	TInt iFrequencyTwo;
   1.226 +
   1.227 +	
   1.228 +	/* Sequence number of the tone. */
   1.229 +	 
   1.230 +	TInt iSequenceNumber;
   1.231 +
   1.232 +	
   1.233 +	/* Repeat count of the tone. */
   1.234 +	 
   1.235 +	TInt iRepeatCount;
   1.236 +
   1.237 +	
   1.238 +	/* Repeat traingling silence of the tone. */
   1.239 +	 
   1.240 +	TTimeIntervalMicroSeconds iRepeatTrainglingSilence;
   1.241 +
   1.242 +	
   1.243 +	/* The period over which the tone will be played. */
   1.244 +	 
   1.245 +	TTimeIntervalMicroSeconds32 iToneOnLength;
   1.246 +
   1.247 +	
   1.248 +	/* The period over which the no tone will be played. */
   1.249 +	 
   1.250 +	TTimeIntervalMicroSeconds32 iToneOffLength;
   1.251 +
   1.252 +	
   1.253 +	/* The period over which the tone playing will be paused. */
   1.254 +	 
   1.255 +	TTimeIntervalMicroSeconds32 iPauseLength;
   1.256 +
   1.257 +	
   1.258 +	/* Pointer to data of the tone sequence.
   1.259 +	 * Not own.
   1.260 +	 */
   1.261 +	 
   1.262 +	TDesC8 *iSequenceData;
   1.263 +
   1.264 +	
   1.265 +	/* Pointer to string of the DTMF tone.
   1.266 +	 * Not own.
   1.267 +	 */
   1.268 +	 
   1.269 +	TDesC *iDTMFString;
   1.270 +	};
   1.271 +
   1.272 +#endif // TTONEDATA_H