os/mm/mmlibs/mmfw/inc/MdaAudioSampleEditor.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
//
sl@0
    15
sl@0
    16
#ifndef MDAAUDIOSAMPLEEDITOR_H
sl@0
    17
#define MDAAUDIOSAMPLEEDITOR_H
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
#include <e32std.h>
sl@0
    22
#include <f32file.h>
sl@0
    23
#include <mmf/common/mmfbase.h>
sl@0
    24
#include <mmf/common/mmfaudio.h>
sl@0
    25
#include <mmf/common/mmfstandardcustomcommands.h>
sl@0
    26
#include <mmf/common/mmfdrmcustomcommands.h>
sl@0
    27
sl@0
    28
#include <mda/client/resource.h>
sl@0
    29
#include <mda/client/utility.h>
sl@0
    30
#include <mda/common/audio.h>
sl@0
    31
#include <mmfclntutility.h>
sl@0
    32
#include <mmf/common/mmfdurationinfocustomcommands.h>
sl@0
    33
sl@0
    34
class CMdaServer;
sl@0
    35
sl@0
    36
/**
sl@0
    37
 * @publishedAll
sl@0
    38
 * @deprecated
sl@0
    39
 *
sl@0
    40
 * Dummy class - not supported in 7.0s
sl@0
    41
 */
sl@0
    42
class CMdaAudioType : public CBase
sl@0
    43
	{
sl@0
    44
public:
sl@0
    45
	/**
sl@0
    46
    Destructor
sl@0
    47
	*/
sl@0
    48
	IMPORT_C ~CMdaAudioType();
sl@0
    49
	};
sl@0
    50
sl@0
    51
/**
sl@0
    52
@publishedAll
sl@0
    53
@released
sl@0
    54
sl@0
    55
This class is used by both the audio recorder and audio converter. This class should not be used,
sl@0
    56
other than the TState enum.
sl@0
    57
sl@0
    58
Prior to 7.0s the pure virtual functions in this class were implemented virtual functions. In 7.0s 
sl@0
    59
this changed, so now any classes derived from this one must implement the functions themselves.
sl@0
    60
sl@0
    61
@see CMdaAudioRecorderUtility
sl@0
    62
@see CMdaAudioConvertUtility
sl@0
    63
*/
sl@0
    64
class CMdaAudioClipUtility : public CBase, 
sl@0
    65
							 public MMMFClientUtility
sl@0
    66
	{
sl@0
    67
public:
sl@0
    68
	/**
sl@0
    69
	Defines the possible state of the audio data sample.
sl@0
    70
	*/
sl@0
    71
	enum TState
sl@0
    72
		{
sl@0
    73
		/** The audio clip recorder or audio converter has been constructed but no file or descriptor 
sl@0
    74
		has been opened.
sl@0
    75
		*/
sl@0
    76
		ENotReady = 0,
sl@0
    77
		/** Files or descriptors are open but no playing or recording operation is in progress.
sl@0
    78
		*/
sl@0
    79
		EOpen,
sl@0
    80
		/** Audio sample data is playing.
sl@0
    81
		*/
sl@0
    82
		EPlaying,
sl@0
    83
		/** New audio sample data is being recorded.
sl@0
    84
		*/
sl@0
    85
		ERecording
sl@0
    86
		};
sl@0
    87
sl@0
    88
public:
sl@0
    89
	/**
sl@0
    90
	@internalTechnology
sl@0
    91
sl@0
    92
	Returns the current state of the audio sample data.
sl@0
    93
sl@0
    94
	@return The state of the audio sample data.
sl@0
    95
sl@0
    96
	@since 5.0
sl@0
    97
	*/
sl@0
    98
	virtual TState State()=0;
sl@0
    99
sl@0
   100
	/**
sl@0
   101
	@internalTechnology
sl@0
   102
sl@0
   103
	Releases any currently open audio sample data.
sl@0
   104
sl@0
   105
	@since 5.0
sl@0
   106
	*/
sl@0
   107
	virtual void Close()=0;
sl@0
   108
sl@0
   109
	/**
sl@0
   110
	@internalTechnology
sl@0
   111
sl@0
   112
	Begins playback of audio sample data at the current playback position using the current volume,
sl@0
   113
	gain and priority settings.
sl@0
   114
sl@0
   115
	@since 5.0
sl@0
   116
	*/
sl@0
   117
	virtual void PlayL()=0;
sl@0
   118
sl@0
   119
	/**
sl@0
   120
	@internalTechnology
sl@0
   121
sl@0
   122
	Starts appending new audio sample data.
sl@0
   123
sl@0
   124
	The new audio sample data is appended to the existing audio sample data in the same format as
sl@0
   125
	the existing audio sample data. If existing data is to be overwritten, then it should be cropped
sl@0
   126
	to the appropriate length before appending the new data.
sl@0
   127
	
sl@0
   128
	Note, before starting to record, make sure that the gain is set by calling
sl@0
   129
	CMdaAudioRecorderUtility::SetGain(), as the initial gain is undefined. The gain might also
sl@0
   130
	have been modified by another client application.
sl@0
   131
	
sl@0
   132
	
sl@0
   133
	@since 5.0
sl@0
   134
	@see CMdaAudioRecorderUtility 
sl@0
   135
	@see CMdaAudioRecorderUtility::SetGain()
sl@0
   136
	*/
sl@0
   137
	virtual void RecordL()=0;
sl@0
   138
sl@0
   139
	/**
sl@0
   140
	@internalTechnology
sl@0
   141
	
sl@0
   142
	Stops the playback or recording operation.
sl@0
   143
	
sl@0
   144
	The operation is stopped at the current location. For a playback operation, the head is positioned at the last played data.
sl@0
   145
	
sl@0
   146
	@since 5.0
sl@0
   147
	*/
sl@0
   148
	virtual void Stop()=0;
sl@0
   149
sl@0
   150
	/**
sl@0
   151
	@internalTechnology
sl@0
   152
sl@0
   153
	Deletes all audio sample data after the current head position. The effects of the function cannot be undone.
sl@0
   154
sl@0
   155
	The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
sl@0
   156
sl@0
   157
	@since 5.0
sl@0
   158
	*/
sl@0
   159
	virtual void CropL()=0;
sl@0
   160
sl@0
   161
	/**
sl@0
   162
	@internalTechnology
sl@0
   163
	
sl@0
   164
	Sets the head position.
sl@0
   165
	
sl@0
   166
	The playback head is moved to a position which is defined in terms of a time interval measured
sl@0
   167
	from the beginning of the audio sample data. A subsequent call to PlayL() starts from
sl@0
   168
	this new position.
sl@0
   169
	
sl@0
   170
	
sl@0
   171
	@since 5.0
sl@0
   172
	*/
sl@0
   173
	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition)=0;
sl@0
   174
sl@0
   175
	/**
sl@0
   176
	@internalTechnology
sl@0
   177
	
sl@0
   178
	Returns the current head position.
sl@0
   179
	
sl@0
   180
	The head position is defined in terms of a time interval measured from the beginning of the audio sample data.
sl@0
   181
	
sl@0
   182
	@since 5.0
sl@0
   183
	*/
sl@0
   184
	virtual const TTimeIntervalMicroSeconds& Position()=0;
sl@0
   185
sl@0
   186
	/**
sl@0
   187
	@internalTechnology
sl@0
   188
sl@0
   189
	Returns the recording time available for the selected file or descriptor and encoding format.
sl@0
   190
	
sl@0
   191
	@since 5.0
sl@0
   192
	*/
sl@0
   193
	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable()=0;
sl@0
   194
sl@0
   195
	/**
sl@0
   196
	@internalTechnology
sl@0
   197
sl@0
   198
	Returns the duration of the audio sample data.
sl@0
   199
	
sl@0
   200
	@since 5.0
sl@0
   201
	*/
sl@0
   202
	virtual const TTimeIntervalMicroSeconds& Duration()=0;
sl@0
   203
sl@0
   204
	/**
sl@0
   205
	@internalTechnology
sl@0
   206
	
sl@0
   207
	Defines a window on the audio sample data.
sl@0
   208
sl@0
   209
	The window is defined in terms of a start and end position.
sl@0
   210
	When the current playback position reaches the window end position, or Stop() is called, the
sl@0
   211
	current playback position is set to the window start position and playback stops.
sl@0
   212
sl@0
   213
	The current playback position is not affected by a call to SetPlayWindow() unless it is outside
sl@0
   214
	the new playback window, in which case it is set to the window start or end position depending
sl@0
   215
	on which one is closer.
sl@0
   216
sl@0
   217
	The window persists until ClearPlayWindow() is called.
sl@0
   218
	Loading new audio sample data without adjusting or clearing the window will result in
sl@0
   219
	playback errors if the window is outside the new data.
sl@0
   220
	
sl@0
   221
	@param  aStart
sl@0
   222
	        The position defining the start of the window, measured in microseconds. If this
sl@0
   223
	        value is less than zero, it is set to zero. If this value is greater than aEnd,
sl@0
   224
	        then it is swapped with aEnd.
sl@0
   225
	@param  aEnd
sl@0
   226
	        The position defining the end of the window, measured in microseconds. If this value
sl@0
   227
	        is greater than the value returned by Duration(), it is set to the value of Duration().
sl@0
   228
	        If this value is less than aStart, then it is swapped with aStart.
sl@0
   229
	
sl@0
   230
	@since 5.0
sl@0
   231
	*/
sl@0
   232
	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd)=0;
sl@0
   233
sl@0
   234
	/**
sl@0
   235
	@internalTechnology
sl@0
   236
	
sl@0
   237
	Removes any window defined on the audio sample data.
sl@0
   238
	
sl@0
   239
	All subsequent playing, position setting and position querying requests are mapped to the whole of the audio sample data.
sl@0
   240
	
sl@0
   241
	@since 5.0
sl@0
   242
	*/
sl@0
   243
	virtual void ClearPlayWindow()=0;
sl@0
   244
sl@0
   245
	/**
sl@0
   246
	@internalTechnology
sl@0
   247
	
sl@0
   248
	Sets the number of times the audio sample is to be repeated during the PlayL() operation.
sl@0
   249
	
sl@0
   250
	A period of silence can follow each playing of the audio sample. The audio sample can be repeated
sl@0
   251
	indefinitely or until stopped.
sl@0
   252
sl@0
   253
	@param  aRepeatNumberOfTimes  
sl@0
   254
            The number of times the audio sample, together with the trailing silence, is to 
sl@0
   255
            be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with 
sl@0
   256
            the trailing silence, is repeated indefinitely. If this is set to zero, then the audio 
sl@0
   257
            sample is not repeated.
sl@0
   258
	@param  aTrailingSilence  
sl@0
   259
            The length of the trailing silence in microseconds.
sl@0
   260
sl@0
   261
	@since 5.0
sl@0
   262
	*/
sl@0
   263
	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)=0;
sl@0
   264
sl@0
   265
	/**
sl@0
   266
	@internalTechnology
sl@0
   267
	
sl@0
   268
	This function is no longer supported. It is provided for binary compatibility with previous
sl@0
   269
	releases and always leaves with KErrNotSupported.
sl@0
   270
sl@0
   271
	@return Always returns NULL.
sl@0
   272
sl@0
   273
	@since 5.0
sl@0
   274
	*/
sl@0
   275
 	virtual CMdaAudioType* TypeL();
sl@0
   276
sl@0
   277
	/**
sl@0
   278
	@internalTechnology
sl@0
   279
	
sl@0
   280
	Sets the maximum size for a file that is being recorded.
sl@0
   281
	
sl@0
   282
	When this limit is reached, MMF stops recording and notifies the client application. Notification is caused
sl@0
   283
	by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.
sl@0
   284
	
sl@0
   285
	This function is provided so that applications such as recorders can limit the amount of file storage/memory
sl@0
   286
	that should be allocated.
sl@0
   287
	
sl@0
   288
	@param aMaxWriteLength
sl@0
   289
	       The maximum file size in kilobytes. If the default value is used, there is no maximum file size.
sl@0
   290
sl@0
   291
	@since 5.0
sl@0
   292
	*/
sl@0
   293
	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone)=0;
sl@0
   294
sl@0
   295
	/**
sl@0
   296
	@internalTechnology
sl@0
   297
	
sl@0
   298
	Deletes all audio sample data from the beginning of the audio clip. The effects of the function cannot be undone.
sl@0
   299
	
sl@0
   300
	The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
sl@0
   301
	
sl@0
   302
	@since 5.0
sl@0
   303
	*/
sl@0
   304
	virtual void CropFromBeginningL()=0;
sl@0
   305
public:
sl@0
   306
	// Reserved functions - do not call - to allow virtual additional functions to be added to class
sl@0
   307
sl@0
   308
	/**
sl@0
   309
	@internalTechnology
sl@0
   310
sl@0
   311
	Reserved function
sl@0
   312
    */
sl@0
   313
	virtual void ClipUtil_Reserved3();
sl@0
   314
sl@0
   315
	/**
sl@0
   316
	@internalTechnology
sl@0
   317
	
sl@0
   318
	Reserved function
sl@0
   319
	*/
sl@0
   320
	virtual void ClipUtil_Reserved4();
sl@0
   321
	};
sl@0
   322
sl@0
   323
sl@0
   324
class CMMFMdaAudioRecorderUtility;
sl@0
   325
sl@0
   326
/**
sl@0
   327
@publishedAll
sl@0
   328
@released
sl@0
   329
sl@0
   330
Plays back, records and edits audio sample data.
sl@0
   331
sl@0
   332
The class offers an interface to play, record and edit audio sample data. This data can be supplied 
sl@0
   333
either in a file or as a descriptor. The functions that start and stop playback and recording are 
sl@0
   334
defined in the base class CMdaAudioClipUtility.
sl@0
   335
sl@0
   336
While this class is abstract, the static NewL() function constructs, initialises and returns a 
sl@0
   337
pointer to an instance of a concrete class derived from this abstract class. This concrete class 
sl@0
   338
is part of the MMF implementation and is private.
sl@0
   339
sl@0
   340
*/
sl@0
   341
class CMdaAudioRecorderUtility : public CMdaAudioClipUtility
sl@0
   342
	{
sl@0
   343
public:
sl@0
   344
	
sl@0
   345
	/**
sl@0
   346
	Device mode. Used by SetAudioDeviceMode method which is not used from 7.0s
sl@0
   347
	@since 5.0
sl@0
   348
	*/
sl@0
   349
	enum TDeviceMode
sl@0
   350
		{
sl@0
   351
		/**
sl@0
   352
		The default behaviour.
sl@0
   353
sl@0
   354
		When recording:
sl@0
   355
		If a telephony call is in progress, an attempt is made to connect to the telephony downlink
sl@0
   356
		plus the device microphone.	If there is no telephony call in progress or a connection to the
sl@0
   357
		telephony downlink fails, an attempt is made to connect to the device microphone only.
sl@0
   358
sl@0
   359
		When playing:
sl@0
   360
		If a telephony call is in progress, an attempt is made to connect to the telephony uplink.
sl@0
   361
		If there is no telephony call in progress or a connection to the telephony uplink fails, an
sl@0
   362
		attempt is made to connect to the device speaker.
sl@0
   363
        */
sl@0
   364
		EDefault = 0,
sl@0
   365
		/** See EDefault.
sl@0
   366
		*/
sl@0
   367
		ETelephonyOrLocal = EDefault,
sl@0
   368
		/** 
sl@0
   369
		When recording:
sl@0
   370
		If a telephony call is in progress the audio source is the telephony downlink mixed with
sl@0
   371
		the device microphone. If there is no telephony call in progress or a connection to the telephony
sl@0
   372
		downlink fails, no attempt is made to connect to the microphone.
sl@0
   373
sl@0
   374
		When playing:
sl@0
   375
		If a telephony call is in progress the audio sample data is played to the telephony uplink and
sl@0
   376
		the device speaker. If there is no telephony call in progress or a connection to the telephony
sl@0
   377
		uplink fails, no attempt is made to connect to the device speaker.
sl@0
   378
		*/
sl@0
   379
		ETelephonyMixed = 1,
sl@0
   380
		/**
sl@0
   381
		When recording, the audio source is the telephony downlink and is not mixed with the device microphone.
sl@0
   382
sl@0
   383
		When playing, the audio sample data is played to the telephony uplink and is not mixed with the 
sl@0
   384
		device speaker.
sl@0
   385
		*/
sl@0
   386
		ETelephonyNonMixed = 2,
sl@0
   387
		/**
sl@0
   388
		When recording, the audio source is the device microphone.
sl@0
   389
sl@0
   390
		When playing, the audio sample data is played to the device speaker.
sl@0
   391
		*/
sl@0
   392
		ELocal = 3
sl@0
   393
		};
sl@0
   394
sl@0
   395
	virtual ~CMdaAudioRecorderUtility();
sl@0
   396
sl@0
   397
	IMPORT_C static CMdaAudioRecorderUtility* NewL(
sl@0
   398
		MMdaObjectStateChangeObserver& aObserver, 
sl@0
   399
		CMdaServer* aServer = NULL, 
sl@0
   400
		TInt aPriority = EMdaPriorityNormal, 
sl@0
   401
		TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
sl@0
   402
sl@0
   403
	virtual void OpenFileL(const TDesC& aFileName);
sl@0
   404
	IMPORT_C void OpenFileL(const RFile& aFile);
sl@0
   405
sl@0
   406
	IMPORT_C void OpenFileL(const TMMSource& aSource);
sl@0
   407
sl@0
   408
	virtual void OpenDesL(const TDesC8& aDescriptor);
sl@0
   409
sl@0
   410
	IMPORT_C void OpenDesL(TDes8& aDescriptor);
sl@0
   411
sl@0
   412
	virtual void OpenL(TMdaClipLocation* aLocation,
sl@0
   413
						TMdaClipFormat* aFormat,		
sl@0
   414
						TMdaPackage* aArg1 = NULL,	
sl@0
   415
						TMdaPackage* aArg2 = NULL);
sl@0
   416
sl@0
   417
	virtual void SetAudioDeviceMode(TDeviceMode aMode);
sl@0
   418
sl@0
   419
	virtual TInt MaxVolume();
sl@0
   420
sl@0
   421
	virtual TInt MaxGain();
sl@0
   422
sl@0
   423
	virtual TInt SetVolume(TInt aVolume);
sl@0
   424
sl@0
   425
	virtual void SetGain(TInt aGain);
sl@0
   426
sl@0
   427
 	virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
sl@0
   428
sl@0
   429
	IMPORT_C void OpenFileL(const TDesC& aFileName,
sl@0
   430
						TUid aRecordControllerUid,				// controller to use
sl@0
   431
						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0
   432
						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0
   433
						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0
   434
sl@0
   435
	IMPORT_C void OpenFileL(const RFile& aFile,
sl@0
   436
						TUid aRecordControllerUid,				// controller to use
sl@0
   437
						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0
   438
						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0
   439
						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0
   440
sl@0
   441
	IMPORT_C void OpenFileL(const TMMSource& aSource,
sl@0
   442
						TUid aRecordControllerUid,				// controller to use
sl@0
   443
						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0
   444
						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0
   445
						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0
   446
sl@0
   447
	IMPORT_C void OpenDesL(TDes8& aDescriptor,
sl@0
   448
						TUid aRecordControllerUid,				// controller to use
sl@0
   449
						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0
   450
						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0
   451
						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0
   452
sl@0
   453
	IMPORT_C void OpenUrlL(const TDesC& aUrl,
sl@0
   454
						TInt aIapId,						// internet access point
sl@0
   455
						TUid aRecordControllerUid,				// controller to use
sl@0
   456
						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0
   457
						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0
   458
						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0
   459
sl@0
   460
	IMPORT_C void OpenUrlL(const TDesC& aUrl,
sl@0
   461
							TInt aIapId =KUseDefaultIap, 
sl@0
   462
							const TDesC8& aMimeType = KNullDesC8);
sl@0
   463
sl@0
   464
	IMPORT_C TInt GetGain(TInt& aGain);
sl@0
   465
sl@0
   466
	IMPORT_C TInt GetVolume(TInt& aVolume);
sl@0
   467
sl@0
   468
	IMPORT_C TInt SetPlaybackBalance(TInt aBalance = KMMFBalanceCenter);
sl@0
   469
sl@0
   470
	IMPORT_C TInt GetPlaybackBalance(TInt& aBalance);
sl@0
   471
sl@0
   472
	IMPORT_C TInt SetRecordBalance(TInt aBalance = KMMFBalanceCenter);
sl@0
   473
sl@0
   474
	IMPORT_C TInt GetRecordBalance(TInt& aBalance);
sl@0
   475
sl@0
   476
	IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
sl@0
   477
sl@0
   478
	IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
sl@0
   479
sl@0
   480
	IMPORT_C void AddMetaDataEntryL(CMMFMetaDataEntry& aMetaDataEntry);
sl@0
   481
sl@0
   482
	IMPORT_C TInt RemoveMetaDataEntry(TInt aMetaDataIndex);
sl@0
   483
sl@0
   484
	IMPORT_C void ReplaceMetaDataEntryL(TInt aMetaDataIndex, CMMFMetaDataEntry& aMetaDataEntry);
sl@0
   485
sl@0
   486
	IMPORT_C void SetPriority(TInt aPriority, TInt aPref);
sl@0
   487
sl@0
   488
	//DataType support
sl@0
   489
sl@0
   490
	IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDataTypes);
sl@0
   491
sl@0
   492
	IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
sl@0
   493
sl@0
   494
	IMPORT_C TFourCC DestinationDataTypeL();
sl@0
   495
sl@0
   496
	// Bit rate support
sl@0
   497
sl@0
   498
	IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
sl@0
   499
sl@0
   500
	IMPORT_C TUint DestinationBitRateL();
sl@0
   501
sl@0
   502
	IMPORT_C TUint SourceBitRateL();
sl@0
   503
sl@0
   504
	IMPORT_C void GetSupportedBitRatesL(RArray<TUint>& aSupportedBitRates);
sl@0
   505
	
sl@0
   506
	// Sample rate support
sl@0
   507
sl@0
   508
	IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
sl@0
   509
sl@0
   510
	IMPORT_C TUint DestinationSampleRateL();
sl@0
   511
sl@0
   512
	IMPORT_C void GetSupportedSampleRatesL(RArray<TUint>& aSupportedSampleRates);
sl@0
   513
	// Format support
sl@0
   514
sl@0
   515
	IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
sl@0
   516
	
sl@0
   517
	IMPORT_C TUid DestinationFormatL();
sl@0
   518
sl@0
   519
	// Number of channels
sl@0
   520
	IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
sl@0
   521
sl@0
   522
	IMPORT_C TUint DestinationNumberOfChannelsL();
sl@0
   523
sl@0
   524
	IMPORT_C void GetSupportedNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
sl@0
   525
sl@0
   526
	virtual TState State();
sl@0
   527
sl@0
   528
	virtual void Close();
sl@0
   529
sl@0
   530
	virtual void PlayL();
sl@0
   531
sl@0
   532
	virtual void RecordL();
sl@0
   533
sl@0
   534
	virtual void Stop();
sl@0
   535
sl@0
   536
	virtual void CropL();
sl@0
   537
sl@0
   538
	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
sl@0
   539
sl@0
   540
	virtual const TTimeIntervalMicroSeconds& Position();
sl@0
   541
sl@0
   542
	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
sl@0
   543
sl@0
   544
	virtual const TTimeIntervalMicroSeconds& Duration();
sl@0
   545
	
sl@0
   546
	IMPORT_C TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
sl@0
   547
sl@0
   548
	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
sl@0
   549
sl@0
   550
	virtual void ClearPlayWindow();
sl@0
   551
sl@0
   552
	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0
   553
sl@0
   554
	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
sl@0
   555
sl@0
   556
	virtual void CropFromBeginningL();
sl@0
   557
sl@0
   558
	IMPORT_C void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
sl@0
   559
sl@0
   560
	IMPORT_C void GetAudioLoadingProgressL(TInt& aPercentageComplete);
sl@0
   561
sl@0
   562
	IMPORT_C const CMMFControllerImplementationInformation& AudioPlayControllerImplementationInformationL();
sl@0
   563
sl@0
   564
	IMPORT_C const CMMFControllerImplementationInformation& AudioRecorderControllerImplementationInformationL();
sl@0
   565
sl@0
   566
	IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0
   567
sl@0
   568
	IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0
   569
sl@0
   570
	IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0
   571
sl@0
   572
	IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0
   573
sl@0
   574
	IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0
   575
	
sl@0
   576
	IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0
   577
sl@0
   578
	IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0
   579
sl@0
   580
	IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0
   581
sl@0
   582
	IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();
sl@0
   583
sl@0
   584
	IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,TUid aNotificationEventUid,const TDesC8& aNotificationRegistrationData = KNullDesC8);
sl@0
   585
sl@0
   586
	IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
sl@0
   587
    
sl@0
   588
 	IMPORT_C TInt WillResumePlay();
sl@0
   589
 	
sl@0
   590
 	IMPORT_C TInt SetThreadPriorityPlayback(const TThreadPriority& aThreadPriority) const;
sl@0
   591
 	IMPORT_C TInt SetThreadPriorityRecord(const TThreadPriority& aThreadPriority) const;
sl@0
   592
	
sl@0
   593
	IMPORT_C void UseSharedHeap();
sl@0
   594
private:
sl@0
   595
	CMMFMdaAudioRecorderUtility* iProperties;
sl@0
   596
	};
sl@0
   597
sl@0
   598
class CMMFMdaAudioConvertUtility;
sl@0
   599
sl@0
   600
/**
sl@0
   601
@publishedAll
sl@0
   602
@released
sl@0
   603
sl@0
   604
Converts the type, sample rate and format of audio data.
sl@0
   605
sl@0
   606
The audio sample data can be supplied either in a file or as a descriptor.
sl@0
   607
*/
sl@0
   608
class CMdaAudioConvertUtility : public CMdaAudioClipUtility
sl@0
   609
	{
sl@0
   610
public:
sl@0
   611
sl@0
   612
	IMPORT_C static CMdaAudioConvertUtility* NewL(
sl@0
   613
		MMdaObjectStateChangeObserver& aObserver, 
sl@0
   614
		CMdaServer* aServer = NULL, 
sl@0
   615
		TInt aPriority = EMdaPriorityNormal, 
sl@0
   616
		TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
sl@0
   617
sl@0
   618
	virtual ~CMdaAudioConvertUtility();
sl@0
   619
sl@0
   620
	virtual void OpenL(const TDesC& aPrimaryFile, const TDesC& aSecondaryFile);
sl@0
   621
sl@0
   622
	virtual void OpenL(const TDesC& aPrimaryFile,
sl@0
   623
						TMdaClipLocation* aLocation,	// Normally file or descriptor
sl@0
   624
						TMdaClipFormat* aFormat,		// Data format
sl@0
   625
						TMdaPackage* aArg1 = NULL,		// Normally codec to use
sl@0
   626
						TMdaPackage* aArg2 = NULL);		// Normally audio settings
sl@0
   627
sl@0
   628
	virtual void OpenL(TMdaClipLocation* aPriLocation, 
sl@0
   629
						TMdaClipLocation* aSecLocation, 
sl@0
   630
						TMdaClipFormat* aPriFormat, 
sl@0
   631
						TMdaClipFormat* aSecFormat, 
sl@0
   632
						TMdaPackage* aPriArg1 = NULL, 
sl@0
   633
						TMdaPackage* aPriArg2 = NULL, 
sl@0
   634
						TMdaPackage* aSecArg1 = NULL, 
sl@0
   635
						TMdaPackage* aSecArg2 = NULL);
sl@0
   636
sl@0
   637
	// new controller based open
sl@0
   638
	// N.B. this override is new and must NOT be made virtual. This is because
sl@0
   639
	// it will break BC on the WINS build (due to the MS compiler grouping and
sl@0
   640
	// reordering the overrides together in the vtable and _not_ using the 
sl@0
   641
	// declaration order!)
sl@0
   642
sl@0
   643
	IMPORT_C void OpenL(TMdaClipLocation* aPriLocation, 
sl@0
   644
						TMdaClipLocation* aSecLocation, 
sl@0
   645
						TUid aControllerUid, 
sl@0
   646
						TUid aDestFormatUid,
sl@0
   647
						TFourCC aDestDataType);
sl@0
   648
sl@0
   649
	//Data type support
sl@0
   650
sl@0
   651
	IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDestinationDataTypes);
sl@0
   652
sl@0
   653
	IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
sl@0
   654
sl@0
   655
	IMPORT_C TFourCC DestinationDataTypeL();
sl@0
   656
sl@0
   657
	IMPORT_C TFourCC SourceDataTypeL();
sl@0
   658
	// Bit rate support	
sl@0
   659
sl@0
   660
	IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
sl@0
   661
sl@0
   662
	IMPORT_C TUint DestinationBitRateL();
sl@0
   663
sl@0
   664
	IMPORT_C void GetSupportedConversionBitRatesL(RArray<TUint>& aSupportedBitRates);
sl@0
   665
sl@0
   666
	IMPORT_C TInt SourceBitRateL();
sl@0
   667
sl@0
   668
	// Sample rate support
sl@0
   669
	IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
sl@0
   670
sl@0
   671
	IMPORT_C TUint DestinationSampleRateL();
sl@0
   672
sl@0
   673
	IMPORT_C void GetSupportedConversionSampleRatesL(RArray<TUint>& aSupportedSampleRates);
sl@0
   674
sl@0
   675
	IMPORT_C TUint SourceSampleRateL();
sl@0
   676
sl@0
   677
	// Format support
sl@0
   678
	IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
sl@0
   679
sl@0
   680
	IMPORT_C TUid DestinationFormatL();
sl@0
   681
sl@0
   682
	IMPORT_C TUid SourceFormatL();
sl@0
   683
sl@0
   684
	// Number of channels
sl@0
   685
	IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
sl@0
   686
sl@0
   687
	IMPORT_C TUint DestinationNumberOfChannelsL();
sl@0
   688
sl@0
   689
	IMPORT_C void GetSupportedConversionNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
sl@0
   690
sl@0
   691
	IMPORT_C TUint SourceNumberOfChannelsL();
sl@0
   692
sl@0
   693
	// New function ConvertL (PlayL and RecordL now deprecated for CMdaAudioConvertUtility)
sl@0
   694
	IMPORT_C void ConvertL();
sl@0
   695
sl@0
   696
	virtual TState State();
sl@0
   697
sl@0
   698
	virtual void Close();
sl@0
   699
sl@0
   700
	virtual void PlayL();
sl@0
   701
sl@0
   702
	virtual void RecordL();
sl@0
   703
sl@0
   704
	virtual void Stop();
sl@0
   705
sl@0
   706
	virtual void CropL();
sl@0
   707
sl@0
   708
	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
sl@0
   709
sl@0
   710
	virtual const TTimeIntervalMicroSeconds& Position();
sl@0
   711
sl@0
   712
	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
sl@0
   713
sl@0
   714
	virtual const TTimeIntervalMicroSeconds& Duration();
sl@0
   715
sl@0
   716
	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
sl@0
   717
sl@0
   718
	virtual void ClearPlayWindow();
sl@0
   719
sl@0
   720
	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0
   721
sl@0
   722
	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
sl@0
   723
sl@0
   724
	virtual void CropFromBeginningL();
sl@0
   725
sl@0
   726
	IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
sl@0
   727
sl@0
   728
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0
   729
sl@0
   730
	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0
   731
sl@0
   732
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0
   733
sl@0
   734
	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0
   735
	
sl@0
   736
 	IMPORT_C TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
sl@0
   737
	
sl@0
   738
	IMPORT_C void UseSharedHeap(); 		
sl@0
   739
private:
sl@0
   740
	CMMFMdaAudioConvertUtility* iProperties;
sl@0
   741
	
sl@0
   742
	};
sl@0
   743
sl@0
   744
#endif