devsound/devsoundrefplugin/src/platsec/client/MmfDevSoundProxy.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2004-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 #ifndef __MMFDEVSOUNDPROXY_H__
       
    17 #define __MMFDEVSOUNDPROXY_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <e32std.h>
       
    21 #include <mmf/common/mmfipc.h>
       
    22 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    23 #include <mmf/common/mmfipcserver.h>
       
    24 #endif
       
    25 #include "MmfAudioClientServer.h"
       
    26 #include "MmfAudioServerProxy.h"
       
    27 
       
    28 
       
    29 /** 
       
    30 Panic category and codes for the MmfDevSoundProxy
       
    31 @internalTechnology
       
    32 */
       
    33 _LIT(KMMFDevSoundProxyPanicCategory, "MmfDevSoundProxy");
       
    34 enum TMMFDevSoundProxyPanicCodes
       
    35 	{
       
    36 	EMMFDevSoundProxyPlayDataWithoutInitialize,
       
    37 	EMMFDevSoundProxyRecordDataWithoutInitialize,
       
    38 	EMMFDevSoundProxyConvertDataWithoutInitialize
       
    39 	};
       
    40 	
       
    41 class RMMFDevSoundProxy; // declared here.
       
    42 
       
    43 NONSHARABLE_CLASS( RMMFDevSoundProxy ): public RMmfSessionBase 
       
    44 /**
       
    45 *@internalTechnology
       
    46 */
       
    47 	{
       
    48 public:
       
    49 
       
    50 	IMPORT_C RMMFDevSoundProxy();
       
    51 	IMPORT_C TInt Open(RHandleBase& aMsgQueueHandle);
       
    52 	IMPORT_C TInt SetDevSoundInfo();
       
    53 	IMPORT_C TInt InitializeL(TMMFState aMode);
       
    54 	IMPORT_C TInt InitializeL(TUid aHWDev, TMMFState aMode);
       
    55 	IMPORT_C TInt InitializeL(TFourCC aDesiredFourCC, TMMFState aMode);
       
    56 	IMPORT_C TMMFCapabilities Capabilities();
       
    57 	IMPORT_C TMMFCapabilities Config();
       
    58 	IMPORT_C TInt SetConfigL(const TMMFCapabilities& aConfig);
       
    59 	IMPORT_C TInt MaxVolume();
       
    60 	IMPORT_C TInt Volume();
       
    61 	IMPORT_C TInt SetVolume(TInt aVolume);
       
    62 	IMPORT_C TInt MaxGain();
       
    63 	IMPORT_C TInt Gain();
       
    64 	IMPORT_C TInt SetGain(TInt aGain);
       
    65 	IMPORT_C void GetPlayBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage);
       
    66 	IMPORT_C void SetPlayBalanceL(TInt aLeftPercentage, TInt aRightPercentage);
       
    67 	IMPORT_C void GetRecordBalanceL(TInt& aLeftPercentage, TInt& aRightPercentage);
       
    68 	IMPORT_C void SetRecordBalanceL(TInt aLeftPercentage, TInt aRightPercentage);
       
    69 	IMPORT_C void Close();
       
    70 	IMPORT_C void PlayInitL();
       
    71 	IMPORT_C void RecordInitL();
       
    72 	IMPORT_C void PlayData();
       
    73 	IMPORT_C void RecordData();
       
    74 	IMPORT_C void Stop();
       
    75 	IMPORT_C void Pause();
       
    76 	IMPORT_C void PlayToneL(TInt aFrequency, const TTimeIntervalMicroSeconds& aDuration);
       
    77 	IMPORT_C void PlayDualToneL(TInt aFrequencyOne, TInt aFrequencyTwo, const TTimeIntervalMicroSeconds& aDuration);
       
    78 	IMPORT_C void PlayDTMFStringL(const TDesC& aDTMFString);
       
    79 	IMPORT_C void PlayToneSequenceL(const TDesC8& aData);
       
    80 	IMPORT_C void PlayFixedSequenceL(TInt aSequenceNumber);
       
    81 	IMPORT_C void SetDTMFLengths(TTimeIntervalMicroSeconds32& aToneOnLength,
       
    82 								 TTimeIntervalMicroSeconds32& aToneOffLength,
       
    83 								 TTimeIntervalMicroSeconds32& aPauseLength);
       
    84 	IMPORT_C void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
       
    85 	IMPORT_C void GetSupportedInputDataTypesL(RArray<TFourCC>& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings);
       
    86 	IMPORT_C void GetSupportedOutputDataTypesL(RArray<TFourCC>& aSupportedDataTypes, const TMMFPrioritySettings& aPrioritySettings);
       
    87 	IMPORT_C TInt SamplesRecorded();
       
    88 	IMPORT_C TInt SamplesPlayed();
       
    89 	IMPORT_C void SetToneRepeats(TInt aRepeatCount, const TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
       
    90 	IMPORT_C void SetPrioritySettings(const TMMFPrioritySettings& aPrioritySettings);
       
    91 	IMPORT_C const TDesC& FixedSequenceName(TInt aSequenceNumber);
       
    92 	IMPORT_C TAny* CustomInterface(TUid aInterfaceId);
       
    93 	IMPORT_C TInt FixedSequenceCount();
       
    94 
       
    95 	IMPORT_C TInt BufferToBeFilledData(TMMFDevSoundProxyHwBufPckg& aSetPckg);
       
    96 	IMPORT_C TInt BufferToBeEmptiedData(TMMFDevSoundProxyHwBufPckg& aSetPckg);
       
    97 
       
    98 	IMPORT_C void CancelReceiveEvents();
       
    99 	IMPORT_C void SetBuffer(CMMFDataBuffer* aBuffer);
       
   100 	IMPORT_C TInt GetRecordedBufferL(CMMFDataBuffer& aBuffer);
       
   101 
       
   102 	IMPORT_C TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8);
       
   103 	IMPORT_C TInt CancelRegisterAsClient(TUid aEventType);
       
   104 	IMPORT_C TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData);
       
   105 	IMPORT_C TInt WillResumePlay();
       
   106 	IMPORT_C TInt EmptyBuffers();
       
   107 	
       
   108 	IMPORT_C TInt SyncCustomCommand(TUid aUid, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
       
   109 	IMPORT_C void AsyncCustomCommand(TUid aUid, TRequestStatus& aStatus, const TDesC8& aParam1, const TDesC8& aParam2, TDes8* aOutParam);
       
   110 	IMPORT_C TInt SetClientThreadInfo(TThreadId& aTid);
       
   111 	IMPORT_C TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime);
       
   112 	
       
   113 private:
       
   114 	TMMFDevSoundProxySettingsPckg iDspsPckg;
       
   115 	CMMFDataBuffer* iBuffer;
       
   116 	HBufC* iSeqName;
       
   117 	enum TState
       
   118 		{
       
   119 		EIdle=0,
       
   120 		EPlaying,
       
   121 		ERecording,
       
   122 		EConverting
       
   123 		};
       
   124 	TState iState;
       
   125 	RHandleBase* iMsgQueueHandle;
       
   126 	RMMFAudioServerProxy* iAudioServerProxy;
       
   127 	};
       
   128 
       
   129 #endif