os/mm/mmlibs/mmfw/inc/mmf/common/MmfAudio.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Mda\Common\MmfAudio.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __MMF_COMMON_AUDIO_H__
sl@0
    19
#define __MMF_COMMON_AUDIO_H__
sl@0
    20
sl@0
    21
// Standard EPOC32 includes
sl@0
    22
#include <e32base.h>
sl@0
    23
sl@0
    24
// Public Media Server includes
sl@0
    25
sl@0
    26
#include <mmf/common/mmfbase.h>
sl@0
    27
#include <mmf/common/mmfutilities.h>
sl@0
    28
sl@0
    29
/**
sl@0
    30
@publishedAll
sl@0
    31
@released
sl@0
    32
sl@0
    33
Audio Loading started event. Use by a controller to signal to a
sl@0
    34
client that audio loading has begun.
sl@0
    35
sl@0
    36
@since 7.0s
sl@0
    37
*/
sl@0
    38
const TUid KMMFEventCategoryAudioLoadingStarted = {0x101F8002};
sl@0
    39
sl@0
    40
/**
sl@0
    41
@publishedAll
sl@0
    42
@released
sl@0
    43
sl@0
    44
Audio Loading completed event. Use by a controller to signal to a
sl@0
    45
client that audio loading has completed.
sl@0
    46
sl@0
    47
@since 7.0s
sl@0
    48
*/
sl@0
    49
const TUid KMMFEventCategoryAudioLoadingComplete = {0x101F8003};
sl@0
    50
sl@0
    51
/**
sl@0
    52
@publishedAll
sl@0
    53
@released
sl@0
    54
sl@0
    55
The class defining a callback interface for receiving loading notifications.
sl@0
    56
sl@0
    57
since 7.0s
sl@0
    58
*/
sl@0
    59
class MAudioLoadingObserver
sl@0
    60
	{
sl@0
    61
public:
sl@0
    62
sl@0
    63
	/*
sl@0
    64
	Audio Loading/rebuffering has begun
sl@0
    65
sl@0
    66
	@since 7.0s
sl@0
    67
	*/
sl@0
    68
	virtual void MaloLoadingStarted() = 0;
sl@0
    69
	/*
sl@0
    70
	Audio Loading/rebuffering has completed
sl@0
    71
sl@0
    72
	@since 7.0s
sl@0
    73
	 */
sl@0
    74
	virtual void MaloLoadingComplete() = 0;
sl@0
    75
	};
sl@0
    76
sl@0
    77
sl@0
    78
/**
sl@0
    79
@publishedAll
sl@0
    80
@released
sl@0
    81
sl@0
    82
An interface to a set of audio player callback functions.
sl@0
    83
sl@0
    84
The class is a mixin and is intended to be inherited by the client
sl@0
    85
class which is waiting for the audio resource. The functions
sl@0
    86
encapsulated by this class are called when specific events occur in
sl@0
    87
the process of resource availablity. A reference to this object is
sl@0
    88
passed as a parameter when registering for notification by 
sl@0
    89
the audio player.
sl@0
    90
sl@0
    91
*/
sl@0
    92
class MMMFAudioResourceNotificationCallback
sl@0
    93
	{
sl@0
    94
public:
sl@0
    95
sl@0
    96
	/**
sl@0
    97
	Called when the audio resource becomes available but
sl@0
    98
	only if the resource was previously unavailable (e.g. if
sl@0
    99
	the audio resource is available when the client registers,
sl@0
   100
	then this callback is not received).
sl@0
   101
sl@0
   102
	@param  aNotificationEventId
sl@0
   103
	        The UID of the event that is being handled.
sl@0
   104
	@param  aNotificationData
sl@0
   105
	        The data that corresponds to the notification event.
sl@0
   106
	*/
sl@0
   107
	virtual void MarncResourceAvailable(TUid aNotificationEventId, const TDesC8& aNotificationData) = 0;
sl@0
   108
	
sl@0
   109
	};
sl@0
   110
sl@0
   111
/**
sl@0
   112
@publishedAll
sl@0
   113
@released
sl@0
   114
sl@0
   115
A class used when sending custom commands from the client API
sl@0
   116
to the audio controller to get or set the audio configuration
sl@0
   117
*/
sl@0
   118
class TMMFAudioConfig
sl@0
   119
	{
sl@0
   120
public:
sl@0
   121
	inline TMMFAudioConfig();
sl@0
   122
sl@0
   123
	/**
sl@0
   124
    Not implemented.
sl@0
   125
	*/
sl@0
   126
	inline void SetReturnSize(TInt aReturnSize);
sl@0
   127
public:
sl@0
   128
	// Audio device command parameters
sl@0
   129
sl@0
   130
	/**
sl@0
   131
	 The volume setting. This can be any value from zero to iMaxVolume
sl@0
   132
	*/
sl@0
   133
	TInt iVolume;
sl@0
   134
	/**
sl@0
   135
	The maximum volume setting of the audio device.
sl@0
   136
sl@0
   137
	This value is platform dependent but is always greater than or equal to one. This is the 
sl@0
   138
	maximum value that should be passed to iVolume.
sl@0
   139
	*/
sl@0
   140
	TInt iMaxVolume;
sl@0
   141
sl@0
   142
	/**
sl@0
   143
	The balance between left and right stereo channels. Must be between -100 and 100
sl@0
   144
	*/
sl@0
   145
	TInt iBalance;
sl@0
   146
sl@0
   147
	/**
sl@0
   148
	The gain of the audio device. This can be any value from zero to iMaxGain
sl@0
   149
	*/
sl@0
   150
	TInt iGain;
sl@0
   151
sl@0
   152
	/**
sl@0
   153
	The maximum gain of the audio device.
sl@0
   154
	*/
sl@0
   155
	TInt iMaxGain;
sl@0
   156
sl@0
   157
	/**
sl@0
   158
	If true, the audio clip is cropped from the current position to the end and the remainder of the clip 
sl@0
   159
	is discarded. If false, the audio clip is cropped from the start of the file to the current position. 
sl@0
   160
	The audio data prior to the current position is discarded.
sl@0
   161
	*/
sl@0
   162
	TBool iCropToEnd ;
sl@0
   163
sl@0
   164
	/**
sl@0
   165
	The number of channels of the audio device (signifying mono/stereo).
sl@0
   166
	*/
sl@0
   167
	TUint iChannels;
sl@0
   168
sl@0
   169
	/**
sl@0
   170
	The sample rate of the audio device.
sl@0
   171
	*/
sl@0
   172
	TUint iSampleRate;
sl@0
   173
sl@0
   174
	/**
sl@0
   175
	The format UID to be used.
sl@0
   176
	*/
sl@0
   177
	TUid iFormatUid;
sl@0
   178
sl@0
   179
	/**
sl@0
   180
	The source data codec type.
sl@0
   181
	*/
sl@0
   182
	TFourCC iSourceDataTypeCode;
sl@0
   183
sl@0
   184
	/**
sl@0
   185
	The sink data codec type.
sl@0
   186
	*/
sl@0
   187
	TFourCC iSinkDataTypeCode;
sl@0
   188
sl@0
   189
	/**
sl@0
   190
	The start position for audio playback in micro seconds.
sl@0
   191
	*/
sl@0
   192
	TTimeIntervalMicroSeconds iStartPosition ;
sl@0
   193
sl@0
   194
	/**
sl@0
   195
	The end position for audio playback in micro seconds.
sl@0
   196
	*/
sl@0
   197
	TTimeIntervalMicroSeconds iEndPosition ;
sl@0
   198
sl@0
   199
	/**
sl@0
   200
	The period over which the volume is to rise. 
sl@0
   201
sl@0
   202
	A zero value causes the tone sample to be played at the normal level for the full
sl@0
   203
	duration of the playback. A value which is longer than the duration
sl@0
   204
	of the audio sample means that the sample never reaches its normal volume level.
sl@0
   205
sl@0
   206
	Supported only during tone playing.
sl@0
   207
	*/
sl@0
   208
	TTimeIntervalMicroSeconds iRampDuration ;
sl@0
   209
sl@0
   210
	/**
sl@0
   211
	The recordable time available to the audio device.
sl@0
   212
sl@0
   213
	This value may be the estimated time available.
sl@0
   214
	*/
sl@0
   215
	TTimeIntervalMicroSeconds iRecordTimeAvailable ;
sl@0
   216
sl@0
   217
	/**
sl@0
   218
	The maximum duration of the recorded clip, in microseconds
sl@0
   219
	*/
sl@0
   220
	TTimeIntervalMicroSeconds iMaxDuration ;
sl@0
   221
sl@0
   222
	/**
sl@0
   223
	The maximum size of the recorded clip, in bytes.
sl@0
   224
	*/
sl@0
   225
	TInt iMaxFileSize ;
sl@0
   226
sl@0
   227
	/**
sl@0
   228
	The current state of the audio device.
sl@0
   229
	*/
sl@0
   230
	TInt iState ;
sl@0
   231
sl@0
   232
	/**
sl@0
   233
	The current completion status of loading/rebuffering.
sl@0
   234
	*/
sl@0
   235
	TInt iLoadingCompletePercentage;
sl@0
   236
sl@0
   237
	enum
sl@0
   238
		{
sl@0
   239
		/**
sl@0
   240
		Specifies the maximum buffer length that can be passed with notification request
sl@0
   241
		*/
sl@0
   242
		KNotificationDataBufferSize=256
sl@0
   243
		};
sl@0
   244
	/**
sl@0
   245
	The notification event to register for the client.
sl@0
   246
	*/
sl@0
   247
	TUid iEventType;
sl@0
   248
	/**
sl@0
   249
	The notification data from the client.
sl@0
   250
	*/
sl@0
   251
	TBufC8<KNotificationDataBufferSize> iNotificationRegistrationData;
sl@0
   252
	/**
sl@0
   253
	The notification data for the client.
sl@0
   254
	*/
sl@0
   255
	TBuf8<KNotificationDataBufferSize> iNotificationData;
sl@0
   256
private:
sl@0
   257
	/**
sl@0
   258
	This member is internal and not intended for use.
sl@0
   259
	*/
sl@0
   260
	TInt iReserved1;
sl@0
   261
	TInt iReserved2;
sl@0
   262
	TInt iReserved3;
sl@0
   263
	};
sl@0
   264
sl@0
   265
/**
sl@0
   266
Initialises the object with arbitrary values.
sl@0
   267
*/
sl@0
   268
inline TMMFAudioConfig::TMMFAudioConfig() {};
sl@0
   269
sl@0
   270
sl@0
   271
/*
sl@0
   272
@publishedAll
sl@0
   273
@released
sl@0
   274
sl@0
   275
A class used when sending custom commands from the client API
sl@0
   276
to the audio controller to set repeats
sl@0
   277
*/
sl@0
   278
class TMMFAudioSetRepeatsConfig
sl@0
   279
	{
sl@0
   280
public:
sl@0
   281
	IMPORT_C TMMFAudioSetRepeatsConfig();
sl@0
   282
sl@0
   283
public:
sl@0
   284
	
sl@0
   285
	/**
sl@0
   286
    The number of times the audio sample, together with the trailing silence, is to be repeated. 
sl@0
   287
    If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is
sl@0
   288
    repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample
sl@0
   289
    is not repeated. The behaviour is undefined for negative values (other than KMdaRepeatForever).
sl@0
   290
	*/
sl@0
   291
	TInt iRepeatNumberOfTimes;
sl@0
   292
	
sl@0
   293
	/**
sl@0
   294
	The time interval of the training silence.
sl@0
   295
	*/	
sl@0
   296
	TTimeIntervalMicroSeconds iTrailingSilence;
sl@0
   297
	
sl@0
   298
private:
sl@0
   299
	/**
sl@0
   300
	This member is internal and not intended for use.
sl@0
   301
	*/
sl@0
   302
	TInt iReserved1;
sl@0
   303
	};
sl@0
   304
sl@0
   305
#endif