sl@0: // Copyright (c) 2001-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: /**
sl@0:  @file
sl@0:  @publishedPartner 
sl@0:  @released
sl@0: */
sl@0: 
sl@0: #ifndef MMFHWDEVICESETUP_H
sl@0: #define MMFHWDEVICESETUP_H
sl@0: 
sl@0: const TUid KUidHwDeviceSetupInterface = {0x102737A8};
sl@0: class TFourCC;
sl@0: 	
sl@0: //Custom Interface Uid for these Hw Device implementations
sl@0: #define KMmfPlaySettingsCustomInterface		0x101F9FC1
sl@0: #define KMmfRecordSettingsCustomInterface	0x101F9FC2
sl@0: #define KSetVbrFlagCustomInterfaceTypeUid	0x10282647
sl@0: const TUid KTimePlayedCustomInterfaceTypeUid = {0x10285D17};
sl@0: const TUid KIgnoreUnderflowCustomInterfaceTypeUid = {0x10285E7D};
sl@0: /**
sl@0: Custom interface to pass the data types to a hardware device adapter
sl@0: */
sl@0: class MMdfHwDeviceSetup
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Sets the data types into the hardware device adapter
sl@0: 	@param aSrcType Source FourCC data type
sl@0: 	@param aDestType Destination FourCC data type
sl@0: 	*/
sl@0: 	virtual void SetDataTypesL(TFourCC aSrcType, TFourCC aDestType) = 0;
sl@0: 	};
sl@0: 	
sl@0: /**
sl@0: Custom interface class for play functionality created by the
sl@0: CMMFSwCodecWrapper::CustomInterface() method. It provides
sl@0: access to miscellaneous functionality such as volume settings.
sl@0: Ports of the sw codec wrapper may do this differently eg. via EAP.
sl@0: Note Users should not use RMdaDevSound::TCurrentSoundFormatBuf to send
sl@0: across the sample rate and channels because 1) it would mean
sl@0: mmfswcodecwrapper.h would have to include mdasound.h 2)
sl@0: the buffer size and encoding members are not required and 3) 3rd party ports
sl@0: may not use RMdaDevSound.
sl@0: 
sl@0: Note also that this interface is just a simple interface to get
sl@0: and set values. No checking is performed on the values sent (hence the
sl@0: Set methods do not return an error code).
sl@0: */
sl@0: class MPlayCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Set the audio volume.
sl@0: 	@param aVolume The specified audio volume.
sl@0: 	*/
sl@0: 	virtual void SetVolume(TUint aVolume) = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Get the audio volume.	
sl@0: 	*/
sl@0: 	virtual TUint Volume() = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Get the number of bytes played.	
sl@0: 	*/
sl@0: 	virtual TUint BytesPlayed() = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Set the period over which the volume level is to rise smoothly from nothing to the required volume level.
sl@0: 	@param aRampDuration The period over which the volume is to rise.
sl@0: 	*/
sl@0: 	virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Get the period over which the volume level is to rise smoothly from nothing to the required volume level.
sl@0: 	*/
sl@0: 	virtual TTimeIntervalMicroSeconds& VolumeRamp() = 0;
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: Custom interface class for record functionality created by the
sl@0: CMMFSwCodecWrapper::CustomInterface() method. It provides
sl@0: access to miscellaneous functionality such as volume settings.
sl@0: Ports of the sw codec wrapper may do this differently eg. via EAP.
sl@0: Note: Users should not use RMdaDevSound::TCurrentSoundFormatBuf so send
sl@0: across the sample rate and channels because 1) it would mean
sl@0: mmfswcodecwrapper.h would have to include mdasound.h 2)
sl@0: the buffer size and encoding members are not required and 3) 3rd party ports
sl@0: may not use RMdaDevSound.
sl@0: 
sl@0: Note also that this interface is just a simple interface to get
sl@0: and set values. No checking is performed on the values sent (hence the
sl@0: Set methods do not return an error code).
sl@0: */
sl@0: class MRecordCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Set the gain.
sl@0: 	@param aGain The specified gain value.
sl@0: 	*/
sl@0: 	virtual void SetGain(TUint aGain) = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Get the gain value.
sl@0: 	*/
sl@0: 	virtual TUint Gain() = 0;
sl@0: 
sl@0: 	/**
sl@0: 	Get the number of bytes recorded.
sl@0: 	*/
sl@0: 	virtual TUint BytesRecorded() = 0; 
sl@0: 	};
sl@0: /**
sl@0: Custom interface class for emptying the play buffers before playing.
sl@0: */
sl@0: class MEmptyBuffersCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Empties the play buffers.
sl@0: 	@return An error code indicating if the function call was successful. KErrNone on success, KErrNotReady 
sl@0: 			if the device is not ready, otherwise another of the system-wide error codes.
sl@0: 	*/
sl@0: 	virtual TInt EmptyBuffers() = 0;
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: Custom interface class for setting VBR flag.
sl@0: */
sl@0: class MSetVbrFlagCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Sets the VBR flag to ETrue.
sl@0: 	*/
sl@0: 	virtual void SetVbrFlag() = 0;
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: Custom interface class for querying current play time from the audio renderer.
sl@0: */
sl@0: class MTimePlayedCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Gets the current play time from the sound driver.
sl@0: 	@param aTime A reference to TTimeIntervalMicroSeconds object which is filled with the current play time.
sl@0: 	@return An error code indicating if the function call was successful. KErrNone on success
sl@0: 	*/
sl@0: 	virtual TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime) = 0;
sl@0: 	};	
sl@0: 
sl@0: /**
sl@0: Custom interface class for configuring hardware device to ignore all the underflow events from the sound driver 
sl@0: except for the last buffer.
sl@0: */
sl@0: class MIgnoreUnderflowEventsCustomInterface
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Configures the hardware device such that it ignores all the underflow events from the sound driver.
sl@0: 	However, it propagates the underflow error to devsound when the last buffer flag is set.
sl@0: 	*/
sl@0: 	virtual void IgnoreUnderflowEvents() = 0;
sl@0: 	};
sl@0: #endif // MMFHWDEVICESETUP_H