1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3facf/inc/a3fbase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,239 @@
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 +
1.28 +#ifndef A3FBASE_H
1.29 +#define A3FBASE_H
1.30 +
1.31 +#include <e32base.h>
1.32 +
1.33 +/**
1.34 +* Provides the process id of the original application.
1.35 +*/
1.36 +class TClientContextSettings
1.37 + {
1.38 +public:
1.39 + /**
1.40 + * Application Process Id.
1.41 + */
1.42 + TProcessId iProcessId;
1.43 + };
1.44 +
1.45 +
1.46 +/**
1.47 +* States of a stream.
1.48 +*/
1.49 +enum TAudioState
1.50 + {
1.51 + /**Uninitialized state */
1.52 + EUninitialized = 0,
1.53 + /**Initialized state */
1.54 + EInitialized,
1.55 + /**Idle state */
1.56 + EIdle,
1.57 + /**Primed state */
1.58 + EPrimed,
1.59 + /**Active state */
1.60 + EActive,
1.61 + /**Dead state */
1.62 + EDead
1.63 + };
1.64 +
1.65 +/**
1.66 +* Audio type of a stream.
1.67 +*/
1.68 +class TAudioTypeSettings
1.69 + {
1.70 +public:
1.71 + /**
1.72 + * Priority of client.
1.73 + */
1.74 + TInt iPriority;
1.75 +
1.76 + /**
1.77 + * The priority preference of client.
1.78 + */
1.79 + TInt iPref;
1.80 + };
1.81 +
1.82 +
1.83 +/**
1.84 +* Mode setting available.
1.85 +*
1.86 +* "Mode" in this context refers to the number of channels (i.e. mono or stereo).
1.87 +* The modes are given as UIDs.
1.88 +*
1.89 +*/
1.90 +
1.91 +/** Mono data */
1.92 +const TInt KA3FModeMonoValue = 0x1028348D;
1.93 +const TUid KA3FModeMono = {KA3FModeMonoValue};
1.94 +/** Stereo data, non-interleaved */
1.95 +const TInt KA3FModeStereoNonInterleavedValue = 0x1028348E;
1.96 +const TUid KA3FModeStereoNonInterleaved = {KA3FModeStereoNonInterleavedValue};
1.97 +/** Interleaved Stereo data */
1.98 +const TInt KA3FModeStereoInterleavedValue = 0x1028348F;
1.99 +const TUid KA3FModeStereoInterleaved = {KA3FModeStereoInterleavedValue};
1.100 +/** 5.1 encoded data */
1.101 +const TInt KA3FMode51Value = 0x10283490;
1.102 +const TUid KA3FMode51 = {KA3FMode51Value};
1.103 +
1.104 +
1.105 +/**
1.106 +* Type class for audio channel.
1.107 +*/
1.108 +class TAudioChannelGain
1.109 + {
1.110 +public:
1.111 + /**
1.112 + * Location of the channel in degrees on a circle located on the same plane as the listener,
1.113 + * with listener in the center of the circle.
1.114 + * Negative values are used for channels the location of which is not important.
1.115 + */
1.116 + TInt iLocation;
1.117 +
1.118 + /**
1.119 + * Absolute gain value of channel.
1.120 + * Allowed values are 0 - MaxGain().
1.121 + */
1.122 + TInt iGain;
1.123 +
1.124 + /**
1.125 + * Mapping of common channels to location degrees.
1.126 + */
1.127 + enum TStandardChannels
1.128 + {
1.129 + /** Low Frequency Effects Channels */
1.130 + ELowFrequencyEffects = -1,
1.131 + /** Center Channels*/
1.132 + ECenter = 0,
1.133 + /** Right Channels */
1.134 + ERight = 45,
1.135 + /** Right Surround Channels */
1.136 + ERightSurround = 90,
1.137 + /** Right Rear Channels */
1.138 + ERightRear = 135,
1.139 + /** Rear Surround Channels */
1.140 + ERearSurround = 180,
1.141 + /** Left Rear Channels */
1.142 + ELeftRear = 225,
1.143 + /** Left Surround Channels */
1.144 + ELeftSurround = 270,
1.145 + /** Left Channels */
1.146 + ELeft = 315
1.147 + };
1.148 + };
1.149 +
1.150 +
1.151 +/**
1.152 +* KGainSawTooth – an explicit 0->aGain sweep, rising linearly.
1.153 +* If the channel is active, the effective gain drops to 0 ASAP after the request.
1.154 +* If used when the stream is not in EActive state, this acts as fade-in during the subsequent Activate() transistion.
1.155 +*/
1.156 +const TInt KUidGainSawToothValue = 0x10285CDC;
1.157 +const TUid KUidGainSawTooth = {KUidGainSawToothValue};
1.158 +
1.159 +/**
1.160 +* KGainFadeOut – drop from current to 0,
1.161 +* dropping linearly over aRampDuration period.
1.162 +*/
1.163 +const TInt KUidGainFadeOutValue = 0x10285CDD;
1.164 +const TUid KUidGainFadeOut = {KUidGainFadeOutValue};
1.165 +
1.166 +/**
1.167 +* KGainRamped – (gradual) change from current gain values to those given in aGain over aRampDuration period
1.168 +*/
1.169 +const TInt KUidGainRampedValue = 0x10285CDE;
1.170 +const TUid KUidGainRamped = {KUidGainRampedValue};
1.171 +
1.172 +/**
1.173 +* KGainContinue – if a previous ramped operation is in progress,
1.174 +* this continues but the concept of “target gain” is updated
1.175 +* using the new values. aRampDuration is ignored
1.176 +* – the previous ramp duration is reused, minus the time already spent ramping.
1.177 +* The smoothness of this operation will depend on the implementation.
1.178 +* If no ramped operation is in progress, this is the same as KNullUid.
1.179 +* This is intended as a way of changing gain values without stopping an ongoing ramp operation.
1.180 +*/
1.181 +const TInt KUidGainContinueValue = 0x10285CDF;
1.182 +const TUid KUidGainContinue = {KUidGainContinueValue};
1.183 +
1.184 +
1.185 +const TInt KErrA3fUnsupportedRamp = (-12250);
1.186 +
1.187 +/**
1.188 + * Represents an unique Id for a specific context at runtime.
1.189 + */
1.190 +class TAudioContextId : public TObjectId
1.191 + {
1.192 +public:
1.193 + /**
1.194 + *Default constructor.
1.195 + */
1.196 + TAudioContextId() {}
1.197 +
1.198 + /**
1.199 + *Unique Id for a specific context at runtime.
1.200 + *@param aId Unique id to be set.
1.201 + */
1.202 + inline TAudioContextId(TUint64 aId) : TObjectId(aId) {}
1.203 + };
1.204 +
1.205 +/**
1.206 + * Represents an unique Id for a specific audio processing unit at runtime.
1.207 + */
1.208 +class TAudioComponentId : public TObjectId
1.209 + {
1.210 + public:
1.211 + /**
1.212 + * Default constructor.
1.213 + */
1.214 + TAudioComponentId() {}
1.215 +
1.216 + /**
1.217 + *Unique Id for a specific audio processing unit at runtime.
1.218 + *@param aId Unique id to be set.
1.219 + */
1.220 + inline TAudioComponentId(TUint64 aId) : TObjectId(aId) {}
1.221 + };
1.222 +
1.223 +/**
1.224 + * Represents an unique Id for a specific audio stream unit at runtime.
1.225 + */
1.226 +class TAudioStreamId : public TObjectId
1.227 + {
1.228 + public:
1.229 + /**
1.230 + * Default constructor.
1.231 + */
1.232 + TAudioStreamId() {}
1.233 +
1.234 + /**
1.235 + *Unique Id for a specific stream at runtime.
1.236 + *@param aId Unique id to be set.
1.237 + */
1.238 + inline TAudioStreamId(TUint64 aId) : TObjectId(aId) {}
1.239 + };
1.240 +
1.241 +
1.242 +#endif // A3FBASE_H