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