1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Mda\Common\MmfAudio.h
18 #ifndef __MMF_COMMON_AUDIO_H__
19 #define __MMF_COMMON_AUDIO_H__
21 // Standard EPOC32 includes
24 // Public Media Server includes
26 #include <mmf/common/mmfbase.h>
27 #include <mmf/common/mmfutilities.h>
33 Audio Loading started event. Use by a controller to signal to a
34 client that audio loading has begun.
38 const TUid KMMFEventCategoryAudioLoadingStarted = {0x101F8002};
44 Audio Loading completed event. Use by a controller to signal to a
45 client that audio loading has completed.
49 const TUid KMMFEventCategoryAudioLoadingComplete = {0x101F8003};
55 The class defining a callback interface for receiving loading notifications.
59 class MAudioLoadingObserver
64 Audio Loading/rebuffering has begun
68 virtual void MaloLoadingStarted() = 0;
70 Audio Loading/rebuffering has completed
74 virtual void MaloLoadingComplete() = 0;
82 An interface to a set of audio player callback functions.
84 The class is a mixin and is intended to be inherited by the client
85 class which is waiting for the audio resource. The functions
86 encapsulated by this class are called when specific events occur in
87 the process of resource availablity. A reference to this object is
88 passed as a parameter when registering for notification by
92 class MMMFAudioResourceNotificationCallback
97 Called when the audio resource becomes available but
98 only if the resource was previously unavailable (e.g. if
99 the audio resource is available when the client registers,
100 then this callback is not received).
102 @param aNotificationEventId
103 The UID of the event that is being handled.
104 @param aNotificationData
105 The data that corresponds to the notification event.
107 virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData) = 0;
115 A class used when sending custom commands from the client API
116 to the audio controller to get or set the audio configuration
118 class TMMFAudioConfig
121 inline TMMFAudioConfig();
126 inline void SetReturnSize(TInt aReturnSize);
128 // Audio device command parameters
131 The volume setting. This can be any value from zero to iMaxVolume
135 The maximum volume setting of the audio device.
137 This value is platform dependent but is always greater than or equal to one. This is the
138 maximum value that should be passed to iVolume.
143 The balance between left and right stereo channels. Must be between -100 and 100
148 The gain of the audio device. This can be any value from zero to iMaxGain
153 The maximum gain of the audio device.
158 If true, the audio clip is cropped from the current position to the end and the remainder of the clip
159 is discarded. If false, the audio clip is cropped from the start of the file to the current position.
160 The audio data prior to the current position is discarded.
165 The number of channels of the audio device (signifying mono/stereo).
170 The sample rate of the audio device.
175 The format UID to be used.
180 The source data codec type.
182 TFourCC iSourceDataTypeCode;
185 The sink data codec type.
187 TFourCC iSinkDataTypeCode;
190 The start position for audio playback in micro seconds.
192 TTimeIntervalMicroSeconds iStartPosition ;
195 The end position for audio playback in micro seconds.
197 TTimeIntervalMicroSeconds iEndPosition ;
200 The period over which the volume is to rise.
202 A zero value causes the tone sample to be played at the normal level for the full
203 duration of the playback. A value which is longer than the duration
204 of the audio sample means that the sample never reaches its normal volume level.
206 Supported only during tone playing.
208 TTimeIntervalMicroSeconds iRampDuration ;
211 The recordable time available to the audio device.
213 This value may be the estimated time available.
215 TTimeIntervalMicroSeconds iRecordTimeAvailable ;
218 The maximum duration of the recorded clip, in microseconds
220 TTimeIntervalMicroSeconds iMaxDuration ;
223 The maximum size of the recorded clip, in bytes.
228 The current state of the audio device.
233 The current completion status of loading/rebuffering.
235 TInt iLoadingCompletePercentage;
240 Specifies the maximum buffer length that can be passed with notification request
242 KNotificationDataBufferSize=256
245 The notification event to register for the client.
249 The notification data from the client.
251 TBufC8<KNotificationDataBufferSize> iNotificationRegistrationData;
253 The notification data for the client.
255 TBuf8<KNotificationDataBufferSize> iNotificationData;
258 This member is internal and not intended for use.
266 Initialises the object with arbitrary values.
268 inline TMMFAudioConfig::TMMFAudioConfig() {};
275 A class used when sending custom commands from the client API
276 to the audio controller to set repeats
278 class TMMFAudioSetRepeatsConfig
281 IMPORT_C TMMFAudioSetRepeatsConfig();
286 The number of times the audio sample, together with the trailing silence, is to be repeated.
287 If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is
288 repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample
289 is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever).
291 TInt iRepeatNumberOfTimes;
294 The time interval of the training silence.
296 TTimeIntervalMicroSeconds iTrailingSilence;
300 This member is internal and not intended for use.