os/mm/devsound/devsoundpluginsupport/src/CustomInterfaces/gettimestampsci.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef GETTIMESTAMPSCI_H
sl@0
    17
#define GETTIMESTAMPSCI_H
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <mmf/common/mmfipc.h>
sl@0
    21
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    22
#include <mmf/common/mmfipcserver.h>
sl@0
    23
#endif
sl@0
    24
#include <mmf/server/mmfdevsoundcustominterface.h>
sl@0
    25
#include <mmf/server/mmfdevsoundcustomcommands.h>
sl@0
    26
#include <mmf/server/devsoundstandardcustominterfaces.h>
sl@0
    27
#include <mmf/plugin/mmfdevsoundcustominterface.hrh>
sl@0
    28
sl@0
    29
/**
sl@0
    30
 @internalComponent
sl@0
    31
 @prototype
sl@0
    32
 @file
sl@0
    33
 */
sl@0
    34
enum TMMFDevSoundCIGetTimestampsCommands
sl@0
    35
	{
sl@0
    36
	EMMFDevSoundCIGetTimestampsEnable = 0,
sl@0
    37
	EMMFDevSoundCIGetTimestampsForBuffer
sl@0
    38
	};
sl@0
    39
sl@0
    40
sl@0
    41
/**
sl@0
    42
 @internalComponent
sl@0
    43
 @prototype
sl@0
    44
 @file
sl@0
    45
 */
sl@0
    46
sl@0
    47
/**
sl@0
    48
 * CMMFGetTimestampsMux
sl@0
    49
 *
sl@0
    50
 * implementation of the Get Timestamps status custom interface pair
sl@0
    51
 */
sl@0
    52
class CMMFGetTimestampsMux : public CBase,
sl@0
    53
			      	          public MMMFDevSoundCustomInterfaceMuxPlugin,
sl@0
    54
			      	 	      public MMMFGetTimestamps
sl@0
    55
	 {
sl@0
    56
public:
sl@0
    57
sl@0
    58
	// from MMMFDevSoundCustomInterfaceMuxPlugin
sl@0
    59
	/**
sl@0
    60
	Attempt to open the interface.
sl@0
    61
	@param aInterfaceId
sl@0
    62
		   The UID of the interface to open.
sl@0
    63
	@leave This method may leave with one of the system-wide error codes.
sl@0
    64
	@return One of the system wide error codes
sl@0
    65
	*/
sl@0
    66
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
    67
sl@0
    68
	/**
sl@0
    69
	Equivalent to destructor.  Called to destroy plugin.
sl@0
    70
	*/
sl@0
    71
	virtual void Release();
sl@0
    72
	
sl@0
    73
	/**
sl@0
    74
	Pass destructor key.
sl@0
    75
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
    76
	@param aDestructorKey
sl@0
    77
	       The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
    78
	*/
sl@0
    79
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
    80
	
sl@0
    81
	/**
sl@0
    82
	Complete construction.
sl@0
    83
	Pass additional values from the construction phase, used subsequently by the plugin.
sl@0
    84
	@param aCustomUtility
sl@0
    85
	       The custom interface utility used by the plugin to communicate with the remote
sl@0
    86
		   server side DeMux plugin
sl@0
    87
	@leave This method may leave with one of the system-wide error codes.
sl@0
    88
	*/
sl@0
    89
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceMuxUtility* aCustomUtility);
sl@0
    90
sl@0
    91
	/** 
sl@0
    92
	Return the custom interface
sl@0
    93
	@param aInterfaceId
sl@0
    94
		   The UID of the required custom interface
sl@0
    95
	@return The custom interface supported by this plugin
sl@0
    96
	*/
sl@0
    97
	virtual TAny* CustomInterface(TUid aInterfaceId);
sl@0
    98
sl@0
    99
	/**
sl@0
   100
	Instantiate a CI Mux class
sl@0
   101
	@return The pointer to the new class, cast to the Mux plugin mixin
sl@0
   102
	*/
sl@0
   103
	static MMMFDevSoundCustomInterfaceMuxPlugin* NewL();
sl@0
   104
sl@0
   105
	// from MMMFGetTimestamps
sl@0
   106
	/** 
sl@0
   107
	@see MMMFGetTimestamps
sl@0
   108
	*/
sl@0
   109
	virtual TInt MmgtSetRecordSystemTimestampsEnabled(TBool aEnable);
sl@0
   110
	
sl@0
   111
	/** 
sl@0
   112
	@see MMMFGetTimestamps
sl@0
   113
	*/
sl@0
   114
	virtual TInt MmgtGetSystemTimestampForBuffer(const TTimeIntervalMicroSeconds& aBufferPosition,
sl@0
   115
													TTime& aTimestamp) const;
sl@0
   116
sl@0
   117
protected:
sl@0
   118
	CMMFGetTimestampsMux();
sl@0
   119
	~CMMFGetTimestampsMux();
sl@0
   120
sl@0
   121
protected:
sl@0
   122
	TUid iDestructorKey;
sl@0
   123
	TInt iRemoteHandle;
sl@0
   124
	MMMFDevSoundCustomInterfaceMuxUtility* iUtility;
sl@0
   125
	};
sl@0
   126
sl@0
   127
/**
sl@0
   128
 @internalComponent
sl@0
   129
 @prototype
sl@0
   130
 @file
sl@0
   131
 */
sl@0
   132
 
sl@0
   133
/**
sl@0
   134
 * CMMFGetTimestampsDeMux - DeMux side of pair
sl@0
   135
 */
sl@0
   136
sl@0
   137
class CMMFGetTimestampsDeMux : public CBase,
sl@0
   138
			      	   			public MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   139
	{
sl@0
   140
public:
sl@0
   141
	/**
sl@0
   142
	Instantiate a CMMFGetTimestampsDeMux class
sl@0
   143
	@leave This method may leave with one of the system-wide error codes.
sl@0
   144
	@return A pointer to the new class cast to the DeMux plugin mixin
sl@0
   145
	*/
sl@0
   146
	static MMMFDevSoundCustomInterfaceDeMuxPlugin* NewL();
sl@0
   147
		
sl@0
   148
	/**
sl@0
   149
	Attempt to open the interface.
sl@0
   150
	@param aInterfaceId
sl@0
   151
		   The UID of the interface to open.
sl@0
   152
	@return A handle to the remote plugin
sl@0
   153
	*/
sl@0
   154
	virtual TInt OpenInterface(TUid aInterfaceId);
sl@0
   155
sl@0
   156
	/**
sl@0
   157
	Equivalent to destructor.  Called to destroy plugin.
sl@0
   158
	*/
sl@0
   159
	virtual void Release();
sl@0
   160
	
sl@0
   161
	/**
sl@0
   162
	Pass destructor key.
sl@0
   163
	Called on construction so plugin takes responsibility to call REComSession::DestroyedImplementation()
sl@0
   164
	@param aDestructorKey
sl@0
   165
	       The Uid returned by REComSession::CreateImplementationL() or similar
sl@0
   166
	*/
sl@0
   167
	virtual void PassDestructorKey(TUid aDestructorKey);
sl@0
   168
	
sl@0
   169
	/**
sl@0
   170
	Set the target of the custom interface call
sl@0
   171
	@param aTarget
sl@0
   172
	       The DevSound to call the custom interface on.
sl@0
   173
	*/
sl@0
   174
	virtual void SetInterfaceTarget(MMMFDevSoundCustomInterfaceTarget* aTarget);
sl@0
   175
	
sl@0
   176
	/**
sl@0
   177
	Complete construction.
sl@0
   178
	@param aUtility
sl@0
   179
	       The DeMux utility to use
sl@0
   180
	@leave This method may leave with one of the system-wide error codes.
sl@0
   181
	*/
sl@0
   182
	virtual void CompleteConstructL(MMMFDevSoundCustomInterfaceDeMuxUtility* aUtility);
sl@0
   183
sl@0
   184
	/**
sl@0
   185
	Refresh the current custom interface connections
sl@0
   186
	@leave This method may leave with one of the system-wide error codes.
sl@0
   187
	*/
sl@0
   188
	virtual void RefreshL();
sl@0
   189
sl@0
   190
	// from MMMFDevSoundCustomInterfaceDeMuxPlugin
sl@0
   191
	/**
sl@0
   192
	Open the slave
sl@0
   193
	@param aInterface
sl@0
   194
		   The UID of the requested interface
sl@0
   195
	@param aPackageBuf
sl@0
   196
		   A package of data that can be supplied for initialisation
sl@0
   197
	@leave This method may leave with one of the system-wide error codes.
sl@0
   198
	@return The result of the operation
sl@0
   199
	*/
sl@0
   200
	virtual TInt DoOpenSlaveL(TUid aInterface, const TDesC8& aPackageBuf);
sl@0
   201
sl@0
   202
	/** 
sl@0
   203
	Close the slave
sl@0
   204
	@param aHandle
sl@0
   205
		   The handle of the slave plugin
sl@0
   206
	@leave This method may leave with one of the system-wide error codes.
sl@0
   207
	*/
sl@0
   208
	virtual void DoCloseSlaveL(TInt aHandle);
sl@0
   209
sl@0
   210
	// original RMessage is supplied so that remote demux plugin can extract necessary details
sl@0
   211
	// using DeMux utility
sl@0
   212
sl@0
   213
	/**
sl@0
   214
	Relay the synchronous custom command onto the slave
sl@0
   215
	@param aMessage
sl@0
   216
		   The IPC message to be sent to the slave
sl@0
   217
	@leave This method may leave with one of the system-wide error codes.
sl@0
   218
	@return The result of the operation
sl@0
   219
	*/
sl@0
   220
	virtual TInt DoSendSlaveSyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   221
sl@0
   222
	/**
sl@0
   223
	Relay the synchronous custom command onto the slave and obtain a result
sl@0
   224
	@param aMessage
sl@0
   225
		   The IPC message to be sent to the slave
sl@0
   226
	@leave This method may leave with one of the system-wide error codes.
sl@0
   227
	@return The result of the operation
sl@0
   228
	*/
sl@0
   229
	virtual TInt DoSendSlaveSyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   230
sl@0
   231
	/**
sl@0
   232
	Relay an asynchronous command onto the slave
sl@0
   233
	@param aMessage
sl@0
   234
		   The IPC message to be sent to the slave
sl@0
   235
	@leave This method may leave with one of the system-wide error codes.
sl@0
   236
	*/
sl@0
   237
	virtual void DoSendSlaveAsyncCommandL(const RMmfIpcMessage& aMessage);
sl@0
   238
sl@0
   239
	/**
sl@0
   240
	Relay an asynchronous command onto the slave and obtain a result
sl@0
   241
	@param aMessage
sl@0
   242
		   The IPC message to be sent to the slave@param aMessage
sl@0
   243
	@leave This method may leave with one of the system-wide error codes.
sl@0
   244
	*/
sl@0
   245
	virtual void DoSendSlaveAsyncCommandResultL(const RMmfIpcMessage& aMessage);
sl@0
   246
sl@0
   247
protected:
sl@0
   248
	~CMMFGetTimestampsDeMux();
sl@0
   249
	CMMFGetTimestampsDeMux();
sl@0
   250
sl@0
   251
	// mirrors MMMFGetTimestamps method.
sl@0
   252
	TInt DoMmgtSetRecordSystemTimestampsEnabled(TBool aEnable);
sl@0
   253
	TInt DoMmgtGetSystemTimestampForBuffer(const TTimeIntervalMicroSeconds& aBufferPosition,
sl@0
   254
											TTime& aTimestamp);	
sl@0
   255
protected:
sl@0
   256
	MMMFDevSoundCustomInterfaceDeMuxUtility* iUtility;
sl@0
   257
	MMMFDevSoundCustomInterfaceTarget* iTarget;
sl@0
   258
	TUid iDestructorKey;
sl@0
   259
	MMMFGetTimestamps* 	iInterfaceGetTimestamps;
sl@0
   260
	};
sl@0
   261
sl@0
   262
#endif