os/mm/devsound/a3fdevsound/src/mmfaudioserver/mmfaudioclientserver.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef MMFAUDIOCLIENTSERVER_H
    21 #define MMFAUDIOCLIENTSERVER_H
    22 
    23 //  INCLUDES
    24 #include <mmf/common/mmfutilities.h>
    25 #include <mmf/common/mmfbase.h>
    26 #include <mmf/server/sounddevice.h>
    27 
    28 // DATA TYPES
    29 // opcodes used in message passing between client and server
    30 enum TMMFAudioServerRequest
    31 	{
    32 	EMMFAudioLaunchRequests,
    33 	EMMFDevSoundSessionHandle
    34 	};
    35 
    36 // opcodes used in message passing between client and server for DevSound
    37 // operations.
    38 enum TMMFDevSoundProxyRequest
    39 	{
    40 	EMMFDevSoundProxyPostOpen,
    41 	EMMFDevSoundProxyInitialize1,
    42 	EMMFDevSoundProxyInitialize2,
    43 	EMMFDevSoundProxyInitialize3,
    44 	EMMFDevSoundProxyInitialize4,
    45 	EMMFDevSoundProxyCapabilities,
    46 	EMMFDevSoundProxyConfig,
    47 	EMMFDevSoundProxySetConfig,
    48 	EMMFDevSoundProxyMaxVolume,
    49 	EMMFDevSoundProxyVolume,
    50 	EMMFDevSoundProxySetVolume,
    51 	EMMFDevSoundProxyMaxGain,
    52 	EMMFDevSoundProxyGain,
    53 	EMMFDevSoundProxySetGain,
    54 	EMMFDevSoundProxyPlayBalance,
    55 	EMMFDevSoundProxySetPlayBalance,
    56 	EMMFDevSoundProxyRecordBalance,
    57 	EMMFDevSoundProxySetRecordBalance,
    58 	EMMFDevSoundProxyICEvent,
    59 	EMMFDevSoundProxyBTBFEvent,
    60 	EMMFDevSoundProxyBTBEEvent,
    61 	EMMFDevSoundProxyPEEvent,
    62 	EMMFDevSoundProxyREEvent,
    63 	EMMFDevSoundProxyTFEvent,
    64 	EMMFDevSoundProxySETCEvent,
    65 	EMMFDevSoundProxyPlayInit,
    66 	EMMFDevSoundProxyRecordInit,
    67 	EMMFDevSoundProxyPlayData,
    68 	EMMFDevSoundProxyRecordData,
    69 	EMMFDevSoundProxyStop,
    70 	EMMFDevSoundProxyPause,
    71 	EMMFDevSoundProxyPlayTone,
    72 	EMMFDevSoundProxyPlayDualTone,
    73 	EMMFDevSoundProxyPlayDTMFString,
    74 	EMMFDevSoundProxyPlayDTMFStringLength,
    75 	EMMFDevSoundProxyPlayToneSequence,
    76 	EMMFDevSoundProxyPlayFixedSequence,
    77 	EMMFDevSoundProxySetDTMFLengths,
    78 	EMMFDevSoundProxySetVolumeRamp,
    79 	EMMFDevSoundProxyGetSupportedInputDataTypes,
    80 	EMMFDevSoundProxyGetSupportedOutputDataTypes,
    81 	EMMFDevSoundProxyCopyFourCCArrayData,
    82 	EMMFDevSoundProxySamplesRecorded,
    83 	EMMFDevSoundProxySamplesPlayed,
    84 	EMMFDevSoundProxySetToneRepeats,
    85 	EMMFDevSoundProxySetPrioritySettings,
    86 	EMMFDevSoundProxyFixedSequenceName,
    87 	EMMFDevSoundProxyCustomInterface,
    88 	EMMFDevSoundProxyFixedSequenceCount,
    89 	EMMFDevSoundProxyRequestResourceNotification,
    90 	EMMFDevSoundProxyCancelRequestResourceNotification,
    91 	EMMFDevSoundProxyGetResourceNotificationData,	
    92 	EMMFDevSoundProxyWillResumePlay,
    93 	EMMFDevSoundProxyEmptyBuffers,
    94 	EMMFDevSoundProxyCancelInitialize,
    95 	EMMFDevSoundProxyBTBFData,
    96 	EMMFDevSoundProxyBTBEData,
    97 	EMMFDevSoundProxySyncCustomCommand,
    98 	EMMFDevSoundProxySyncCustomCommandResult,
    99 	EMMFDevSoundProxyAsyncCustomCommand,
   100 	EMMFDevSoundProxyAsyncCustomCommandResult,
   101 	EMMFDevSoundCustomCommandCloseMuxDemuxPair,
   102 	EMMFDevSoundProxyClose,
   103 	EMMFDevSoundProxyPausedRecordCompleteEvent,
   104 	EMMFDevSoundProxyGetTimePlayed,
   105 	EMMFDevSoundProxySetClientThreadInfo,
   106 	EMMFDevSoundProxyIsResumeSupported,
   107 	EMMFDevSoundProxyResume,
   108 	EMMFDevSoundProxyMarkEvent
   109 	};
   110 
   111 // Signals that the message is destined for the DevSound
   112 const TUid KUidInterfaceMMFDevSound = {0x10207ABA};
   113 const TInt KMMFObjectHandleDevSound = -3;
   114 
   115 // Addresses the chunk states
   116 enum TChunkOp
   117 	{
   118 	ENull,
   119 	EOpen
   120 	};
   121 
   122 /**
   123 *  A class representing CMMFBuffer information.
   124 *  Buffers are used for both playback and recording.
   125 *
   126 *  @lib MmfDevSoundAdaptation.lib
   127 */
   128 class TMMFDevSoundProxyHwBuf
   129 	{
   130 public:
   131 	TUid iBufferType;
   132 	TInt iRequestSize;
   133 	TBool iLastBuffer;
   134 	TUint iBufferSize;
   135 	TChunkOp iChunkOp;
   136 	};
   137 
   138 typedef TPckgBuf<TMMFDevSoundProxyHwBuf> TMMFDevSoundProxyHwBufPckg;
   139 
   140 /**
   141 *  A class representing settings information used to send configuration
   142 *  information to DevSound server.
   143 *  Buffers are used for both playback and recording digital audio.
   144 *
   145 *  @lib MmfDevSoundAdaptation.lib
   146 */
   147 class TMMFDevSoundProxySettings
   148 	{
   149 public:
   150 	TMMFState iMode;
   151 	TUid iHWDev;
   152 	TFourCC iDesiredFourCC;
   153 	TMMFCapabilities iCaps;
   154 	TMMFCapabilities iConfig;
   155 	TInt iMaxVolume;
   156 	TInt iVolume;
   157 	TInt iMaxGain;
   158 	TInt iGain;
   159 	TInt iLeftPercentage;
   160 	TInt iRightPercentage;
   161 	TInt iFrequencyOne;
   162 	TInt iFrequencyTwo;
   163 	TTimeIntervalMicroSeconds iDuration;
   164 	TTimeIntervalMicroSeconds32 iToneOnLength;
   165 	TTimeIntervalMicroSeconds32 iToneOffLength;
   166 	TTimeIntervalMicroSeconds32 iPauseLength;
   167 	TUid iNotificationEventUid;
   168 	TUid iInterface;
   169 	};
   170 
   171 // Packages a DevSound object information into a modifiable buffer descriptor. 
   172 // Provides a type safe way of transferring an object or data structure which is contained within a modifiable buffer descriptor. 
   173 typedef TPckgBuf<TMMFDevSoundProxySettings> TMMFDevSoundProxySettingsPckg;
   174 
   175 // Tone Fixed Sequence Max Length
   176 const TInt KMaxFixedSequenceNameLength = 1024;
   177 
   178 /**
   179 * TMMFDevSoundQueueItem is used to pass asynch messages between the devsound
   180 * proxy and server for the observer's BufferToBeFilled, BufferToBeEmptied,
   181 * PlayError, RecordError, ToneFinished, InitializeComplete and
   182 * SendEventToClient events.
   183 */
   184 class TMMFDevSoundQueueItem
   185 	{
   186 public:
   187 	TMMFDevSoundProxyRequest    iRequest;
   188 	TMMFEventPckg               iEventPckg; // SendEventToClient message payload
   189 	TInt                        iErrorCode; // InitComplete, ToneFinished, PlayError, RecordError message payload
   190 	};
   191 
   192 #endif	//MMFAUDIOCLIENTSERVER_H
   193 
   194 // End of File