sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: #ifndef MDAAUDIOSAMPLEEDITOR_H
sl@0: #define MDAAUDIOSAMPLEEDITOR_H
sl@0: 
sl@0: 
sl@0: 
sl@0: #include <e32std.h>
sl@0: #include <f32file.h>
sl@0: #include <mmf/common/mmfbase.h>
sl@0: #include <mmf/common/mmfaudio.h>
sl@0: #include <mmf/common/mmfstandardcustomcommands.h>
sl@0: #include <mmf/common/mmfdrmcustomcommands.h>
sl@0: 
sl@0: #include <mda/client/resource.h>
sl@0: #include <mda/client/utility.h>
sl@0: #include <mda/common/audio.h>
sl@0: #include <mmfclntutility.h>
sl@0: #include <mmf/common/mmfdurationinfocustomcommands.h>
sl@0: 
sl@0: class CMdaServer;
sl@0: 
sl@0: /**
sl@0:  * @publishedAll
sl@0:  * @deprecated
sl@0:  *
sl@0:  * Dummy class - not supported in 7.0s
sl@0:  */
sl@0: class CMdaAudioType : public CBase
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0:     Destructor
sl@0: 	*/
sl@0: 	IMPORT_C ~CMdaAudioType();
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: @publishedAll
sl@0: @released
sl@0: 
sl@0: This class is used by both the audio recorder and audio converter. This class should not be used,
sl@0: other than the TState enum.
sl@0: 
sl@0: Prior to 7.0s the pure virtual functions in this class were implemented virtual functions. In 7.0s 
sl@0: this changed, so now any classes derived from this one must implement the functions themselves.
sl@0: 
sl@0: @see CMdaAudioRecorderUtility
sl@0: @see CMdaAudioConvertUtility
sl@0: */
sl@0: class CMdaAudioClipUtility : public CBase, 
sl@0: 							 public MMMFClientUtility
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Defines the possible state of the audio data sample.
sl@0: 	*/
sl@0: 	enum TState
sl@0: 		{
sl@0: 		/** The audio clip recorder or audio converter has been constructed but no file or descriptor 
sl@0: 		has been opened.
sl@0: 		*/
sl@0: 		ENotReady = 0,
sl@0: 		/** Files or descriptors are open but no playing or recording operation is in progress.
sl@0: 		*/
sl@0: 		EOpen,
sl@0: 		/** Audio sample data is playing.
sl@0: 		*/
sl@0: 		EPlaying,
sl@0: 		/** New audio sample data is being recorded.
sl@0: 		*/
sl@0: 		ERecording
sl@0: 		};
sl@0: 
sl@0: public:
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Returns the current state of the audio sample data.
sl@0: 
sl@0: 	@return The state of the audio sample data.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual TState State()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Releases any currently open audio sample data.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void Close()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Begins playback of audio sample data at the current playback position using the current volume,
sl@0: 	gain and priority settings.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void PlayL()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Starts appending new audio sample data.
sl@0: 
sl@0: 	The new audio sample data is appended to the existing audio sample data in the same format as
sl@0: 	the existing audio sample data. If existing data is to be overwritten, then it should be cropped
sl@0: 	to the appropriate length before appending the new data.
sl@0: 	
sl@0: 	Note, before starting to record, make sure that the gain is set by calling
sl@0: 	CMdaAudioRecorderUtility::SetGain(), as the initial gain is undefined. The gain might also
sl@0: 	have been modified by another client application.
sl@0: 	
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	@see CMdaAudioRecorderUtility 
sl@0: 	@see CMdaAudioRecorderUtility::SetGain()
sl@0: 	*/
sl@0: 	virtual void RecordL()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Stops the playback or recording operation.
sl@0: 	
sl@0: 	The operation is stopped at the current location. For a playback operation, the head is positioned at the last played data.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void Stop()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Deletes all audio sample data after the current head position. The effects of the function cannot be undone.
sl@0: 
sl@0: 	The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void CropL()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Sets the head position.
sl@0: 	
sl@0: 	The playback head is moved to a position which is defined in terms of a time interval measured
sl@0: 	from the beginning of the audio sample data. A subsequent call to PlayL() starts from
sl@0: 	this new position.
sl@0: 	
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition)=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Returns the current head position.
sl@0: 	
sl@0: 	The head position is defined in terms of a time interval measured from the beginning of the audio sample data.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual const TTimeIntervalMicroSeconds& Position()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Returns the recording time available for the selected file or descriptor and encoding format.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Returns the duration of the audio sample data.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual const TTimeIntervalMicroSeconds& Duration()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Defines a window on the audio sample data.
sl@0: 
sl@0: 	The window is defined in terms of a start and end position.
sl@0: 	When the current playback position reaches the window end position, or Stop() is called, the
sl@0: 	current playback position is set to the window start position and playback stops.
sl@0: 
sl@0: 	The current playback position is not affected by a call to SetPlayWindow() unless it is outside
sl@0: 	the new playback window, in which case it is set to the window start or end position depending
sl@0: 	on which one is closer.
sl@0: 
sl@0: 	The window persists until ClearPlayWindow() is called.
sl@0: 	Loading new audio sample data without adjusting or clearing the window will result in
sl@0: 	playback errors if the window is outside the new data.
sl@0: 	
sl@0: 	@param  aStart
sl@0: 	        The position defining the start of the window, measured in microseconds. If this
sl@0: 	        value is less than zero, it is set to zero. If this value is greater than aEnd,
sl@0: 	        then it is swapped with aEnd.
sl@0: 	@param  aEnd
sl@0: 	        The position defining the end of the window, measured in microseconds. If this value
sl@0: 	        is greater than the value returned by Duration(), it is set to the value of Duration().
sl@0: 	        If this value is less than aStart, then it is swapped with aStart.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd)=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Removes any window defined on the audio sample data.
sl@0: 	
sl@0: 	All subsequent playing, position setting and position querying requests are mapped to the whole of the audio sample data.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void ClearPlayWindow()=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Sets the number of times the audio sample is to be repeated during the PlayL() operation.
sl@0: 	
sl@0: 	A period of silence can follow each playing of the audio sample. The audio sample can be repeated
sl@0: 	indefinitely or until stopped.
sl@0: 
sl@0: 	@param  aRepeatNumberOfTimes  
sl@0:             The number of times the audio sample, together with the trailing silence, is to 
sl@0:             be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with 
sl@0:             the trailing silence, is repeated indefinitely. If this is set to zero, then the audio 
sl@0:             sample is not repeated.
sl@0: 	@param  aTrailingSilence  
sl@0:             The length of the trailing silence in microseconds.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	This function is no longer supported. It is provided for binary compatibility with previous
sl@0: 	releases and always leaves with KErrNotSupported.
sl@0: 
sl@0: 	@return Always returns NULL.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0:  	virtual CMdaAudioType* TypeL();
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Sets the maximum size for a file that is being recorded.
sl@0: 	
sl@0: 	When this limit is reached, MMF stops recording and notifies the client application. Notification is caused
sl@0: 	by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.
sl@0: 	
sl@0: 	This function is provided so that applications such as recorders can limit the amount of file storage/memory
sl@0: 	that should be allocated.
sl@0: 	
sl@0: 	@param aMaxWriteLength
sl@0: 	       The maximum file size in kilobytes. If the default value is used, there is no maximum file size.
sl@0: 
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone)=0;
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Deletes all audio sample data from the beginning of the audio clip. The effects of the function cannot be undone.
sl@0: 	
sl@0: 	The function is synchronous and can leave if there is a problem. The leave code depends on the configuration.
sl@0: 	
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	virtual void CropFromBeginningL()=0;
sl@0: public:
sl@0: 	// Reserved functions - do not call - to allow virtual additional functions to be added to class
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 
sl@0: 	Reserved function
sl@0:     */
sl@0: 	virtual void ClipUtil_Reserved3();
sl@0: 
sl@0: 	/**
sl@0: 	@internalTechnology
sl@0: 	
sl@0: 	Reserved function
sl@0: 	*/
sl@0: 	virtual void ClipUtil_Reserved4();
sl@0: 	};
sl@0: 
sl@0: 
sl@0: class CMMFMdaAudioRecorderUtility;
sl@0: 
sl@0: /**
sl@0: @publishedAll
sl@0: @released
sl@0: 
sl@0: Plays back, records and edits audio sample data.
sl@0: 
sl@0: The class offers an interface to play, record and edit audio sample data. This data can be supplied 
sl@0: either in a file or as a descriptor. The functions that start and stop playback and recording are 
sl@0: defined in the base class CMdaAudioClipUtility.
sl@0: 
sl@0: While this class is abstract, the static NewL() function constructs, initialises and returns a 
sl@0: pointer to an instance of a concrete class derived from this abstract class. This concrete class 
sl@0: is part of the MMF implementation and is private.
sl@0: 
sl@0: */
sl@0: class CMdaAudioRecorderUtility : public CMdaAudioClipUtility
sl@0: 	{
sl@0: public:
sl@0: 	
sl@0: 	/**
sl@0: 	Device mode. Used by SetAudioDeviceMode method which is not used from 7.0s
sl@0: 	@since 5.0
sl@0: 	*/
sl@0: 	enum TDeviceMode
sl@0: 		{
sl@0: 		/**
sl@0: 		The default behaviour.
sl@0: 
sl@0: 		When recording:
sl@0: 		If a telephony call is in progress, an attempt is made to connect to the telephony downlink
sl@0: 		plus the device microphone.	If there is no telephony call in progress or a connection to the
sl@0: 		telephony downlink fails, an attempt is made to connect to the device microphone only.
sl@0: 
sl@0: 		When playing:
sl@0: 		If a telephony call is in progress, an attempt is made to connect to the telephony uplink.
sl@0: 		If there is no telephony call in progress or a connection to the telephony uplink fails, an
sl@0: 		attempt is made to connect to the device speaker.
sl@0:         */
sl@0: 		EDefault = 0,
sl@0: 		/** See EDefault.
sl@0: 		*/
sl@0: 		ETelephonyOrLocal = EDefault,
sl@0: 		/** 
sl@0: 		When recording:
sl@0: 		If a telephony call is in progress the audio source is the telephony downlink mixed with
sl@0: 		the device microphone. If there is no telephony call in progress or a connection to the telephony
sl@0: 		downlink fails, no attempt is made to connect to the microphone.
sl@0: 
sl@0: 		When playing:
sl@0: 		If a telephony call is in progress the audio sample data is played to the telephony uplink and
sl@0: 		the device speaker. If there is no telephony call in progress or a connection to the telephony
sl@0: 		uplink fails, no attempt is made to connect to the device speaker.
sl@0: 		*/
sl@0: 		ETelephonyMixed = 1,
sl@0: 		/**
sl@0: 		When recording, the audio source is the telephony downlink and is not mixed with the device microphone.
sl@0: 
sl@0: 		When playing, the audio sample data is played to the telephony uplink and is not mixed with the 
sl@0: 		device speaker.
sl@0: 		*/
sl@0: 		ETelephonyNonMixed = 2,
sl@0: 		/**
sl@0: 		When recording, the audio source is the device microphone.
sl@0: 
sl@0: 		When playing, the audio sample data is played to the device speaker.
sl@0: 		*/
sl@0: 		ELocal = 3
sl@0: 		};
sl@0: 
sl@0: 	virtual ~CMdaAudioRecorderUtility();
sl@0: 
sl@0: 	IMPORT_C static CMdaAudioRecorderUtility* NewL(
sl@0: 		MMdaObjectStateChangeObserver& aObserver, 
sl@0: 		CMdaServer* aServer = NULL, 
sl@0: 		TInt aPriority = EMdaPriorityNormal, 
sl@0: 		TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
sl@0: 
sl@0: 	virtual void OpenFileL(const TDesC& aFileName);
sl@0: 	IMPORT_C void OpenFileL(const RFile& aFile);
sl@0: 
sl@0: 	IMPORT_C void OpenFileL(const TMMSource& aSource);
sl@0: 
sl@0: 	virtual void OpenDesL(const TDesC8& aDescriptor);
sl@0: 
sl@0: 	IMPORT_C void OpenDesL(TDes8& aDescriptor);
sl@0: 
sl@0: 	virtual void OpenL(TMdaClipLocation* aLocation,
sl@0: 						TMdaClipFormat* aFormat,		
sl@0: 						TMdaPackage* aArg1 = NULL,	
sl@0: 						TMdaPackage* aArg2 = NULL);
sl@0: 
sl@0: 	virtual void SetAudioDeviceMode(TDeviceMode aMode);
sl@0: 
sl@0: 	virtual TInt MaxVolume();
sl@0: 
sl@0: 	virtual TInt MaxGain();
sl@0: 
sl@0: 	virtual TInt SetVolume(TInt aVolume);
sl@0: 
sl@0: 	virtual void SetGain(TInt aGain);
sl@0: 
sl@0:  	virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
sl@0: 
sl@0: 	IMPORT_C void OpenFileL(const TDesC& aFileName,
sl@0: 						TUid aRecordControllerUid,				// controller to use
sl@0: 						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0: 						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0: 						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0: 
sl@0: 	IMPORT_C void OpenFileL(const RFile& aFile,
sl@0: 						TUid aRecordControllerUid,				// controller to use
sl@0: 						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0: 						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0: 						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0: 
sl@0: 	IMPORT_C void OpenFileL(const TMMSource& aSource,
sl@0: 						TUid aRecordControllerUid,				// controller to use
sl@0: 						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0: 						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0: 						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0: 
sl@0: 	IMPORT_C void OpenDesL(TDes8& aDescriptor,
sl@0: 						TUid aRecordControllerUid,				// controller to use
sl@0: 						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0: 						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0: 						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0: 
sl@0: 	IMPORT_C void OpenUrlL(const TDesC& aUrl,
sl@0: 						TInt aIapId,						// internet access point
sl@0: 						TUid aRecordControllerUid,				// controller to use
sl@0: 						TUid aPlaybackControllerUid=KNullUid,	// playback controller (if different)
sl@0: 						TUid aDestinationFormatUid=KNullUid,	// Data format
sl@0: 						TFourCC aDestinationDataType = KFourCCNULL);	// data type for recording
sl@0: 
sl@0: 	IMPORT_C void OpenUrlL(const TDesC& aUrl,
sl@0: 							TInt aIapId =KUseDefaultIap, 
sl@0: 							const TDesC8& aMimeType = KNullDesC8);
sl@0: 
sl@0: 	IMPORT_C TInt GetGain(TInt& aGain);
sl@0: 
sl@0: 	IMPORT_C TInt GetVolume(TInt& aVolume);
sl@0: 
sl@0: 	IMPORT_C TInt SetPlaybackBalance(TInt aBalance = KMMFBalanceCenter);
sl@0: 
sl@0: 	IMPORT_C TInt GetPlaybackBalance(TInt& aBalance);
sl@0: 
sl@0: 	IMPORT_C TInt SetRecordBalance(TInt aBalance = KMMFBalanceCenter);
sl@0: 
sl@0: 	IMPORT_C TInt GetRecordBalance(TInt& aBalance);
sl@0: 
sl@0: 	IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
sl@0: 
sl@0: 	IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
sl@0: 
sl@0: 	IMPORT_C void AddMetaDataEntryL(CMMFMetaDataEntry& aMetaDataEntry);
sl@0: 
sl@0: 	IMPORT_C TInt RemoveMetaDataEntry(TInt aMetaDataIndex);
sl@0: 
sl@0: 	IMPORT_C void ReplaceMetaDataEntryL(TInt aMetaDataIndex, CMMFMetaDataEntry& aMetaDataEntry);
sl@0: 
sl@0: 	IMPORT_C void SetPriority(TInt aPriority, TInt aPref);
sl@0: 
sl@0: 	//DataType support
sl@0: 
sl@0: 	IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDataTypes);
sl@0: 
sl@0: 	IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
sl@0: 
sl@0: 	IMPORT_C TFourCC DestinationDataTypeL();
sl@0: 
sl@0: 	// Bit rate support
sl@0: 
sl@0: 	IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationBitRateL();
sl@0: 
sl@0: 	IMPORT_C TUint SourceBitRateL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedBitRatesL(RArray<TUint>& aSupportedBitRates);
sl@0: 	
sl@0: 	// Sample rate support
sl@0: 
sl@0: 	IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationSampleRateL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedSampleRatesL(RArray<TUint>& aSupportedSampleRates);
sl@0: 	// Format support
sl@0: 
sl@0: 	IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
sl@0: 	
sl@0: 	IMPORT_C TUid DestinationFormatL();
sl@0: 
sl@0: 	// Number of channels
sl@0: 	IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationNumberOfChannelsL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
sl@0: 
sl@0: 	virtual TState State();
sl@0: 
sl@0: 	virtual void Close();
sl@0: 
sl@0: 	virtual void PlayL();
sl@0: 
sl@0: 	virtual void RecordL();
sl@0: 
sl@0: 	virtual void Stop();
sl@0: 
sl@0: 	virtual void CropL();
sl@0: 
sl@0: 	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& Position();
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& Duration();
sl@0: 	
sl@0: 	IMPORT_C TMMFDurationInfo Duration(TTimeIntervalMicroSeconds& aDuration);
sl@0: 
sl@0: 	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
sl@0: 
sl@0: 	virtual void ClearPlayWindow();
sl@0: 
sl@0: 	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0: 
sl@0: 	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
sl@0: 
sl@0: 	virtual void CropFromBeginningL();
sl@0: 
sl@0: 	IMPORT_C void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
sl@0: 
sl@0: 	IMPORT_C void GetAudioLoadingProgressL(TInt& aPercentageComplete);
sl@0: 
sl@0: 	IMPORT_C const CMMFControllerImplementationInformation& AudioPlayControllerImplementationInformationL();
sl@0: 
sl@0: 	IMPORT_C const CMMFControllerImplementationInformation& AudioRecorderControllerImplementationInformationL();
sl@0: 
sl@0: 	IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0: 
sl@0: 	IMPORT_C TInt RecordControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0: 
sl@0: 	IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0: 
sl@0: 	IMPORT_C void RecordControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0: 
sl@0: 	IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0: 	
sl@0: 	IMPORT_C TInt PlayControllerCustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0: 
sl@0: 	IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0: 
sl@0: 	IMPORT_C void PlayControllerCustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0: 
sl@0: 	IMPORT_C MMMFDRMCustomCommand* GetDRMCustomCommand();
sl@0: 
sl@0: 	IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback,TUid aNotificationEventUid,const TDesC8& aNotificationRegistrationData = KNullDesC8);
sl@0: 
sl@0: 	IMPORT_C TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
sl@0:     
sl@0:  	IMPORT_C TInt WillResumePlay();
sl@0:  	
sl@0:  	IMPORT_C TInt SetThreadPriorityPlayback(const TThreadPriority& aThreadPriority) const;
sl@0:  	IMPORT_C TInt SetThreadPriorityRecord(const TThreadPriority& aThreadPriority) const;
sl@0: 	
sl@0: 	IMPORT_C void UseSharedHeap();
sl@0: private:
sl@0: 	CMMFMdaAudioRecorderUtility* iProperties;
sl@0: 	};
sl@0: 
sl@0: class CMMFMdaAudioConvertUtility;
sl@0: 
sl@0: /**
sl@0: @publishedAll
sl@0: @released
sl@0: 
sl@0: Converts the type, sample rate and format of audio data.
sl@0: 
sl@0: The audio sample data can be supplied either in a file or as a descriptor.
sl@0: */
sl@0: class CMdaAudioConvertUtility : public CMdaAudioClipUtility
sl@0: 	{
sl@0: public:
sl@0: 
sl@0: 	IMPORT_C static CMdaAudioConvertUtility* NewL(
sl@0: 		MMdaObjectStateChangeObserver& aObserver, 
sl@0: 		CMdaServer* aServer = NULL, 
sl@0: 		TInt aPriority = EMdaPriorityNormal, 
sl@0: 		TInt aPref = EMdaPriorityPreferenceTimeAndQuality);
sl@0: 
sl@0: 	virtual ~CMdaAudioConvertUtility();
sl@0: 
sl@0: 	virtual void OpenL(const TDesC& aPrimaryFile, const TDesC& aSecondaryFile);
sl@0: 
sl@0: 	virtual void OpenL(const TDesC& aPrimaryFile,
sl@0: 						TMdaClipLocation* aLocation,	// Normally file or descriptor
sl@0: 						TMdaClipFormat* aFormat,		// Data format
sl@0: 						TMdaPackage* aArg1 = NULL,		// Normally codec to use
sl@0: 						TMdaPackage* aArg2 = NULL);		// Normally audio settings
sl@0: 
sl@0: 	virtual void OpenL(TMdaClipLocation* aPriLocation, 
sl@0: 						TMdaClipLocation* aSecLocation, 
sl@0: 						TMdaClipFormat* aPriFormat, 
sl@0: 						TMdaClipFormat* aSecFormat, 
sl@0: 						TMdaPackage* aPriArg1 = NULL, 
sl@0: 						TMdaPackage* aPriArg2 = NULL, 
sl@0: 						TMdaPackage* aSecArg1 = NULL, 
sl@0: 						TMdaPackage* aSecArg2 = NULL);
sl@0: 
sl@0: 	// new controller based open
sl@0: 	// N.B. this override is new and must NOT be made virtual. This is because
sl@0: 	// it will break BC on the WINS build (due to the MS compiler grouping and
sl@0: 	// reordering the overrides together in the vtable and _not_ using the 
sl@0: 	// declaration order!)
sl@0: 
sl@0: 	IMPORT_C void OpenL(TMdaClipLocation* aPriLocation, 
sl@0: 						TMdaClipLocation* aSecLocation, 
sl@0: 						TUid aControllerUid, 
sl@0: 						TUid aDestFormatUid,
sl@0: 						TFourCC aDestDataType);
sl@0: 
sl@0: 	//Data type support
sl@0: 
sl@0: 	IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDestinationDataTypes);
sl@0: 
sl@0: 	IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
sl@0: 
sl@0: 	IMPORT_C TFourCC DestinationDataTypeL();
sl@0: 
sl@0: 	IMPORT_C TFourCC SourceDataTypeL();
sl@0: 	// Bit rate support	
sl@0: 
sl@0: 	IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationBitRateL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedConversionBitRatesL(RArray<TUint>& aSupportedBitRates);
sl@0: 
sl@0: 	IMPORT_C TInt SourceBitRateL();
sl@0: 
sl@0: 	// Sample rate support
sl@0: 	IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationSampleRateL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedConversionSampleRatesL(RArray<TUint>& aSupportedSampleRates);
sl@0: 
sl@0: 	IMPORT_C TUint SourceSampleRateL();
sl@0: 
sl@0: 	// Format support
sl@0: 	IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
sl@0: 
sl@0: 	IMPORT_C TUid DestinationFormatL();
sl@0: 
sl@0: 	IMPORT_C TUid SourceFormatL();
sl@0: 
sl@0: 	// Number of channels
sl@0: 	IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
sl@0: 
sl@0: 	IMPORT_C TUint DestinationNumberOfChannelsL();
sl@0: 
sl@0: 	IMPORT_C void GetSupportedConversionNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels);
sl@0: 
sl@0: 	IMPORT_C TUint SourceNumberOfChannelsL();
sl@0: 
sl@0: 	// New function ConvertL (PlayL and RecordL now deprecated for CMdaAudioConvertUtility)
sl@0: 	IMPORT_C void ConvertL();
sl@0: 
sl@0: 	virtual TState State();
sl@0: 
sl@0: 	virtual void Close();
sl@0: 
sl@0: 	virtual void PlayL();
sl@0: 
sl@0: 	virtual void RecordL();
sl@0: 
sl@0: 	virtual void Stop();
sl@0: 
sl@0: 	virtual void CropL();
sl@0: 
sl@0: 	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& Position();
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& RecordTimeAvailable();
sl@0: 
sl@0: 	virtual const TTimeIntervalMicroSeconds& Duration();
sl@0: 
sl@0: 	virtual void SetPlayWindow(const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd);
sl@0: 
sl@0: 	virtual void ClearPlayWindow();
sl@0: 
sl@0: 	virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
sl@0: 
sl@0: 	virtual void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
sl@0: 
sl@0: 	virtual void CropFromBeginningL();
sl@0: 
sl@0: 	IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
sl@0: 
sl@0: 	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
sl@0: 
sl@0: 	IMPORT_C TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
sl@0: 
sl@0: 	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
sl@0: 
sl@0: 	IMPORT_C void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
sl@0: 	
sl@0:  	IMPORT_C TInt SetThreadPriority(const TThreadPriority& aThreadPriority) const;
sl@0: 	
sl@0: 	IMPORT_C void UseSharedHeap(); 		
sl@0: private:
sl@0: 	CMMFMdaAudioConvertUtility* iProperties;
sl@0: 	
sl@0: 	};
sl@0: 
sl@0: #endif