1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/inc/mmf/common/MmfAudio.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,305 @@
1.4 +// Copyright (c) 2002-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 +// Mda\Common\MmfAudio.h
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __MMF_COMMON_AUDIO_H__
1.22 +#define __MMF_COMMON_AUDIO_H__
1.23 +
1.24 +// Standard EPOC32 includes
1.25 +#include <e32base.h>
1.26 +
1.27 +// Public Media Server includes
1.28 +
1.29 +#include <mmf/common/mmfbase.h>
1.30 +#include <mmf/common/mmfutilities.h>
1.31 +
1.32 +/**
1.33 +@publishedAll
1.34 +@released
1.35 +
1.36 +Audio Loading started event. Use by a controller to signal to a
1.37 +client that audio loading has begun.
1.38 +
1.39 +@since 7.0s
1.40 +*/
1.41 +const TUid KMMFEventCategoryAudioLoadingStarted = {0x101F8002};
1.42 +
1.43 +/**
1.44 +@publishedAll
1.45 +@released
1.46 +
1.47 +Audio Loading completed event. Use by a controller to signal to a
1.48 +client that audio loading has completed.
1.49 +
1.50 +@since 7.0s
1.51 +*/
1.52 +const TUid KMMFEventCategoryAudioLoadingComplete = {0x101F8003};
1.53 +
1.54 +/**
1.55 +@publishedAll
1.56 +@released
1.57 +
1.58 +The class defining a callback interface for receiving loading notifications.
1.59 +
1.60 +since 7.0s
1.61 +*/
1.62 +class MAudioLoadingObserver
1.63 + {
1.64 +public:
1.65 +
1.66 + /*
1.67 + Audio Loading/rebuffering has begun
1.68 +
1.69 + @since 7.0s
1.70 + */
1.71 + virtual void MaloLoadingStarted() = 0;
1.72 + /*
1.73 + Audio Loading/rebuffering has completed
1.74 +
1.75 + @since 7.0s
1.76 + */
1.77 + virtual void MaloLoadingComplete() = 0;
1.78 + };
1.79 +
1.80 +
1.81 +/**
1.82 +@publishedAll
1.83 +@released
1.84 +
1.85 +An interface to a set of audio player callback functions.
1.86 +
1.87 +The class is a mixin and is intended to be inherited by the client
1.88 +class which is waiting for the audio resource. The functions
1.89 +encapsulated by this class are called when specific events occur in
1.90 +the process of resource availablity. A reference to this object is
1.91 +passed as a parameter when registering for notification by
1.92 +the audio player.
1.93 +
1.94 +*/
1.95 +class MMMFAudioResourceNotificationCallback
1.96 + {
1.97 +public:
1.98 +
1.99 + /**
1.100 + Called when the audio resource becomes available but
1.101 + only if the resource was previously unavailable (e.g. if
1.102 + the audio resource is available when the client registers,
1.103 + then this callback is not received).
1.104 +
1.105 + @param aNotificationEventId
1.106 + The UID of the event that is being handled.
1.107 + @param aNotificationData
1.108 + The data that corresponds to the notification event.
1.109 + */
1.110 + virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData) = 0;
1.111 +
1.112 + };
1.113 +
1.114 +/**
1.115 +@publishedAll
1.116 +@released
1.117 +
1.118 +A class used when sending custom commands from the client API
1.119 +to the audio controller to get or set the audio configuration
1.120 +*/
1.121 +class TMMFAudioConfig
1.122 + {
1.123 +public:
1.124 + inline TMMFAudioConfig();
1.125 +
1.126 + /**
1.127 + Not implemented.
1.128 + */
1.129 + inline void SetReturnSize(TInt aReturnSize);
1.130 +public:
1.131 + // Audio device command parameters
1.132 +
1.133 + /**
1.134 + The volume setting. This can be any value from zero to iMaxVolume
1.135 + */
1.136 + TInt iVolume;
1.137 + /**
1.138 + The maximum volume setting of the audio device.
1.139 +
1.140 + This value is platform dependent but is always greater than or equal to one. This is the
1.141 + maximum value that should be passed to iVolume.
1.142 + */
1.143 + TInt iMaxVolume;
1.144 +
1.145 + /**
1.146 + The balance between left and right stereo channels. Must be between -100 and 100
1.147 + */
1.148 + TInt iBalance;
1.149 +
1.150 + /**
1.151 + The gain of the audio device. This can be any value from zero to iMaxGain
1.152 + */
1.153 + TInt iGain;
1.154 +
1.155 + /**
1.156 + The maximum gain of the audio device.
1.157 + */
1.158 + TInt iMaxGain;
1.159 +
1.160 + /**
1.161 + If true, the audio clip is cropped from the current position to the end and the remainder of the clip
1.162 + is discarded. If false, the audio clip is cropped from the start of the file to the current position.
1.163 + The audio data prior to the current position is discarded.
1.164 + */
1.165 + TBool iCropToEnd ;
1.166 +
1.167 + /**
1.168 + The number of channels of the audio device (signifying mono/stereo).
1.169 + */
1.170 + TUint iChannels;
1.171 +
1.172 + /**
1.173 + The sample rate of the audio device.
1.174 + */
1.175 + TUint iSampleRate;
1.176 +
1.177 + /**
1.178 + The format UID to be used.
1.179 + */
1.180 + TUid iFormatUid;
1.181 +
1.182 + /**
1.183 + The source data codec type.
1.184 + */
1.185 + TFourCC iSourceDataTypeCode;
1.186 +
1.187 + /**
1.188 + The sink data codec type.
1.189 + */
1.190 + TFourCC iSinkDataTypeCode;
1.191 +
1.192 + /**
1.193 + The start position for audio playback in micro seconds.
1.194 + */
1.195 + TTimeIntervalMicroSeconds iStartPosition ;
1.196 +
1.197 + /**
1.198 + The end position for audio playback in micro seconds.
1.199 + */
1.200 + TTimeIntervalMicroSeconds iEndPosition ;
1.201 +
1.202 + /**
1.203 + The period over which the volume is to rise.
1.204 +
1.205 + A zero value causes the tone sample to be played at the normal level for the full
1.206 + duration of the playback. A value which is longer than the duration
1.207 + of the audio sample means that the sample never reaches its normal volume level.
1.208 +
1.209 + Supported only during tone playing.
1.210 + */
1.211 + TTimeIntervalMicroSeconds iRampDuration ;
1.212 +
1.213 + /**
1.214 + The recordable time available to the audio device.
1.215 +
1.216 + This value may be the estimated time available.
1.217 + */
1.218 + TTimeIntervalMicroSeconds iRecordTimeAvailable ;
1.219 +
1.220 + /**
1.221 + The maximum duration of the recorded clip, in microseconds
1.222 + */
1.223 + TTimeIntervalMicroSeconds iMaxDuration ;
1.224 +
1.225 + /**
1.226 + The maximum size of the recorded clip, in bytes.
1.227 + */
1.228 + TInt iMaxFileSize ;
1.229 +
1.230 + /**
1.231 + The current state of the audio device.
1.232 + */
1.233 + TInt iState ;
1.234 +
1.235 + /**
1.236 + The current completion status of loading/rebuffering.
1.237 + */
1.238 + TInt iLoadingCompletePercentage;
1.239 +
1.240 + enum
1.241 + {
1.242 + /**
1.243 + Specifies the maximum buffer length that can be passed with notification request
1.244 + */
1.245 + KNotificationDataBufferSize=256
1.246 + };
1.247 + /**
1.248 + The notification event to register for the client.
1.249 + */
1.250 + TUid iEventType;
1.251 + /**
1.252 + The notification data from the client.
1.253 + */
1.254 + TBufC8<KNotificationDataBufferSize> iNotificationRegistrationData;
1.255 + /**
1.256 + The notification data for the client.
1.257 + */
1.258 + TBuf8<KNotificationDataBufferSize> iNotificationData;
1.259 +private:
1.260 + /**
1.261 + This member is internal and not intended for use.
1.262 + */
1.263 + TInt iReserved1;
1.264 + TInt iReserved2;
1.265 + TInt iReserved3;
1.266 + };
1.267 +
1.268 +/**
1.269 +Initialises the object with arbitrary values.
1.270 +*/
1.271 +inline TMMFAudioConfig::TMMFAudioConfig() {};
1.272 +
1.273 +
1.274 +/*
1.275 +@publishedAll
1.276 +@released
1.277 +
1.278 +A class used when sending custom commands from the client API
1.279 +to the audio controller to set repeats
1.280 +*/
1.281 +class TMMFAudioSetRepeatsConfig
1.282 + {
1.283 +public:
1.284 + IMPORT_C TMMFAudioSetRepeatsConfig();
1.285 +
1.286 +public:
1.287 +
1.288 + /**
1.289 + The number of times the audio sample, together with the trailing silence, is to be repeated.
1.290 + If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is
1.291 + repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample
1.292 + is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever).
1.293 + */
1.294 + TInt iRepeatNumberOfTimes;
1.295 +
1.296 + /**
1.297 + The time interval of the training silence.
1.298 + */
1.299 + TTimeIntervalMicroSeconds iTrailingSilence;
1.300 +
1.301 +private:
1.302 + /**
1.303 + This member is internal and not intended for use.
1.304 + */
1.305 + TInt iReserved1;
1.306 + };
1.307 +
1.308 +#endif