sl@0: // Copyright (c) 2007-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 DEVSOUNDADAPTATIONINFO_H sl@0: #define DEVSOUNDADAPTATIONINFO_H sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: @file sl@0: */ sl@0: sl@0: // INCLUDES sl@0: sl@0: #include <e32std.h> sl@0: #include <e32base.h> sl@0: #include <a3f/a3ffourcclookup.h> sl@0: sl@0: class MA3FDevSoundAdaptationInfoObserver; sl@0: sl@0: const TUid KTruePauseCustomInterfaceTypeUid = {0x1028643F}; sl@0: sl@0: /** sl@0: Custom interface class for query a3f adaptation about if resume is supported sl@0: */ sl@0: class MTruePauseCustomInterface sl@0: { sl@0: public: sl@0: /** sl@0: Returns ETrue when True Pause is supported. sl@0: */ sl@0: virtual TBool IsResumeSupported(TUid aCodecType, TUid aFormat) = 0; sl@0: }; sl@0: sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: An interface to a A3FDevsoundAdaptationInfo. sl@0: A3FDevSoundAdaptationInfo is a replacable component that should correspond to the underlying sl@0: A3F adaptation, and provides information to the DevSound Adaptor information it cannot otherwise sl@0: obtain. If the underlying A3F adaptation changes, then potentially so should the implementation of sl@0: A3FDevSoundAdaptationInfo. Additionally the MaxGain and MaxVolume values should be set to reflect sl@0: those required for the specific product. sl@0: @lib devsoundadaptationinfo.lib sl@0: */ sl@0: class CA3FDevSoundAdaptationInfo : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: Constructs and returns a pointer to a new CA3FDevSoundAdaptationInfo object. sl@0: Leaves on failure. sl@0: @return CA3FDevSoundAdaptationInfo* - on success, pointer to new class instance. sl@0: This call returns ownership, as in the standard NewL() pattern sl@0: */ sl@0: IMPORT_C static CA3FDevSoundAdaptationInfo* NewL(MA3FDevSoundAdaptationInfoObserver& aAdaptationInfoObserver, CFourCCConvertor& aFourCcConvertor); sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: ~CA3FDevSoundAdaptationInfo(); sl@0: sl@0: /** sl@0: Requests Maximun Valid Gain/Volume. This is an asynchronous call. If error return is KErrNone, sl@0: the result will be returned in subsequent RequestMaxGainComplete() call. sl@0: @param aCodecType KUidAudioEncoder for MaxGain, KUidAudioDecoder for MaxVolume sl@0: @return KErrNone if successfull, else corresponding error code sl@0: */ sl@0: virtual TInt RequestMaxGain(TUid aCodecType)=0; sl@0: sl@0: sl@0: /** sl@0: Requests a list of supported FourCC codes. This is an asynchronous call. If error return is KErrNone, sl@0: the completion will be indicated by RequestSupportedFormatsComplete(). sl@0: @param aCodecType KUidAudioEncoder for supported encoder formats, KUidAudioDecoder for supported decoder formats sl@0: @param aSupportedFormats The results are appended to this array. sl@0: @return KErrNone if successfull, else corresponding error code sl@0: */ sl@0: virtual TInt RequestSupportedFormats(TUid aCodecType, RArray<TUid>& aSupportedFormats)=0; sl@0: sl@0: /** sl@0: Queries A3F adaptation about if True Pause is supported sl@0: the completion will be indicated by RequestSupportedFormatsComplete(). sl@0: @param aCodecType KUidAudioEncoder for encoder format, KUidAudioDecoder for decoder format sl@0: @param aFormat The format to be queried sl@0: @return ETrue if True Pause is supported, EFalse otherwise sl@0: */ sl@0: inline TBool IsResumeSupported(TUid aCodecType, TUid aFormat); sl@0: sl@0: sl@0: protected: sl@0: /** sl@0: Constructor sl@0: */ sl@0: CA3FDevSoundAdaptationInfo(); sl@0: }; sl@0: sl@0: inline TBool CA3FDevSoundAdaptationInfo::IsResumeSupported(TUid aCodecType, TUid aFormat) sl@0: { sl@0: TBool supported = EFalse; sl@0: sl@0: // Extension pattern sl@0: TAny* interface = NULL; sl@0: TInt err = Extension_(KTruePauseCustomInterfaceTypeUid.iUid, interface, NULL); sl@0: if(err == KErrNone) sl@0: { sl@0: MTruePauseCustomInterface* truePause = static_cast<MTruePauseCustomInterface*>(interface); sl@0: supported = truePause->IsResumeSupported(aCodecType, aFormat); sl@0: } sl@0: return supported; sl@0: } sl@0: sl@0: #endif // DEVSOUNDADAPTATIONINFO_H sl@0: sl@0: //end of file sl@0: