sl@0: 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 DEVSOUNDPLUGIN_H sl@0: #define DEVSOUNDPLUGIN_H sl@0: sl@0: _LIT8(KDevSoundPluginMatchString, "*"); // ECom insists on something sl@0: sl@0: /** sl@0: Interface class used in the plugin implementation of DevSound. sl@0: The CMMFDevSound implementation loads a plugin based on this interface class. sl@0: Once this has been constructed, calls to method functions of CMMFDevSound are passed sl@0: verbatim to this interface. For further description of required functionality, sl@0: see CMMFDevSound. sl@0: sl@0: @see CMMFDevSound sl@0: */ sl@0: sl@0: class MMMFDevSoundPlugin sl@0: { sl@0: public: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::~CMMFDevSound() sl@0: sl@0: @see CMMFDevSound::~CMMFDevSound() sl@0: */ sl@0: virtual ~MMMFDevSoundPlugin() {} sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TMMFState aMode) sl@0: sl@0: @param aDevSoundObserver sl@0: A reference to DevSound Observer instance. sl@0: @param aMode sl@0: The mode for which this object will be used. sl@0: sl@0: @see CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TMMFState aMode) sl@0: */ sl@0: virtual void InitializeL(MDevSoundObserver& aDevSoundObserver, TMMFState aMode)=0; sl@0: sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode) sl@0: sl@0: @param aDevSoundObserver sl@0: A reference to DevSound Observer instance. sl@0: @param aHWDev sl@0: The CMMFHwDevice implementation identifier. sl@0: @param aMode sl@0: The mode for which this object will be used. sl@0: sl@0: @see CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode) sl@0: */ sl@0: virtual void InitializeL(MDevSoundObserver& aDevSoundObserver, TUid aHWDev, TMMFState aMode)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TFourCC aDesiredFourCC, TMMFState aMode) sl@0: sl@0: @param aDevSoundObserver sl@0: A reference to DevSound Observer instance. sl@0: @param aDesiredFourCC sl@0: The CMMFHwDevice implementation FourCC code. sl@0: @param aMode sl@0: The mode for which this object will be used. sl@0: sl@0: @see CMMFDevSound::InitializeL(MDevSoundObserver& aDevSoundObserver, TFourCC aDesiredFourCC, TMMFState aMode) sl@0: */ sl@0: virtual void InitializeL(MDevSoundObserver& aDevSoundObserver, TFourCC aDesiredFourCC, TMMFState aMode)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Capabilities() sl@0: sl@0: @return The device settings. sl@0: sl@0: @see CMMFDevSound::Capabilities() sl@0: */ sl@0: virtual TMMFCapabilities Capabilities()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Config() sl@0: sl@0: @return The device settings. sl@0: sl@0: @see CMMFDevSound::Config() sl@0: */ sl@0: virtual TMMFCapabilities Config() const=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::SetConfigL(const TMMFCapabilities& aCaps) sl@0: sl@0: @param aCaps The attribute values to which CMMFDevSound object will be configured to. sl@0: sl@0: @see CMMFDevSound::SetConfigL(const TMMFCapabilities& aCaps) sl@0: */ sl@0: virtual void SetConfigL(const TMMFCapabilities& aCaps)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::MaxVolume() sl@0: sl@0: @return The maximum volume. This value is platform dependent but is always greater than or equal sl@0: to one. sl@0: sl@0: @see CMMFDevSound::MaxVolume() sl@0: */ sl@0: virtual TInt MaxVolume()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Volume() sl@0: sl@0: @return The current volume level. sl@0: sl@0: @see CMMFDevSound::Volume() sl@0: */ sl@0: virtual TInt Volume()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::SetVolume() sl@0: sl@0: @param aVolume sl@0: The volume setting. This can be any value from 0 to the value sl@0: returned by a call to CMMFDevSound::MaxVolume(). If the sl@0: volume is not within this range, the volume is automatically set to sl@0: minimum or maximum value based on the value that is being passed. sl@0: Setting a zero value mutes the sound. Setting the maximum value sl@0: results in the loudest possible sound. sl@0: sl@0: @see CMMFDevSound::SetVolume() sl@0: */ sl@0: virtual void SetVolume(TInt aVolume)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::MaxGain() sl@0: sl@0: @return The maximum gain. This value is platform dependent but is always greater than or equal sl@0: to one. sl@0: sl@0: @see CMMFDevSound::MaxGain() sl@0: */ sl@0: virtual TInt MaxGain()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Gain() sl@0: sl@0: @return The current gain level. sl@0: sl@0: @see CMMFDevSound::Gain() sl@0: */ sl@0: virtual TInt Gain()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::SetGain() sl@0: sl@0: @param aGain sl@0: The gain setting. This can be any value from zero to the value sl@0: returned by a call to CMMFDevSound::MaxGain(). If the sl@0: volume is not within this range, the gain is automatically set to sl@0: minimum or maximum value based on the value that is being passed. sl@0: Setting a zero value mutes the sound. Setting the maximum value sl@0: results in the loudest possible sound. sl@0: @see CMMFDevSound::SetGain() sl@0: */ sl@0: virtual void SetGain(TInt aGain)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage) sl@0: sl@0: @param aLeftPercentage sl@0: On return contains the left speaker volume percentage. sl@0: @param aRightPercentage sl@0: On return contains the right speaker volume percentage. sl@0: sl@0: @see CMMFDevSound::GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage) sl@0: */ sl@0: virtual void GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage) sl@0: sl@0: @param aLeftPercentage sl@0: On return contains left speaker volume perecentage. This can be any sl@0: value from zero to 100. Setting a zero value mutes the sound on left sl@0: speaker. sl@0: @param aRightPercentage sl@0: On return contains right speaker volume perecentage. This can be any sl@0: value from zero to 100. Setting a zero value mutes the sound on sl@0: right speaker. sl@0: sl@0: @see CMMFDevSound::SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage) sl@0: */ sl@0: virtual void SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage) sl@0: sl@0: @param aLeftPercentage sl@0: On return contains the left microphone gain percentage. sl@0: @param aRightPercentage sl@0: On return contains the right microphone gain percentage. sl@0: sl@0: @see CMMFDevSound::GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage) sl@0: */ sl@0: virtual void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::GetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage) sl@0: sl@0: @param aLeftPercentage sl@0: The left microphone gain precentage. This can be any value from zero to sl@0: 100. Setting a zero value mutes the gain on left microphone. sl@0: @param aRightPercentage sl@0: The right microphone gain precentage. This can be any value from zero to sl@0: 100. Setting a zero value mutes the gain on right microphone. sl@0: sl@0: @see CMMFDevSound::GetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage) sl@0: */ sl@0: virtual void SetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::PlayInitL() sl@0: sl@0: @see CMMFDevSound::PlayInitL() sl@0: */ sl@0: virtual void PlayInitL()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::RecordInitL() sl@0: sl@0: @see CMMFDevSound::RecordInitL() sl@0: */ sl@0: virtual void RecordInitL()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::PlayData() sl@0: sl@0: @see CMMFDevSound::PlayData() sl@0: */ sl@0: virtual void PlayData()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::RecordData() sl@0: sl@0: @see CMMFDevSound::RecordData() sl@0: */ sl@0: virtual void RecordData()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Stop() sl@0: sl@0: @see CMMFDevSound::Stop() sl@0: */ sl@0: virtual void Stop()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::Pause() sl@0: sl@0: @see CMMFDevSound::Pause() sl@0: */ sl@0: virtual void Pause()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::SamplesRecorded() sl@0: sl@0: @return The samples recorded. sl@0: sl@0: @see CMMFDevSound::SamplesRecorded() sl@0: */ sl@0: virtual TInt SamplesRecorded()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::SamplesPlayed() sl@0: sl@0: @return The samples played. sl@0: sl@0: @see CMMFDevSound::SamplesPlayed() sl@0: */ sl@0: virtual TInt SamplesPlayed()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration) sl@0: sl@0: @param aFrequency sl@0: The frequency at which the tone will be played. sl@0: @param aDuration sl@0: The period over which the tone will be played. A zero value causes sl@0: the no tone to be played. sl@0: sl@0: @see CMMFDevSound::PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration) sl@0: */ sl@0: virtual void PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::PlayDualToneL(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration) sl@0: sl@0: @param aFrequencyOne sl@0: The first frequency of dual tone. sl@0: @param aFrequencyTwo sl@0: The second frequency of dual tone sl@0: @param aDuration sl@0: The period over which the tone will be played. A zero value causes sl@0: the no tone to be played (Verify this with test app). sl@0: sl@0: @see CMMFDevSound::PlayDualToneL(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration) sl@0: */ sl@0: virtual void PlayDualToneL(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::PlayDTMFStringL(const TDesC& aDTMFString) sl@0: sl@0: @param aDTMFString The DTMF sequence in a descriptor. sl@0: sl@0: @see CMMFDevSound::PlayDTMFStringL(const TDesC& aDTMFString) sl@0: */ sl@0: virtual void PlayDTMFStringL(const TDesC& aDTMFString)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::PlayToneSequenceL(const TDesC8& aData) sl@0: sl@0: @param aData The tone sequence in a descriptor. sl@0: sl@0: @see CMMFDevSound::PlayToneSequenceL(const TDesC8& aData) sl@0: */ sl@0: virtual void PlayToneSequenceL(const TDesC8& aData)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::PlayFixedSequenceL(TInt aSequenceNumber) sl@0: sl@0: @param aSequenceNumber sl@0: The index identifying the specific pre-defined tone sequence. Index sl@0: values are relative to zero. sl@0: This can be any value from zero to the value returned by a call to sl@0: FixedSequenceCount() - 1. sl@0: The function raises a panic if the sequence number is not within this sl@0: range. sl@0: sl@0: @see CMMFDevSound::PlayFixedSequenceL(TInt aSequenceNumber) sl@0: @see FixedSequenceCount() sl@0: */ sl@0: virtual void PlayFixedSequenceL(TInt aSequenceNumber)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::SetToneRepeats(TInt aRepeatCount, sl@0: const TTimeIntervalMicroSeconds& aRepeatTrailingSilence) sl@0: sl@0: @param aRepeatCount sl@0: The number of times the tone, together with the trailing silence, sl@0: is to be repeated. If this is set to KMdaRepeatForever, then the sl@0: tone, together with the trailing silence, is repeated indefinitely sl@0: or until Stop() is called. If this is set to zero, then the tone is sl@0: not repeated. sl@0: @param aRepeatTrailingSilence sl@0: An interval of silence which will be played after each tone. sl@0: Supported only during tone playing. sl@0: sl@0: @see CMMFDevSound::SetToneRepeats(TInt aRepeatCount, sl@0: const TTimeIntervalMicroSeconds& aRepeatTrailingSilence) sl@0: */ sl@0: virtual void SetToneRepeats(TInt aRepeatCount, sl@0: const TTimeIntervalMicroSeconds& aRepeatTrailingSilence)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::(TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength) sl@0: sl@0: @param aToneOnLength sl@0: The period over which the tone will be played. If this is set to sl@0: zero, then the tone is not played. sl@0: @param aToneOffLength sl@0: The period over which the no tone will be played. sl@0: @param aPauseLength sl@0: The period over which the tone playing will be paused. sl@0: sl@0: @see CMMFDevSound::(TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength) sl@0: */ sl@0: virtual void SetDTMFLengths(TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) sl@0: sl@0: @param aRampDuration sl@0: The period over which the volume is to rise. A zero value causes sl@0: the tone sample to be played at the normal level for the full sl@0: duration of the playback. A value, which is longer than the duration sl@0: of the tone sample means that the sample never reaches its normal sl@0: volume level. sl@0: sl@0: @see CMMFDevSound::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) sl@0: */ sl@0: virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) sl@0: sl@0: @param aPrioritySettings sl@0: A class type representing the client's priority, priority preference and state. sl@0: sl@0: @see CMMFDevSound::SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings) sl@0: */ sl@0: virtual void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::CustomInterface(TUid aInterfaceId) sl@0: sl@0: @param aInterfaceId sl@0: The interface UID, defined with the custom interface. sl@0: sl@0: @return A pointer to the interface implementation, or NULL if the device does not sl@0: implement the interface requested. The return value must be cast to the sl@0: correct type by the user.The user should be careful while caching the custom interface pointer, sl@0: as in some situations the lower level custom interface pointer may become NULL sl@0: sl@0: @see CMMFDevSound::CustomInterface(TUid aInterfaceId) sl@0: */ sl@0: virtual TAny* CustomInterface(TUid aInterfaceId)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::FixedSequenceCount() sl@0: sl@0: @return The fixed sequence count. This value is implementation dependent but is always greater sl@0: than or equal to zero. sl@0: sl@0: @see CMMFDevSound::FixedSequenceCount() sl@0: */ sl@0: virtual TInt FixedSequenceCount()=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by CMMFDevSound::FixedSequenceName(TInt aSequenceNumber) sl@0: sl@0: @param aSequenceNumber sl@0: The index identifying the specific pre-defined tone sequence. Index values are relative sl@0: to zero. This can be any value from zero to the value returned by a call to sl@0: FixedSequenceCount() - 1. sl@0: The function raises a panic if sequence number is not within this sl@0: range. sl@0: sl@0: @return A reference to a Descriptor containing the fixed sequence name indexed by sl@0: aSequenceNumber. sl@0: sl@0: @see CMMFDevSound::FixedSequenceName(TInt aSequenceNumber) sl@0: @see FixedSequenceCount() sl@0: */ sl@0: virtual const TDesC& FixedSequenceName(TInt aSequenceNumber)=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::GetSupportedInputDataTypesL(RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const sl@0: sl@0: @param aSupportedDataTypes sl@0: The array of supported data types that will be filled in by this function. sl@0: The supported data types of the DevSound are in the form of an array sl@0: of TFourCC codes. Any existing entries in the array will be overwritten on sl@0: calling this function. If no supported data types are found given the priority sl@0: settings, then the aSupportedDatatypes array will have zero entries. sl@0: @param aPrioritySettings sl@0: The priority settings used to determine the supported datatypes. Note this sl@0: does not set the priority settings. For input datatypes the iState member sl@0: of the priority settings would be expected to be either sl@0: EMMFStatePlaying or EMMFStatePlayingRecording. The priority settings may sl@0: effect the supported datatypes depending on the audio routing. sl@0: sl@0: @see CMMFDevSound::GetSupportedInputDataTypesL(RArray& aSupportedDataTypes, sl@0: const TMMFPrioritySettings& aPrioritySettings) const sl@0: */ sl@0: virtual void GetSupportedInputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings) const=0; sl@0: sl@0: /** sl@0: This must provide an implementation as defined by sl@0: CMMFDevSound::GetSupportedOutputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings) const sl@0: sl@0: @param aSupportedDataTypes sl@0: The array of supported data types that will be filled in by this function. sl@0: The supported datatypes of the DevSound are in the form of an array sl@0: of TFourCC codes. sl@0: Any existing entries in the array will be overwritten on calling this function. sl@0: If no supported datatypes are found given the priority settings, then sl@0: the aSupportedDatatypes array will have zero entries. sl@0: @param aPrioritySettings sl@0: The priority settings used to determine the supported data types. Note this sl@0: does not set the priority settings. For output data types the iState member sl@0: of the priority settings would expected to be either sl@0: EMMFStateRecording or EMMFStatePlayingRecording. The priority settings may sl@0: effect the supported datatypes depending on the audio routing. sl@0: sl@0: @see CMMFDevSound::GetSupportedOutputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings) const sl@0: */ sl@0: virtual void GetSupportedOutputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings) const=0; sl@0: sl@0: }; sl@0: sl@0: #endif // DEVSOUNDPLUGIN_H