devsound/a3facf/inc/tonedata.h
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2006-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 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedPartner 
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef TTONEDATA_H
       
    25 #define TTONEDATA_H
       
    26 
       
    27 #include <e32base.h>
       
    28 
       
    29 const TInt KMdaInfiniteDurationDTMFToneOnLength = -1;
       
    30 
       
    31 /*
       
    32  *  Includes information about tone type, data, length.
       
    33  *  @lib ttonedata.lib
       
    34  */
       
    35 class TToneData
       
    36 {
       
    37 public:
       
    38 
       
    39 enum TToneType
       
    40 	{
       
    41 	/* Simple Tone */    
       
    42 	ESimple = 0,
       
    43 	/* Dual Tone */
       
    44 	EDual = 1,
       
    45 	/* TMF String Tone */
       
    46 	EDtmfString = 2,
       
    47 	/* Sequence */
       
    48 	ESequence = 3,
       
    49 	/* Fixed Sequence*/
       
    50 	EFixedSequence = 4 
       
    51 	};
       
    52 
       
    53 
       
    54 	IMPORT_C TToneData();
       
    55 
       
    56 	/*
       
    57 	 * Sets type of the tone. (Simple, Dual, Sequence etc.)
       
    58 	 * 
       
    59 	 * @param aType Type of the tone.
       
    60 	 */
       
    61 	IMPORT_C void SetType(TToneType aType);
       
    62 
       
    63 	/*
       
    64 	 * Sets tone duration in micro seconds.
       
    65 	 * 
       
    66 	 * @param aDuration Tone duration in microseconds.
       
    67 	 */
       
    68 	IMPORT_C void SetDuration(TTimeIntervalMicroSeconds aDuration);
       
    69 
       
    70 	/*
       
    71 	 * Sets tone one freqyency.
       
    72 	 *
       
    73 	 * @param aFrequencyOne Frequency of the tone one.
       
    74 	 */
       
    75 	IMPORT_C void SetFrequencyOne(TInt aFrequencyOne);
       
    76 
       
    77 	/*
       
    78 	 * Sets tone two freqyency.
       
    79 	 *
       
    80 	 * @param aFrequencyOne Frequency of the tone two.
       
    81 	 */
       
    82 	IMPORT_C void SetFrequencyTwo(TInt aFrequencyTwo);
       
    83 
       
    84 	/*
       
    85 	 * Sets tone sequence number.
       
    86 	 *
       
    87 	 * @param aSequenceNumber Number of the sequence.
       
    88 	 */
       
    89 	IMPORT_C void SetSequenceNumber(TInt aSequenceNumber);
       
    90 
       
    91 	/*
       
    92 	 * Sets tone sequence data.
       
    93 	 *
       
    94 	 * @param aSequenceData Reference of the sequence data.
       
    95 	 */
       
    96 	IMPORT_C void SetSequenceData(TDesC8& aSequenceData);
       
    97 
       
    98 	/*
       
    99 	 * Sets tone repeat count, if count is KMdaRepeatForever, tone will be repeated indefinitely.
       
   100 	 *
       
   101 	 * @param aRepeatCount Repeat count of the tone.
       
   102 	 */
       
   103 	IMPORT_C void SetRepeatCount(TInt aRepeatCount);
       
   104 
       
   105 	/*
       
   106 	 * Sets tone trailing silence. 
       
   107 	 * 
       
   108 	 * @param aRepeatTrailingSilence An interval of silence which will be played after each tone. 
       
   109 	 */
       
   110 	IMPORT_C void SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrailingSilence);
       
   111 
       
   112 	/*
       
   113 	 * Defines the duration of tone on, tone off and tone pause to be used during the DTMF tone playback operation.
       
   114 	 *
       
   115 	 * @param aToneOnLength The period over which the tone will be played. If this is set to zero, then the tone is not played.
       
   116 	 * @param aToneOffLength The period over which the no tone will be played.
       
   117 	 * @param aPauseLength The period over which the tone playing will be paused.
       
   118 	 */
       
   119 	IMPORT_C void SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength, TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength);
       
   120 
       
   121 	/*
       
   122 	 * Sets tone DTMF string.
       
   123 	 *
       
   124 	 * @param aDTMFString Reference of the DTMF string.
       
   125 	 */
       
   126 	IMPORT_C void SetDTMFString(TDesC& aDTMFString);
       
   127 
       
   128 	/*
       
   129 	 * Gets tone type. (Simple, Dual, Sequence etc.)
       
   130 	 *
       
   131 	 * @param aType Type of the tone.
       
   132 	 */
       
   133 	IMPORT_C void GetType(TToneType& aType);
       
   134 	
       
   135 	/*
       
   136 	 * Gets tone duration in micro seconds.
       
   137 	 *
       
   138 	 * @param aDuration Tone duration in microseconds.
       
   139 	 */
       
   140 	IMPORT_C void GetDuration(TTimeIntervalMicroSeconds& aDuration);
       
   141 
       
   142 	/*
       
   143 	 * Gets frequency of the tone one.
       
   144 	 *
       
   145 	 * @return Frequency of the tone one.
       
   146 	 */
       
   147 	IMPORT_C TInt GetFrequencyOne();
       
   148 	
       
   149 	/*
       
   150 	 * Gets frequency of the tone two.
       
   151 	 *
       
   152 	 * @return Frequency of the tone two.
       
   153 	 */
       
   154 	IMPORT_C TInt GetFrequencyTwo();
       
   155 	
       
   156 	/*
       
   157 	 * Gets sequence number.
       
   158 	 *
       
   159 	 * @return Sequence number.
       
   160 	 */
       
   161 	IMPORT_C TInt GetSequenceNumber();
       
   162 		  
       
   163 	/*
       
   164 	 * Gets sequence data of the tone.
       
   165 	 * Client should not delete this pointer.
       
   166 	 *
       
   167 	 * @return Pointer to tone sequence data.
       
   168 	 */
       
   169 	IMPORT_C TDesC8* GetSequenceData();
       
   170 			
       
   171 	/*
       
   172 	 * Gets tone repeat count.
       
   173 	 *
       
   174 	 * @return Repeat count.
       
   175 	 */
       
   176 	IMPORT_C TInt GetRepeatCount();
       
   177 	
       
   178 	/*
       
   179 	 * Gets tone trailing silence duration.
       
   180 	 *
       
   181 	 * @param aRepeatTrailingSilence Trailing silence duration.
       
   182 	 */
       
   183 	IMPORT_C void GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
       
   184 			   
       
   185 	/*
       
   186 	 * Gets tone DTMF lengts duration.
       
   187 	 *
       
   188 	 * @param aToneOnLength The period over which the tone will be played.
       
   189 	 * @param aToneOffLength The period over which the no tone will be played.
       
   190 	 * @param aPauseLength The period over which the tone playing will be paused.
       
   191 	 */
       
   192 	IMPORT_C void GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength, TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength);
       
   193 
       
   194 	/*
       
   195 	 * Gets DTMF string of the tone.
       
   196 	 * Client should not delete this pointer
       
   197 	 *
       
   198 	 * @return Pointer to tone DTMF string.
       
   199 	 */
       
   200 	IMPORT_C TDesC* GetDTMFString();
       
   201 
       
   202 	private: // data
       
   203 
       
   204 
       
   205 	/* Type of the tone. */
       
   206 
       
   207 	TToneType iType;
       
   208 
       
   209 	
       
   210 	/* Duration of the tone. */
       
   211 	 
       
   212 	TTimeIntervalMicroSeconds iDuration;
       
   213 
       
   214 	
       
   215 	/* Frequency of the tone one. */
       
   216 	 
       
   217 	TInt iFrequencyOne;
       
   218 
       
   219 	
       
   220 	/* Frequency of the tone two. */
       
   221 	 
       
   222 	TInt iFrequencyTwo;
       
   223 
       
   224 	
       
   225 	/* Sequence number of the tone. */
       
   226 	 
       
   227 	TInt iSequenceNumber;
       
   228 
       
   229 	
       
   230 	/* Repeat count of the tone. */
       
   231 	 
       
   232 	TInt iRepeatCount;
       
   233 
       
   234 	
       
   235 	/* Repeat traingling silence of the tone. */
       
   236 	 
       
   237 	TTimeIntervalMicroSeconds iRepeatTrainglingSilence;
       
   238 
       
   239 	
       
   240 	/* The period over which the tone will be played. */
       
   241 	 
       
   242 	TTimeIntervalMicroSeconds32 iToneOnLength;
       
   243 
       
   244 	
       
   245 	/* The period over which the no tone will be played. */
       
   246 	 
       
   247 	TTimeIntervalMicroSeconds32 iToneOffLength;
       
   248 
       
   249 	
       
   250 	/* The period over which the tone playing will be paused. */
       
   251 	 
       
   252 	TTimeIntervalMicroSeconds32 iPauseLength;
       
   253 
       
   254 	
       
   255 	/* Pointer to data of the tone sequence.
       
   256 	 * Not own.
       
   257 	 */
       
   258 	 
       
   259 	TDesC8 *iSequenceData;
       
   260 
       
   261 	
       
   262 	/* Pointer to string of the DTMF tone.
       
   263 	 * Not own.
       
   264 	 */
       
   265 	 
       
   266 	TDesC *iDTMFString;
       
   267 	};
       
   268 
       
   269 #endif // TTONEDATA_H