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