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