sl@0: // Copyright (c) 2004-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 __MMFDEVSOUNDPROXY_H__ sl@0: #define __MMFDEVSOUNDPROXY_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: #include "MmfAudioClientServer.h" sl@0: #include "MmfAudioServerProxy.h" sl@0: sl@0: sl@0: /** sl@0: Panic category and codes for the MmfDevSoundProxy sl@0: @internalTechnology sl@0: */ sl@0: _LIT(KMMFDevSoundProxyPanicCategory, "MmfDevSoundProxy"); sl@0: enum TMMFDevSoundProxyPanicCodes sl@0: { sl@0: EMMFDevSoundProxyPlayDataWithoutInitialize, sl@0: EMMFDevSoundProxyRecordDataWithoutInitialize, sl@0: EMMFDevSoundProxyConvertDataWithoutInitialize sl@0: }; sl@0: sl@0: class RMMFDevSoundProxy; // declared here. sl@0: sl@0: NONSHARABLE_CLASS( RMMFDevSoundProxy ): public RMmfSessionBase sl@0: /** sl@0: *@internalTechnology sl@0: */ sl@0: { sl@0: public: sl@0: sl@0: IMPORT_C RMMFDevSoundProxy(); sl@0: IMPORT_C TInt Open(RHandleBase& aMsgQueueHandle); sl@0: IMPORT_C TInt SetDevSoundInfo(); sl@0: IMPORT_C TInt InitializeL(TMMFState aMode); sl@0: IMPORT_C TInt InitializeL(TUid aHWDev, TMMFState aMode); sl@0: IMPORT_C TInt InitializeL(TFourCC aDesiredFourCC, TMMFState aMode); sl@0: IMPORT_C TMMFCapabilities Capabilities(); sl@0: IMPORT_C TMMFCapabilities Config(); sl@0: IMPORT_C TInt SetConfigL(const TMMFCapabilities& aConfig); sl@0: IMPORT_C TInt MaxVolume(); sl@0: IMPORT_C TInt Volume(); sl@0: IMPORT_C TInt SetVolume(TInt aVolume); sl@0: IMPORT_C TInt MaxGain(); sl@0: IMPORT_C TInt Gain(); sl@0: IMPORT_C TInt SetGain(TInt aGain); sl@0: IMPORT_C void GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); sl@0: IMPORT_C void SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage); sl@0: IMPORT_C void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage); sl@0: IMPORT_C void SetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage); sl@0: IMPORT_C void Close(); sl@0: IMPORT_C void PlayInitL(); sl@0: IMPORT_C void RecordInitL(); sl@0: IMPORT_C void PlayData(); sl@0: IMPORT_C void RecordData(); sl@0: IMPORT_C void Stop(); sl@0: IMPORT_C void Pause(); sl@0: IMPORT_C void PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration); sl@0: IMPORT_C void PlayDualToneL(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration); sl@0: IMPORT_C void PlayDTMFStringL(const TDesC& aDTMFString); sl@0: IMPORT_C void PlayToneSequenceL(const TDesC8& aData); sl@0: IMPORT_C void PlayFixedSequenceL(TInt aSequenceNumber); sl@0: IMPORT_C void SetDTMFLengths(TTimeIntervalMicroSeconds32& aToneOnLength, sl@0: TTimeIntervalMicroSeconds32& aToneOffLength, sl@0: TTimeIntervalMicroSeconds32& aPauseLength); sl@0: IMPORT_C void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); sl@0: IMPORT_C void GetSupportedInputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings); sl@0: IMPORT_C void GetSupportedOutputDataTypesL(RArray& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings); sl@0: IMPORT_C TInt SamplesRecorded(); sl@0: IMPORT_C TInt SamplesPlayed(); sl@0: IMPORT_C void SetToneRepeats(TInt aRepeatCount, const TTimeIntervalMicroSeconds& aRepeatTrailingSilence); sl@0: IMPORT_C void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings); sl@0: IMPORT_C const TDesC& FixedSequenceName(TInt aSequenceNumber); sl@0: IMPORT_C TAny* CustomInterface(TUid aInterfaceId); sl@0: IMPORT_C TInt FixedSequenceCount(); sl@0: sl@0: IMPORT_C TInt BufferToBeFilledData(TMMFDevSoundProxyHwBufPckg& aSetPckg); sl@0: IMPORT_C TInt BufferToBeEmptiedData(TMMFDevSoundProxyHwBufPckg& aSetPckg); sl@0: sl@0: IMPORT_C void CancelReceiveEvents(); sl@0: IMPORT_C void SetBuffer(CMMFDataBuffer* aBuffer); sl@0: IMPORT_C TInt GetRecordedBufferL(CMMFDataBuffer& aBuffer); sl@0: sl@0: IMPORT_C TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8); sl@0: IMPORT_C TInt CancelRegisterAsClient(TUid aEventType); sl@0: IMPORT_C TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData); sl@0: IMPORT_C TInt WillResumePlay(); sl@0: IMPORT_C TInt EmptyBuffers(); sl@0: sl@0: IMPORT_C TInt SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam); sl@0: IMPORT_C void AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam); sl@0: IMPORT_C TInt SetClientThreadInfo(TThreadId& aTid); sl@0: IMPORT_C TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime); sl@0: sl@0: private: sl@0: TMMFDevSoundProxySettingsPckg iDspsPckg; sl@0: CMMFDataBuffer* iBuffer; sl@0: HBufC* iSeqName; sl@0: enum TState sl@0: { sl@0: EIdle=0, sl@0: EPlaying, sl@0: ERecording, sl@0: EConverting sl@0: }; sl@0: TState iState; sl@0: RHandleBase* iMsgQueueHandle; sl@0: RMMFAudioServerProxy* iAudioServerProxy; sl@0: }; sl@0: sl@0: #endif