mmhais/refacladapt/src/tonehwdevice/ToneGenerator.h
author hgs
Wed, 13 Oct 2010 12:08:48 +0100
changeset 3 28bdc4aca325
parent 0 79dd3e2336a0
permissions -rw-r--r--
2010wk42_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     2
// All rights reserved.
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     7
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     8
// Initial Contributors:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    10
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    11
// Contributors:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    12
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    13
// Description:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    14
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    15
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    16
#ifndef __TONEGENERATOR_H__
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    17
#define __TONEGENERATOR_H__
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    18
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    19
#include <e32base.h>
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    20
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    21
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    22
// Sine tone generator
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    23
// 
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    24
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    25
const TInt KMaxSineTable = 256;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    26
const TUint KToneBufferSize = 8192;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    27
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    28
// one second in microseconds
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    29
const TInt KOneMillionMicroSeconds = 1000000;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    30
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    31
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    32
class TSineGen
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    33
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    34
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    35
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    36
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    37
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    38
	void SetFrequency(TInt aFrequency,TInt aAmplitude);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    39
	TInt NextSample();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    40
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    41
	TUint iPosition;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    42
	TUint iStep;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    43
	TInt iAmplitude;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    44
	static const TInt16 SineTable[KMaxSineTable];
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    45
	static const TInt16 IncTable[KMaxSineTable];
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    46
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    47
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    48
class TSineWave
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    49
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    50
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    51
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    52
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    53
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    54
	void Generate(TInt16* aDest,TInt aCount);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    55
	void SetFrequency(TInt aFrequency,TInt aAmplitude);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    56
	void SetFrequency(TInt aFrequency1,TInt aAmplitude1,TInt aFrequency2,TInt aAmplitude2);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    57
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    58
	TSineGen iGen1;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    59
	TSineGen iGen2;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    60
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    61
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    62
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    63
// Tone synthesis interface
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    64
// Defines the abstract interface for tone synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    65
// Capable of filling buffers with audio data
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    66
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    67
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    68
class MMdaToneSynthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    69
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    70
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    71
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    72
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    73
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    74
	// Allocate necessary resources for this kind of synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    75
	virtual void Configure(TInt aRate, TInt aChannels, TInt aRepeats, TInt aSilence, TInt aRampUp)=0;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    76
	// Begin generating data from start again
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    77
	virtual void Reset()=0;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    78
	// Fill supplied buffer with next block of 16bit PCM audio data
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    79
	virtual TInt FillBuffer(TDes8& aBuffer)=0;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    80
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    81
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    82
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    83
// Tone generator base class
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    84
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    85
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    86
class TMdaToneGenerator : public MMdaToneSynthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    87
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    88
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    89
	virtual void Configure(TInt aRate, TInt aChannels, TInt aRepeats, TInt aSilence, TInt aRampUp);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    90
	virtual TInt FillBuffer(TDes8& aBuffer);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    91
protected:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    92
	virtual TInt GetNextTone()=0;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    93
	//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    94
	TInt DurationToSamples(const TTimeIntervalMicroSeconds& aDuration);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    95
protected:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    96
	TSineWave iSineWave;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    97
	TInt iRate;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    98
	TInt iChannels;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
    99
	TInt iSamplesLeft;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   100
	TInt iTrailingSilence;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   101
	TBool iRampUp;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   102
	TBool iRampDown;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   103
	TBool iIncompleteRampDown;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   104
	TBool iIncompleteRampUp;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   105
	TInt iIncompleteVolume;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   106
	TInt iRampUpRemainder;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   107
	TInt iRepeats;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   108
	TInt iSilenceBetweenRepeats;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   109
	TBool iAfterRepeatSilence;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   110
	TInt iRampUpCount;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   111
	TInt iRampUpLeft;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   112
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   113
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   114
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   115
// Simple tone synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   116
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   117
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   118
class TMdaSimpleToneGenerator : public TMdaToneGenerator
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   119
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   120
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   121
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   122
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   123
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   124
	void SetFrequencyAndDuration(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   125
	virtual void Reset();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   126
	virtual TInt GetNextTone();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   127
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   128
	TTimeIntervalMicroSeconds iDuration;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   129
	TInt iFrequency;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   130
	TBool iPlayed;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   131
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   132
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   133
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   134
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   135
 * Dual tone synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   136
 * Generates a tone consisting of two sine waves of different 
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   137
 * frequencies summed together.
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   138
 * 
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   139
 * @internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   140
 */
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   141
class TMdaDualToneGenerator : public TMdaToneGenerator
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   142
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   143
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   144
	void SetFrequencyAndDuration(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   145
	virtual void Reset();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   146
	virtual TInt GetNextTone();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   147
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   148
	TTimeIntervalMicroSeconds iDuration;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   149
	TInt iFrequencyOne;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   150
	TInt iFrequencyTwo;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   151
	TBool iPlayed;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   152
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   153
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   154
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   155
// DTMF tone synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   156
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   157
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   158
class TMdaDTMFGenerator : public TMdaToneGenerator
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   159
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   160
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   161
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   162
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   163
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   164
	virtual void Reset();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   165
	void SetToneDurations(	const TTimeIntervalMicroSeconds32 aOn,
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   166
							const TTimeIntervalMicroSeconds32 aOff,
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   167
							const TTimeIntervalMicroSeconds32 aPause);
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   168
	void SetString(const TDesC& aDTMFString); 
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   169
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   170
	virtual TInt GetNextTone();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   171
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   172
	const TDesC* iDTMFString;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   173
	TTimeIntervalMicroSeconds32 iOn;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   174
	TTimeIntervalMicroSeconds32 iOff;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   175
	TTimeIntervalMicroSeconds32 iPause;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   176
	TInt iOnSamples;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   177
	TInt iOffSamples;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   178
	TInt iPauseSamples;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   179
	TInt iChar;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   180
	TBool iPlayToneOff;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   181
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   182
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   183
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   184
// Tone sequence synthesis
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   185
//
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   186
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   187
const TInt KMaxSequenceStack = 6;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   188
class TMdaSequenceGenerator : public TMdaToneGenerator
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   189
/**
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   190
*@internalTechnology
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   191
*/
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   192
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   193
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   194
	virtual void Reset();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   195
	void SetSequenceData(const TDesC8& aSequenceData); 
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   196
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   197
	virtual TInt GetNextTone();
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   198
private:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   199
	const TDesC8* iSequenceData;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   200
	const TInt16* iInstructionPtr;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   201
	const TInt16* iLastInstruction;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   202
	TInt iStack[KMaxSequenceStack];
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   203
	TInt iStackIndex;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   204
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   205
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   206
const TInt KBufferLength = 0x1000;
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   207
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   208
// Public Media Server includes
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   209
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   210
class TMdaPtr8 : public TPtr8 //needed for this WINS Impl of Tone Gen
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   211
	{
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   212
public:
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   213
	TMdaPtr8()
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   214
		: TPtr8(0,0,0) {};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   215
	inline void Set(const TDes8& aDes)
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   216
		{ TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.MaxLength()); };
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   217
	inline void SetLengthOnly(const TDes8& aDes)
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   218
		{ TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.Length()); };
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   219
	inline void Set(const TPtrC8& aDes)
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   220
		{ TPtr8::Set((TUint8*)(aDes.Ptr()),aDes.Length(),aDes.Length()); };
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   221
	inline void Shift(TInt aOffset)
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   222
		{ SetLength(Length()-aOffset); iMaxLength-=aOffset; iPtr+=aOffset; };
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   223
	};
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   224
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   225
79dd3e2336a0 2010wk36_01
hgs
parents:
diff changeset
   226
#endif