os/mm/devsound/hwdevapi/inc/mmfhwdevicesetup.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/hwdevapi/inc/mmfhwdevicesetup.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,181 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @publishedPartner 
    1.22 + @released
    1.23 +*/
    1.24 +
    1.25 +#ifndef MMFHWDEVICESETUP_H
    1.26 +#define MMFHWDEVICESETUP_H
    1.27 +
    1.28 +const TUid KUidHwDeviceSetupInterface = {0x102737A8};
    1.29 +class TFourCC;
    1.30 +	
    1.31 +//Custom Interface Uid for these Hw Device implementations
    1.32 +#define KMmfPlaySettingsCustomInterface		0x101F9FC1
    1.33 +#define KMmfRecordSettingsCustomInterface	0x101F9FC2
    1.34 +#define KSetVbrFlagCustomInterfaceTypeUid	0x10282647
    1.35 +const TUid KTimePlayedCustomInterfaceTypeUid = {0x10285D17};
    1.36 +const TUid KIgnoreUnderflowCustomInterfaceTypeUid = {0x10285E7D};
    1.37 +/**
    1.38 +Custom interface to pass the data types to a hardware device adapter
    1.39 +*/
    1.40 +class MMdfHwDeviceSetup
    1.41 +	{
    1.42 +public:
    1.43 +	/**
    1.44 +	Sets the data types into the hardware device adapter
    1.45 +	@param aSrcType Source FourCC data type
    1.46 +	@param aDestType Destination FourCC data type
    1.47 +	*/
    1.48 +	virtual void SetDataTypesL(TFourCC aSrcType, TFourCC aDestType) = 0;
    1.49 +	};
    1.50 +	
    1.51 +/**
    1.52 +Custom interface class for play functionality created by the
    1.53 +CMMFSwCodecWrapper::CustomInterface() method. It provides
    1.54 +access to miscellaneous functionality such as volume settings.
    1.55 +Ports of the sw codec wrapper may do this differently eg. via EAP.
    1.56 +Note Users should not use RMdaDevSound::TCurrentSoundFormatBuf to send
    1.57 +across the sample rate and channels because 1) it would mean
    1.58 +mmfswcodecwrapper.h would have to include mdasound.h 2)
    1.59 +the buffer size and encoding members are not required and 3) 3rd party ports
    1.60 +may not use RMdaDevSound.
    1.61 +
    1.62 +Note also that this interface is just a simple interface to get
    1.63 +and set values. No checking is performed on the values sent (hence the
    1.64 +Set methods do not return an error code).
    1.65 +*/
    1.66 +class MPlayCustomInterface
    1.67 +	{
    1.68 +public:
    1.69 +	/**
    1.70 +	Set the audio volume.
    1.71 +	@param aVolume The specified audio volume.
    1.72 +	*/
    1.73 +	virtual void SetVolume(TUint aVolume) = 0;
    1.74 +
    1.75 +	/**
    1.76 +	Get the audio volume.	
    1.77 +	*/
    1.78 +	virtual TUint Volume() = 0;
    1.79 +
    1.80 +	/**
    1.81 +	Get the number of bytes played.	
    1.82 +	*/
    1.83 +	virtual TUint BytesPlayed() = 0;
    1.84 +
    1.85 +	/**
    1.86 +	Set the period over which the volume level is to rise smoothly from nothing to the required volume level.
    1.87 +	@param aRampDuration The period over which the volume is to rise.
    1.88 +	*/
    1.89 +	virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
    1.90 +
    1.91 +	/**
    1.92 +	Get the period over which the volume level is to rise smoothly from nothing to the required volume level.
    1.93 +	*/
    1.94 +	virtual TTimeIntervalMicroSeconds& VolumeRamp() = 0;
    1.95 +	};
    1.96 +
    1.97 +/**
    1.98 +Custom interface class for record functionality created by the
    1.99 +CMMFSwCodecWrapper::CustomInterface() method. It provides
   1.100 +access to miscellaneous functionality such as volume settings.
   1.101 +Ports of the sw codec wrapper may do this differently eg. via EAP.
   1.102 +Note: Users should not use RMdaDevSound::TCurrentSoundFormatBuf so send
   1.103 +across the sample rate and channels because 1) it would mean
   1.104 +mmfswcodecwrapper.h would have to include mdasound.h 2)
   1.105 +the buffer size and encoding members are not required and 3) 3rd party ports
   1.106 +may not use RMdaDevSound.
   1.107 +
   1.108 +Note also that this interface is just a simple interface to get
   1.109 +and set values. No checking is performed on the values sent (hence the
   1.110 +Set methods do not return an error code).
   1.111 +*/
   1.112 +class MRecordCustomInterface
   1.113 +	{
   1.114 +public:
   1.115 +	/**
   1.116 +	Set the gain.
   1.117 +	@param aGain The specified gain value.
   1.118 +	*/
   1.119 +	virtual void SetGain(TUint aGain) = 0;
   1.120 +
   1.121 +	/**
   1.122 +	Get the gain value.
   1.123 +	*/
   1.124 +	virtual TUint Gain() = 0;
   1.125 +
   1.126 +	/**
   1.127 +	Get the number of bytes recorded.
   1.128 +	*/
   1.129 +	virtual TUint BytesRecorded() = 0; 
   1.130 +	};
   1.131 +/**
   1.132 +Custom interface class for emptying the play buffers before playing.
   1.133 +*/
   1.134 +class MEmptyBuffersCustomInterface
   1.135 +	{
   1.136 +public:
   1.137 +	/**
   1.138 +	Empties the play buffers.
   1.139 +	@return An error code indicating if the function call was successful. KErrNone on success, KErrNotReady 
   1.140 +			if the device is not ready, otherwise another of the system-wide error codes.
   1.141 +	*/
   1.142 +	virtual TInt EmptyBuffers() = 0;
   1.143 +	};
   1.144 +
   1.145 +/**
   1.146 +Custom interface class for setting VBR flag.
   1.147 +*/
   1.148 +class MSetVbrFlagCustomInterface
   1.149 +	{
   1.150 +public:
   1.151 +	/**
   1.152 +	Sets the VBR flag to ETrue.
   1.153 +	*/
   1.154 +	virtual void SetVbrFlag() = 0;
   1.155 +	};
   1.156 +
   1.157 +/**
   1.158 +Custom interface class for querying current play time from the audio renderer.
   1.159 +*/
   1.160 +class MTimePlayedCustomInterface
   1.161 +	{
   1.162 +public:
   1.163 +	/**
   1.164 +	Gets the current play time from the sound driver.
   1.165 +	@param aTime A reference to TTimeIntervalMicroSeconds object which is filled with the current play time.
   1.166 +	@return An error code indicating if the function call was successful. KErrNone on success
   1.167 +	*/
   1.168 +	virtual TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime) = 0;
   1.169 +	};	
   1.170 +
   1.171 +/**
   1.172 +Custom interface class for configuring hardware device to ignore all the underflow events from the sound driver 
   1.173 +except for the last buffer.
   1.174 +*/
   1.175 +class MIgnoreUnderflowEventsCustomInterface
   1.176 +	{
   1.177 +public:
   1.178 +	/**
   1.179 +	Configures the hardware device such that it ignores all the underflow events from the sound driver.
   1.180 +	However, it propagates the underflow error to devsound when the last buffer flag is set.
   1.181 +	*/
   1.182 +	virtual void IgnoreUnderflowEvents() = 0;
   1.183 +	};
   1.184 +#endif // MMFHWDEVICESETUP_H
   1.185 \ No newline at end of file