1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3facf/src/tonedata/tonedata.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,279 @@
1.4 +//tonedata.cpp
1.5 +
1.6 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +// All rights reserved.
1.8 +// This component and the accompanying materials are made available
1.9 +// under the terms of "Eclipse Public License v1.0"
1.10 +// which accompanies this distribution, and is available
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 +//
1.13 +// Initial Contributors:
1.14 +// Nokia Corporation - initial contribution.
1.15 +//
1.16 +// Contributors:
1.17 +//
1.18 +// Description:
1.19 +//
1.20 +
1.21 +
1.22 +
1.23 +#include <a3f/tonedata.h>
1.24 +#include <a3f/a3f_trace_utils.h>
1.25 +
1.26 +
1.27 +// ---------------------------------------------------------------------------
1.28 +// TToneData::TToneData
1.29 +// ---------------------------------------------------------------------------
1.30 +//
1.31 +EXPORT_C TToneData::TToneData()
1.32 + {
1.33 + DP_CONTEXT(TToneData::TToneData *CD1*, CtxDevSound, DPLOCAL);
1.34 + DP_IN();
1.35 + // Default values
1.36 + iRepeatCount = 0;
1.37 + iType = ESimple;
1.38 + DP_OUT();
1.39 + }
1.40 +
1.41 +// ---------------------------------------------------------------------------
1.42 +// TToneData::SetType
1.43 +// ---------------------------------------------------------------------------
1.44 +//
1.45 +EXPORT_C void TToneData::SetType(TToneType aType)
1.46 + {
1.47 + DP_CONTEXT(TToneData::SetType *CD1*, CtxDevSound, DPLOCAL);
1.48 + DP1_IN("aType=%d", aType);
1.49 + iType = aType;
1.50 + DP_OUT();
1.51 + }
1.52 +
1.53 +// ---------------------------------------------------------------------------
1.54 +// TToneData::SetDuration
1.55 +// ---------------------------------------------------------------------------
1.56 +//
1.57 +EXPORT_C void TToneData::SetDuration(TTimeIntervalMicroSeconds aDuration)
1.58 + {
1.59 + DP_CONTEXT(TToneData::SetDuration *CD1*, CtxDevSound, DPLOCAL);
1.60 + DP_IN();
1.61 + iDuration = aDuration;
1.62 + DP_OUT();
1.63 + }
1.64 +
1.65 +// ---------------------------------------------------------------------------
1.66 +// TToneData::SetFrequencyOne
1.67 +// ---------------------------------------------------------------------------
1.68 +//
1.69 +EXPORT_C void TToneData::SetFrequencyOne(TInt aFrequencyOne)
1.70 + {
1.71 + DP_CONTEXT(TToneData::SetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
1.72 + DP1_IN("aFrequencyOne=%d", aFrequencyOne);
1.73 + iFrequencyOne = aFrequencyOne;
1.74 + DP_OUT();
1.75 + }
1.76 +
1.77 +// ---------------------------------------------------------------------------
1.78 +// TToneData::SetFrequencyTwo
1.79 +// ---------------------------------------------------------------------------
1.80 +//
1.81 +EXPORT_C void TToneData::SetFrequencyTwo(TInt aFrequencyTwo)
1.82 + {
1.83 + DP_CONTEXT(TToneData::SetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
1.84 + DP1_IN("aFrequencyTwo=%d", aFrequencyTwo);
1.85 + iFrequencyTwo = aFrequencyTwo;
1.86 + DP_OUT();
1.87 + }
1.88 +
1.89 +// ---------------------------------------------------------------------------
1.90 +// TToneData::SetSequenceNumber
1.91 +// ---------------------------------------------------------------------------
1.92 +//
1.93 +EXPORT_C void TToneData::SetSequenceNumber(TInt aSequenceNumber)
1.94 + {
1.95 + DP_CONTEXT(TToneData::SetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
1.96 + DP1_IN("aSequenceNumber=%d", aSequenceNumber);
1.97 + iSequenceNumber = aSequenceNumber;
1.98 + DP_OUT();
1.99 + }
1.100 +
1.101 +// ---------------------------------------------------------------------------
1.102 +// TToneData::SetSequenceData
1.103 +// ---------------------------------------------------------------------------
1.104 +//
1.105 +EXPORT_C void TToneData::SetSequenceData(TDesC8& aSequenceData)
1.106 + {
1.107 + DP_CONTEXT(TToneData::SetSequenceData *CD1*, CtxDevSound, DPLOCAL);
1.108 + DP_IN();
1.109 + iSequenceData = &aSequenceData;
1.110 + DP_OUT();
1.111 + }
1.112 +
1.113 +// ---------------------------------------------------------------------------
1.114 +// TToneData::SetRepeatCount
1.115 +// ---------------------------------------------------------------------------
1.116 +//
1.117 +EXPORT_C void TToneData::SetRepeatCount(TInt aRepeatCount)
1.118 + {
1.119 + DP_CONTEXT(TToneData::SetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
1.120 + DP1_IN("aRepeatCount=%d", aRepeatCount);
1.121 + iRepeatCount = aRepeatCount;
1.122 + DP_OUT();
1.123 + }
1.124 +
1.125 +// ---------------------------------------------------------------------------
1.126 +// TToneData::SetRepeatTrailingSilence
1.127 +// ---------------------------------------------------------------------------
1.128 +//
1.129 +EXPORT_C void TToneData::SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrainglingSilence)
1.130 + {
1.131 + DP_CONTEXT(TToneData::SetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
1.132 + DP_IN();
1.133 + iRepeatTrainglingSilence = aRepeatTrainglingSilence;
1.134 + DP_OUT();
1.135 + }
1.136 +
1.137 +// ---------------------------------------------------------------------------
1.138 +// TToneData::SetDtmfLengths
1.139 +// ---------------------------------------------------------------------------
1.140 +//
1.141 +EXPORT_C void TToneData::SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength,
1.142 + TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength)
1.143 + {
1.144 + DP_CONTEXT(TToneData::SetDtmfLengths *CD1*, CtxDevSound, DPLOCAL);
1.145 + DP_IN();
1.146 + iToneOnLength = aToneOnLength;
1.147 + iToneOffLength = aToneOffLength;
1.148 + iPauseLength = aPauseLength;
1.149 + DP_OUT();
1.150 + }
1.151 +
1.152 +// ---------------------------------------------------------------------------
1.153 +// TToneData::SetDTMFString
1.154 +// ---------------------------------------------------------------------------
1.155 +//
1.156 +EXPORT_C void TToneData::SetDTMFString(TDesC& aDTMFString)
1.157 + {
1.158 + DP_CONTEXT(TToneData::SetDTMFString *CD1*, CtxDevSound, DPLOCAL);
1.159 + DP_IN();
1.160 + iDTMFString = &aDTMFString;
1.161 + DP_OUT();
1.162 + }
1.163 +
1.164 +// ---------------------------------------------------------------------------
1.165 +// TToneData::GetType
1.166 +// ---------------------------------------------------------------------------
1.167 +//
1.168 +EXPORT_C void TToneData::GetType(TToneType& aType)
1.169 + {
1.170 + DP_CONTEXT(TToneData::GetType *CD1*, CtxDevSound, DPLOCAL);
1.171 + DP_IN();
1.172 + aType = iType;
1.173 + DP_OUT();
1.174 + }
1.175 +
1.176 +// ---------------------------------------------------------------------------
1.177 +// TToneData::GetDuration
1.178 +// ---------------------------------------------------------------------------
1.179 +//
1.180 +EXPORT_C void TToneData::GetDuration(TTimeIntervalMicroSeconds& aDuration)
1.181 + {
1.182 + DP_CONTEXT(TToneData::GetDuration *CD1*, CtxDevSound, DPLOCAL);
1.183 + DP_IN();
1.184 + aDuration = iDuration;
1.185 + DP_OUT();
1.186 + }
1.187 +
1.188 +// ---------------------------------------------------------------------------
1.189 +// TToneData::GetFrequencyOne
1.190 +// ---------------------------------------------------------------------------
1.191 +//
1.192 +EXPORT_C TInt TToneData::GetFrequencyOne()
1.193 + {
1.194 + DP_CONTEXT(TToneData::GetFrequencyOne *CD1*, CtxDevSound, DPLOCAL);
1.195 + DP_IN();
1.196 + DP0_RET(iFrequencyOne, "%d");
1.197 + }
1.198 +
1.199 +// ---------------------------------------------------------------------------
1.200 +// TToneData::GetFrequencyTwo
1.201 +// ---------------------------------------------------------------------------
1.202 +//
1.203 +EXPORT_C TInt TToneData::GetFrequencyTwo()
1.204 + {
1.205 + DP_CONTEXT(TToneData::GetFrequencyTwo *CD1*, CtxDevSound, DPLOCAL);
1.206 + DP_IN();
1.207 + DP0_RET(iFrequencyTwo, "%d");
1.208 + }
1.209 +
1.210 +// ---------------------------------------------------------------------------
1.211 +// TToneData::GetSequenceNumber
1.212 +// ---------------------------------------------------------------------------
1.213 +//
1.214 +EXPORT_C TInt TToneData::GetSequenceNumber()
1.215 + {
1.216 + DP_CONTEXT(TToneData::GetSequenceNumber *CD1*, CtxDevSound, DPLOCAL);
1.217 + DP_IN();
1.218 + DP0_RET(iSequenceNumber, "%d");
1.219 + }
1.220 +
1.221 +
1.222 +// ---------------------------------------------------------------------------
1.223 +// TToneData::GetSequenceData
1.224 +// ---------------------------------------------------------------------------
1.225 +//
1.226 +EXPORT_C TDesC8* TToneData::GetSequenceData()
1.227 + {
1.228 + DP_CONTEXT(TToneData::GetSequenceData *CD1*, CtxDevSound, DPLOCAL);
1.229 + DP_IN();
1.230 + DP_OUT();
1.231 + return iSequenceData;
1.232 + }
1.233 +
1.234 +// ---------------------------------------------------------------------------
1.235 +// TToneData::GetRepeatCount
1.236 +// ---------------------------------------------------------------------------
1.237 +//
1.238 +EXPORT_C TInt TToneData::GetRepeatCount()
1.239 + {
1.240 + DP_CONTEXT(TToneData::GetRepeatCount *CD1*, CtxDevSound, DPLOCAL);
1.241 + DP_IN();
1.242 + DP0_RET(iRepeatCount, "%d");
1.243 + }
1.244 +
1.245 +// ---------------------------------------------------------------------------
1.246 +// TToneData::GetRepeatTrailingSilence
1.247 +// ---------------------------------------------------------------------------
1.248 +//
1.249 +EXPORT_C void TToneData::GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrainglingSilence)
1.250 + {
1.251 + DP_CONTEXT(TToneData::GetRepeatTrailingSilence *CD1*, CtxDevSound, DPLOCAL);
1.252 + DP_IN();
1.253 + aRepeatTrainglingSilence = iRepeatTrainglingSilence;
1.254 + DP_OUT();
1.255 + }
1.256 +
1.257 +// ---------------------------------------------------------------------------
1.258 +// TToneData::GetDtmfLenghts
1.259 +// ---------------------------------------------------------------------------
1.260 +//
1.261 +EXPORT_C void TToneData::GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength,
1.262 + TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength)
1.263 + {
1.264 + DP_CONTEXT(TToneData::GetDtmfLenghts *CD1*, CtxDevSound, DPLOCAL);
1.265 + DP_IN();
1.266 + aToneOnLength = iToneOnLength;
1.267 + aToneOffLength = iToneOffLength;
1.268 + aPauseLength = iPauseLength;
1.269 + DP_OUT();
1.270 + }
1.271 +
1.272 +// ---------------------------------------------------------------------------
1.273 +// TToneData::GetDTMFString
1.274 +// ---------------------------------------------------------------------------
1.275 +//
1.276 +EXPORT_C TDesC* TToneData::GetDTMFString()
1.277 + {
1.278 + DP_CONTEXT(TToneData::GetDTMFString *CD1*, CtxDevSound, DPLOCAL);
1.279 + DP_IN();
1.280 + DP_OUT();
1.281 + return iDTMFString;
1.282 + }