devsound/hwdevapi/inc/mmfhwdevicesetup.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2001-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 /**
       
    17  @file
       
    18  @publishedPartner 
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef MMFHWDEVICESETUP_H
       
    23 #define MMFHWDEVICESETUP_H
       
    24 
       
    25 const TUid KUidHwDeviceSetupInterface = {0x102737A8};
       
    26 class TFourCC;
       
    27 	
       
    28 //Custom Interface Uid for these Hw Device implementations
       
    29 #define KMmfPlaySettingsCustomInterface		0x101F9FC1
       
    30 #define KMmfRecordSettingsCustomInterface	0x101F9FC2
       
    31 #define KSetVbrFlagCustomInterfaceTypeUid	0x10282647
       
    32 const TUid KTimePlayedCustomInterfaceTypeUid = {0x10285D17};
       
    33 const TUid KIgnoreUnderflowCustomInterfaceTypeUid = {0x10285E7D};
       
    34 /**
       
    35 Custom interface to pass the data types to a hardware device adapter
       
    36 */
       
    37 class MMdfHwDeviceSetup
       
    38 	{
       
    39 public:
       
    40 	/**
       
    41 	Sets the data types into the hardware device adapter
       
    42 	@param aSrcType Source FourCC data type
       
    43 	@param aDestType Destination FourCC data type
       
    44 	*/
       
    45 	virtual void SetDataTypesL(TFourCC aSrcType, TFourCC aDestType) = 0;
       
    46 	};
       
    47 	
       
    48 /**
       
    49 Custom interface class for play functionality created by the
       
    50 CMMFSwCodecWrapper::CustomInterface() method. It provides
       
    51 access to miscellaneous functionality such as volume settings.
       
    52 Ports of the sw codec wrapper may do this differently eg. via EAP.
       
    53 Note Users should not use RMdaDevSound::TCurrentSoundFormatBuf to send
       
    54 across the sample rate and channels because 1) it would mean
       
    55 mmfswcodecwrapper.h would have to include mdasound.h 2)
       
    56 the buffer size and encoding members are not required and 3) 3rd party ports
       
    57 may not use RMdaDevSound.
       
    58 
       
    59 Note also that this interface is just a simple interface to get
       
    60 and set values. No checking is performed on the values sent (hence the
       
    61 Set methods do not return an error code).
       
    62 */
       
    63 class MPlayCustomInterface
       
    64 	{
       
    65 public:
       
    66 	/**
       
    67 	Set the audio volume.
       
    68 	@param aVolume The specified audio volume.
       
    69 	*/
       
    70 	virtual void SetVolume(TUint aVolume) = 0;
       
    71 
       
    72 	/**
       
    73 	Get the audio volume.	
       
    74 	*/
       
    75 	virtual TUint Volume() = 0;
       
    76 
       
    77 	/**
       
    78 	Get the number of bytes played.	
       
    79 	*/
       
    80 	virtual TUint BytesPlayed() = 0;
       
    81 
       
    82 	/**
       
    83 	Set the period over which the volume level is to rise smoothly from nothing to the required volume level.
       
    84 	@param aRampDuration The period over which the volume is to rise.
       
    85 	*/
       
    86 	virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) = 0;
       
    87 
       
    88 	/**
       
    89 	Get the period over which the volume level is to rise smoothly from nothing to the required volume level.
       
    90 	*/
       
    91 	virtual TTimeIntervalMicroSeconds& VolumeRamp() = 0;
       
    92 	};
       
    93 
       
    94 /**
       
    95 Custom interface class for record functionality created by the
       
    96 CMMFSwCodecWrapper::CustomInterface() method. It provides
       
    97 access to miscellaneous functionality such as volume settings.
       
    98 Ports of the sw codec wrapper may do this differently eg. via EAP.
       
    99 Note: Users should not use RMdaDevSound::TCurrentSoundFormatBuf so send
       
   100 across the sample rate and channels because 1) it would mean
       
   101 mmfswcodecwrapper.h would have to include mdasound.h 2)
       
   102 the buffer size and encoding members are not required and 3) 3rd party ports
       
   103 may not use RMdaDevSound.
       
   104 
       
   105 Note also that this interface is just a simple interface to get
       
   106 and set values. No checking is performed on the values sent (hence the
       
   107 Set methods do not return an error code).
       
   108 */
       
   109 class MRecordCustomInterface
       
   110 	{
       
   111 public:
       
   112 	/**
       
   113 	Set the gain.
       
   114 	@param aGain The specified gain value.
       
   115 	*/
       
   116 	virtual void SetGain(TUint aGain) = 0;
       
   117 
       
   118 	/**
       
   119 	Get the gain value.
       
   120 	*/
       
   121 	virtual TUint Gain() = 0;
       
   122 
       
   123 	/**
       
   124 	Get the number of bytes recorded.
       
   125 	*/
       
   126 	virtual TUint BytesRecorded() = 0; 
       
   127 	};
       
   128 /**
       
   129 Custom interface class for emptying the play buffers before playing.
       
   130 */
       
   131 class MEmptyBuffersCustomInterface
       
   132 	{
       
   133 public:
       
   134 	/**
       
   135 	Empties the play buffers.
       
   136 	@return An error code indicating if the function call was successful. KErrNone on success, KErrNotReady 
       
   137 			if the device is not ready, otherwise another of the system-wide error codes.
       
   138 	*/
       
   139 	virtual TInt EmptyBuffers() = 0;
       
   140 	};
       
   141 
       
   142 /**
       
   143 Custom interface class for setting VBR flag.
       
   144 */
       
   145 class MSetVbrFlagCustomInterface
       
   146 	{
       
   147 public:
       
   148 	/**
       
   149 	Sets the VBR flag to ETrue.
       
   150 	*/
       
   151 	virtual void SetVbrFlag() = 0;
       
   152 	};
       
   153 
       
   154 /**
       
   155 Custom interface class for querying current play time from the audio renderer.
       
   156 */
       
   157 class MTimePlayedCustomInterface
       
   158 	{
       
   159 public:
       
   160 	/**
       
   161 	Gets the current play time from the sound driver.
       
   162 	@param aTime A reference to TTimeIntervalMicroSeconds object which is filled with the current play time.
       
   163 	@return An error code indicating if the function call was successful. KErrNone on success
       
   164 	*/
       
   165 	virtual TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime) = 0;
       
   166 	};	
       
   167 
       
   168 /**
       
   169 Custom interface class for configuring hardware device to ignore all the underflow events from the sound driver 
       
   170 except for the last buffer.
       
   171 */
       
   172 class MIgnoreUnderflowEventsCustomInterface
       
   173 	{
       
   174 public:
       
   175 	/**
       
   176 	Configures the hardware device such that it ignores all the underflow events from the sound driver.
       
   177 	However, it propagates the underflow error to devsound when the last buffer flag is set.
       
   178 	*/
       
   179 	virtual void IgnoreUnderflowEvents() = 0;
       
   180 	};
       
   181 #endif // MMFHWDEVICESETUP_H