os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfAudioClientServer.h
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef MMFAUDIOCLIENTSERVER_H
17 #define MMFAUDIOCLIENTSERVER_H
19 #include <mmf/common/mmfutilities.h>
20 #include <mmf/common/mmfbase.h>
21 #include <mmf/server/sounddevice.h>
23 // opcodes used in message passing between client and server
24 enum TMMFAudioServerRequest
26 EMMFAudioLaunchRequests,
27 EMMFDevSoundSessionHandle
30 enum TMMFDevSoundProxyRequest
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
97 class TMMFDevSoundProxyHwBuf
109 typedef TPckgBuf<TMMFDevSoundProxyHwBuf> TMMFDevSoundProxyHwBufPckg;
112 class TMMFDevSoundProxySettings
120 TFourCC iDesiredFourCC;
121 TMMFCapabilities iCaps;
122 TMMFCapabilities iConfig;
127 TInt iLeftPercentage;
128 TInt iRightPercentage;
131 TTimeIntervalMicroSeconds iDuration;
132 TTimeIntervalMicroSeconds32 iToneOnLength;
133 TTimeIntervalMicroSeconds32 iToneOffLength;
134 TTimeIntervalMicroSeconds32 iPauseLength;
135 TUid iNotificationEventUid;
139 typedef TPckgBuf<TMMFDevSoundProxySettings> TMMFDevSoundProxySettingsPckg;
140 const TInt KMaxFixedSequenceNameLength = 1024;
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.
148 class TMMFDevSoundQueueItem
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