os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfAudioClientServer.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 MMFAUDIOCLIENTSERVER_H
    17 #define MMFAUDIOCLIENTSERVER_H
    18 
    19 #include <mmf/common/mmfutilities.h>
    20 #include <mmf/common/mmfbase.h>
    21 #include <mmf/server/sounddevice.h>
    22 
    23 // opcodes used in message passing between client and server
    24 enum TMMFAudioServerRequest
    25 	{
    26 	EMMFAudioLaunchRequests,
    27 	EMMFDevSoundSessionHandle
    28 	};
    29 
    30 enum TMMFDevSoundProxyRequest
    31 	{
    32 	EMMFDevSoundProxyInitialize1,
    33 	EMMFDevSoundProxyInitialize2,
    34 	EMMFDevSoundProxyInitialize3,
    35 	EMMFDevSoundProxyInitialize4,
    36 	EMMFDevSoundProxyCapabilities,
    37 	EMMFDevSoundProxyConfig,
    38 	EMMFDevSoundProxySetConfig,
    39 	EMMFDevSoundProxyMaxVolume,
    40 	EMMFDevSoundProxyVolume,
    41 	EMMFDevSoundProxySetVolume,
    42 	EMMFDevSoundProxyMaxGain,
    43 	EMMFDevSoundProxyGain,
    44 	EMMFDevSoundProxySetGain,
    45 	EMMFDevSoundProxyPlayBalance,
    46 	EMMFDevSoundProxySetPlayBalance,
    47 	EMMFDevSoundProxyRecordBalance,
    48 	EMMFDevSoundProxySetRecordBalance,
    49 	EMMFDevSoundProxyICEvent,
    50 	EMMFDevSoundProxyBTBFEvent,
    51 	EMMFDevSoundProxyBTBEEvent,
    52 	EMMFDevSoundProxyPEEvent,
    53 	EMMFDevSoundProxyREEvent,
    54 	EMMFDevSoundProxyTFEvent,
    55 	EMMFDevSoundProxySETCEvent,
    56 	EMMFDevSoundProxyPlayInit,
    57 	EMMFDevSoundProxyRecordInit,
    58 	EMMFDevSoundProxyPlayData,
    59 	EMMFDevSoundProxyRecordData,
    60 	EMMFDevSoundProxyStop,
    61 	EMMFDevSoundProxyPause,
    62 	EMMFDevSoundProxyPlayTone,
    63 	EMMFDevSoundProxyPlayDualTone,
    64 	EMMFDevSoundProxyPlayDTMFString,
    65 	EMMFDevSoundProxyPlayDTMFStringLength,
    66 	EMMFDevSoundProxyPlayToneSequence,
    67 	EMMFDevSoundProxyPlayFixedSequence,
    68 	EMMFDevSoundProxySetDTMFLengths,
    69 	EMMFDevSoundProxySetVolumeRamp,
    70 	EMMFDevSoundProxyGetSupportedInputDataTypes,
    71 	EMMFDevSoundProxyGetSupportedOutputDataTypes,
    72 	EMMFDevSoundProxyCopyFourCCArrayData,
    73 	EMMFDevSoundProxyGetRecordedBuffer,
    74 	EMMFDevSoundProxySamplesRecorded,
    75 	EMMFDevSoundProxySamplesPlayed,
    76 	EMMFDevSoundProxySetToneRepeats,
    77 	EMMFDevSoundProxySetPrioritySettings,
    78 	EMMFDevSoundProxyFixedSequenceName,
    79 	EMMFDevSoundProxyCustomInterface,
    80 	EMMFDevSoundProxyFixedSequenceCount,
    81 	EMMFDevSoundProxyRequestResourceNotification,
    82 	EMMFDevSoundProxyCancelRequestResourceNotification,
    83 	EMMFDevSoundProxyGetResourceNotificationData,	
    84 	EMMFDevSoundProxyWillResumePlay,
    85 	EMMFDevSoundProxyBTBFData,
    86 	EMMFDevSoundProxyBTBEData,
    87 	EMMFDevSoundProxySyncCustomCommand,
    88 	EMMFDevSoundProxySyncCustomCommandResult,
    89 	EMMFDevSoundProxyAsyncCustomCommand,
    90 	EMMFDevSoundProxyAsyncCustomCommandResult,
    91 	EMMFDevSoundProxyEmptyBuffers,
    92 	EMMFDevSoundCustomCommandCloseMuxDemuxPair,
    93 	EMMFDevSoundProxySetClientThreadInfo,
    94 	EMMFDevSoundProxyGetTimePlayed
    95 	};
    96 
    97 class TMMFDevSoundProxyHwBuf
    98 /**
    99 *@internalTechnology
   100 */
   101 	{
   102 public:
   103 	TUid iBufferType;
   104 	TInt iRequestSize;
   105 	TBool iLastBuffer;
   106 	TUint iBufferSize;
   107 	};
   108 
   109 typedef TPckgBuf<TMMFDevSoundProxyHwBuf> TMMFDevSoundProxyHwBufPckg;
   110 
   111 
   112 class TMMFDevSoundProxySettings
   113 /**
   114 *@internalTechnology
   115 */
   116 	{
   117 public:
   118 	TMMFState iMode;
   119 	TUid iHWDev;
   120 	TFourCC iDesiredFourCC;
   121 	TMMFCapabilities iCaps;
   122 	TMMFCapabilities iConfig;
   123 	TInt iMaxVolume;
   124 	TInt iVolume;
   125 	TInt iMaxGain;
   126 	TInt iGain;
   127 	TInt iLeftPercentage;
   128 	TInt iRightPercentage;
   129 	TInt iFrequencyOne;
   130 	TInt iFrequencyTwo;
   131 	TTimeIntervalMicroSeconds iDuration;
   132 	TTimeIntervalMicroSeconds32 iToneOnLength;
   133 	TTimeIntervalMicroSeconds32 iToneOffLength;
   134 	TTimeIntervalMicroSeconds32 iPauseLength;
   135 	TUid iNotificationEventUid;
   136 	};
   137 
   138 
   139 typedef TPckgBuf<TMMFDevSoundProxySettings> TMMFDevSoundProxySettingsPckg;
   140 const TInt KMaxFixedSequenceNameLength = 1024;
   141 
   142 /**
   143 *@internalTechnology
   144 * TMMFDevSoundQueueItem is used to pass asynch messages between the devsound proxy and server
   145 * for the observer's BufferToBeFilled, BufferToBeEmptied, PlayError, RecordError, ToneFinished,
   146 * InitializeComplete and SendEventToClient events.
   147 */
   148 class TMMFDevSoundQueueItem
   149 	{
   150 public:
   151 	// Would've been nice to send TMMFDevSoundProxyHwBufPckg data here too
   152 	// but that would break the message size limit
   153 	TMMFDevSoundProxyRequest	iRequest;
   154 	TMMFEventPckg				iEventPckg;	// SendEventToClient message payload
   155 	TInt						iErrorCode;	// InitComplete, ToneFinished, PlayError, RecordError message payload
   156 	};
   157 
   158 #endif