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