os/mm/devsound/a3facf/src/tonedata/tonedata.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 //tonedata.cpp
     2 
     3 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     4 // All rights reserved.
     5 // This component and the accompanying materials are made available
     6 // under the terms of "Eclipse Public License v1.0"
     7 // which accompanies this distribution, and is available
     8 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 //
    10 // Initial Contributors:
    11 // Nokia Corporation - initial contribution.
    12 //
    13 // Contributors:
    14 //
    15 // Description:
    16 //
    17 
    18 
    19 
    20 #include <a3f/tonedata.h>
    21 #include <a3f/a3f_trace_utils.h>
    22 
    23 
    24 // ---------------------------------------------------------------------------
    25 // TToneData::TToneData
    26 // ---------------------------------------------------------------------------
    27 //
    28 EXPORT_C TToneData::TToneData()
    29 	{
    30 	DP_CONTEXT(TToneData::TToneData *CD1*, CtxDevSound, DPLOCAL);
    31 	DP_IN();
    32 	// Default values
    33 	iRepeatCount = 0;
    34 	iType = ESimple;
    35 	DP_OUT();
    36 	}
    37 
    38 // ---------------------------------------------------------------------------
    39 // TToneData::SetType
    40 // ---------------------------------------------------------------------------
    41 //
    42 EXPORT_C void TToneData::SetType(TToneType aType)
    43 	{
    44 	DP_CONTEXT(TToneData::SetType *CD1*, CtxDevSound, DPLOCAL);
    45 	DP1_IN("aType=%d", aType);
    46 	iType = aType;
    47 	DP_OUT();
    48 	}
    49 
    50 // ---------------------------------------------------------------------------
    51 // TToneData::SetDuration
    52 // ---------------------------------------------------------------------------
    53 //    
    54 EXPORT_C void TToneData::SetDuration(TTimeIntervalMicroSeconds aDuration)
    55 	{
    56 	DP_CONTEXT(TToneData::SetDuration *CD1*, CtxDevSound, DPLOCAL);
    57 	DP_IN();
    58 	iDuration = aDuration;
    59 	DP_OUT();
    60 	}
    61 
    62 // ---------------------------------------------------------------------------
    63 // TToneData::SetFrequencyOne
    64 // ---------------------------------------------------------------------------
    65 //
    66 EXPORT_C void TToneData::SetFrequencyOne(TInt aFrequencyOne)
    67 	{
    68 	DP_CONTEXT(TToneData::SetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
    69 	DP1_IN("aFrequencyOne=%d", aFrequencyOne);
    70 	iFrequencyOne = aFrequencyOne;    
    71 	DP_OUT();
    72 	}
    73 
    74 // ---------------------------------------------------------------------------
    75 // TToneData::SetFrequencyTwo
    76 // ---------------------------------------------------------------------------
    77 //
    78 EXPORT_C void TToneData::SetFrequencyTwo(TInt aFrequencyTwo)
    79 	{
    80 	DP_CONTEXT(TToneData::SetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
    81 	DP1_IN("aFrequencyTwo=%d", aFrequencyTwo);
    82 	iFrequencyTwo = aFrequencyTwo;
    83 	DP_OUT();
    84 	}
    85 
    86 // ---------------------------------------------------------------------------
    87 // TToneData::SetSequenceNumber
    88 // ---------------------------------------------------------------------------
    89 //
    90 EXPORT_C void TToneData::SetSequenceNumber(TInt aSequenceNumber)
    91 	{
    92 	DP_CONTEXT(TToneData::SetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
    93 	DP1_IN("aSequenceNumber=%d", aSequenceNumber);
    94 	iSequenceNumber = aSequenceNumber;
    95 	DP_OUT();
    96 	}
    97 
    98 // ---------------------------------------------------------------------------
    99 // TToneData::SetSequenceData
   100 // ---------------------------------------------------------------------------
   101 //
   102 EXPORT_C void TToneData::SetSequenceData(TDesC8& aSequenceData)
   103 	{
   104 	DP_CONTEXT(TToneData::SetSequenceData *CD1*, CtxDevSound, DPLOCAL);
   105 	DP_IN();
   106 	iSequenceData = &aSequenceData;
   107 	DP_OUT();
   108 	}
   109 
   110 // ---------------------------------------------------------------------------
   111 // TToneData::SetRepeatCount
   112 // ---------------------------------------------------------------------------
   113 //
   114 EXPORT_C void TToneData::SetRepeatCount(TInt aRepeatCount)
   115 	{
   116 	DP_CONTEXT(TToneData::SetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
   117 	DP1_IN("aRepeatCount=%d", aRepeatCount);
   118 	iRepeatCount = aRepeatCount;
   119 	DP_OUT();
   120 	}
   121 
   122 // ---------------------------------------------------------------------------
   123 // TToneData::SetRepeatTrailingSilence
   124 // ---------------------------------------------------------------------------
   125 //
   126 EXPORT_C void TToneData::SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrainglingSilence)
   127 	{
   128 	DP_CONTEXT(TToneData::SetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
   129 	DP_IN();
   130 	iRepeatTrainglingSilence = aRepeatTrainglingSilence;    
   131 	DP_OUT();
   132 	}
   133 
   134 // ---------------------------------------------------------------------------
   135 // TToneData::SetDtmfLengths
   136 // ---------------------------------------------------------------------------
   137 //    
   138 EXPORT_C void TToneData::SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength,
   139 		TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength)
   140 	{
   141 	DP_CONTEXT(TToneData::SetDtmfLengths *CD1*, CtxDevSound, DPLOCAL);
   142 	DP_IN();
   143 	iToneOnLength = aToneOnLength;
   144 	iToneOffLength = aToneOffLength;
   145 	iPauseLength = aPauseLength;
   146 	DP_OUT();
   147 	}
   148 
   149 // ---------------------------------------------------------------------------
   150 // TToneData::SetDTMFString
   151 // ---------------------------------------------------------------------------
   152 //    
   153 EXPORT_C void TToneData::SetDTMFString(TDesC& aDTMFString)
   154 	{
   155 	DP_CONTEXT(TToneData::SetDTMFString *CD1*, CtxDevSound, DPLOCAL);
   156 	DP_IN();
   157 	iDTMFString = &aDTMFString;
   158 	DP_OUT();
   159 	}
   160 
   161 // ---------------------------------------------------------------------------
   162 // TToneData::GetType
   163 // ---------------------------------------------------------------------------
   164 //    
   165 EXPORT_C void TToneData::GetType(TToneType& aType)
   166 	{
   167 	DP_CONTEXT(TToneData::GetType *CD1*, CtxDevSound, DPLOCAL);
   168 	DP_IN();
   169 	aType = iType;
   170 	DP_OUT();
   171 	}
   172 
   173 // ---------------------------------------------------------------------------
   174 // TToneData::GetDuration
   175 // ---------------------------------------------------------------------------
   176 //    
   177 EXPORT_C void TToneData::GetDuration(TTimeIntervalMicroSeconds& aDuration)
   178 	{
   179 	DP_CONTEXT(TToneData::GetDuration *CD1*, CtxDevSound, DPLOCAL);
   180 	DP_IN();
   181 	aDuration = iDuration;
   182 	DP_OUT();
   183 	}
   184 
   185 // ---------------------------------------------------------------------------
   186 // TToneData::GetFrequencyOne
   187 // ---------------------------------------------------------------------------
   188 //
   189 EXPORT_C TInt TToneData::GetFrequencyOne()
   190 	{
   191 	DP_CONTEXT(TToneData::GetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
   192 	DP_IN();
   193 	DP0_RET(iFrequencyOne, "%d");    
   194 	}
   195 
   196 // ---------------------------------------------------------------------------
   197 // TToneData::GetFrequencyTwo
   198 // ---------------------------------------------------------------------------
   199 //
   200 EXPORT_C TInt TToneData::GetFrequencyTwo()
   201 	{
   202 	DP_CONTEXT(TToneData::GetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
   203 	DP_IN();
   204 	DP0_RET(iFrequencyTwo, "%d");
   205 	}
   206 
   207 // ---------------------------------------------------------------------------
   208 // TToneData::GetSequenceNumber
   209 // ---------------------------------------------------------------------------
   210 //
   211 EXPORT_C TInt TToneData::GetSequenceNumber()
   212 	{
   213 	DP_CONTEXT(TToneData::GetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
   214 	DP_IN();
   215 	DP0_RET(iSequenceNumber, "%d");
   216 	}
   217 
   218 
   219 // ---------------------------------------------------------------------------
   220 // TToneData::GetSequenceData
   221 // ---------------------------------------------------------------------------
   222 //
   223 EXPORT_C TDesC8* TToneData::GetSequenceData()
   224 	{
   225 	DP_CONTEXT(TToneData::GetSequenceData *CD1*, CtxDevSound, DPLOCAL);
   226 	DP_IN();
   227 	DP_OUT();
   228 	return iSequenceData;    
   229 	}
   230 
   231 // ---------------------------------------------------------------------------
   232 // TToneData::GetRepeatCount
   233 // ---------------------------------------------------------------------------
   234 //
   235 EXPORT_C TInt TToneData::GetRepeatCount()
   236 	{
   237 	DP_CONTEXT(TToneData::GetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
   238 	DP_IN();
   239 	DP0_RET(iRepeatCount, "%d");
   240 	}
   241 
   242 // ---------------------------------------------------------------------------
   243 // TToneData::GetRepeatTrailingSilence
   244 // ---------------------------------------------------------------------------
   245 //
   246 EXPORT_C void TToneData::GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrainglingSilence)
   247 	{
   248 	DP_CONTEXT(TToneData::GetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
   249 	DP_IN();
   250 	aRepeatTrainglingSilence = iRepeatTrainglingSilence;    
   251 	DP_OUT();
   252 	}
   253 
   254 // ---------------------------------------------------------------------------
   255 // TToneData::GetDtmfLenghts
   256 // ---------------------------------------------------------------------------
   257 //
   258 EXPORT_C void TToneData::GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength,
   259 		TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength)
   260 	{
   261 	DP_CONTEXT(TToneData::GetDtmfLenghts *CD1*, CtxDevSound, DPLOCAL);
   262 	DP_IN();
   263 	aToneOnLength = iToneOnLength;
   264 	aToneOffLength = iToneOffLength;
   265 	aPauseLength = iPauseLength;
   266 	DP_OUT();
   267 	}
   268 
   269 // ---------------------------------------------------------------------------
   270 // TToneData::GetDTMFString
   271 // ---------------------------------------------------------------------------
   272 //
   273 EXPORT_C TDesC* TToneData::GetDTMFString()
   274 	{
   275 	DP_CONTEXT(TToneData::GetDTMFString *CD1*, CtxDevSound, DPLOCAL);
   276 	DP_IN();
   277 	DP_OUT();
   278 	return iDTMFString;
   279 	}