mmhais/a3facl/src/shared/mlogicalchain.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MLOGICALCHAIN_H
       
    21 #define MLOGICALCHAIN_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <a3f/a3fbase.h>
       
    25 
       
    26 // CLASS FORWARD
       
    27 
       
    28 class MMMFAudioDataSupplier;
       
    29 class MMMFAudioDataConsumer;
       
    30 class MMMFBufferSource;
       
    31 class MMMFBufferSink;
       
    32 class MAudioGainControl;
       
    33 class MAudioCodecAdaptationObserver;
       
    34 class MStreamPositionControl;
       
    35 class MCustomInterfaceSupport;
       
    36 class MConfigurationHelper;
       
    37 class MStreamBufferControl;
       
    38 
       
    39 
       
    40 enum TMMRCMessageType
       
    41 	{
       
    42 	ENoMessage = 0x0000,
       
    43 	ERegisterStreamObserver = 0x0001, 
       
    44 	ERegisterCodecObserver = 0x0002, 
       
    45 	ERegisterGainObserver = 0x0004, 
       
    46 
       
    47 	EComponentCreation = 0x0010,
       
    48 	EComponentDestruction = 0x0020,
       
    49 	EComponentAlterationGain = 0x0040,
       
    50 	EComponentAlterationCodec = 0x0080,
       
    51 	EStreamStateChange = 0x0100,
       
    52 	EConfigurationRequest = 0x0200
       
    53 	};
       
    54 
       
    55 
       
    56 const TUid KUidAudioCodecObserver = {0x102834BF};
       
    57 
       
    58 
       
    59 /*
       
    60 Interface that represent the logical chain 
       
    61 @class MLogicalChain
       
    62 */
       
    63 
       
    64 class MLogicalChain
       
    65 	{
       
    66 public:
       
    67 	/**
       
    68 	Set the type of message to be processed at the adaptation side
       
    69 	@ see TMMRCMessageType
       
    70 	@param the type of message to be processed
       
    71 	*/
       
    72 	virtual void SetMessageType(TMMRCMessageType aMessageType) = 0;
       
    73 
       
    74 	/**
       
    75 	Set the type of message to be processed at the adaptation side
       
    76 	@ see TMMRCMessageType
       
    77 	@param the type of message to be processed
       
    78 	*/
       
    79 	virtual void ResetMessage() = 0;
       
    80 
       
    81 	/**
       
    82 	Returns the type of message to be processed at the adaptation side
       
    83 	@ see TMMRCMessageType
       
    84 	@return the type of message to be processed
       
    85 	*/
       
    86 	virtual TUint MessageType() = 0;
       
    87 
       
    88 
       
    89 	/**
       
    90 	Returns the number of processing units in the current logical chain 
       
    91 	@return the number of processing units in the current logical chain 
       
    92 	*/
       
    93 	virtual TInt AudioProcessingUnitsCount() = 0;
       
    94 
       
    95 	/**
       
    96 	Returns the UID type of the processing unit of the logical chain 
       
    97 	This function allows the adaptation side know extra details for logical components
       
    98 	@param aIndex indicates the creation order index
       
    99 	@return the uid type of the processing unit
       
   100 	*/
       
   101 	virtual TUid AudioProcessingUnitUid(TInt aIndex) = 0;
       
   102 
       
   103 	/**
       
   104 	Returns the logical chain  state
       
   105 	@return the logical chain state
       
   106 	*/
       
   107 	virtual TAudioState StreamState() = 0;
       
   108 
       
   109 	/**
       
   110 	Set the logical chain state
       
   111 	@param the logical chain state
       
   112 	*/
       
   113 	virtual void SetStreamState(TAudioState aState) = 0;
       
   114 
       
   115 	/**
       
   116 	Returns the logical codec format
       
   117 	@return the logical codec format
       
   118 	*/
       
   119 	virtual TUid CodecFormat() = 0;
       
   120 
       
   121 
       
   122 	/**
       
   123 	Returns the logical codec sample rate
       
   124 	@return the logical codec sample rate
       
   125 	*/
       
   126 	virtual TInt GetSampleRate() = 0;
       
   127 
       
   128 	/**
       
   129 	Gets the mode – e.g. mono/stereo. 
       
   130 	@return aMode
       
   131 	*/
       
   132 	virtual TUid GetMode() = 0;
       
   133 
       
   134 	/**
       
   135 	Returns the priority from the stream
       
   136 	@return the the priority from the stream
       
   137 	*/
       
   138 	virtual TInt Priority() = 0;
       
   139 
       
   140 	/**
       
   141 	Returns the ramp time parameters
       
   142 	*/
       
   143 	virtual void GetVolumeRampParameters(TUid& aRampOperation, TTimeIntervalMicroSeconds& aRampDuration) = 0;
       
   144 
       
   145 	/**
       
   146 	Copies the main configuration parameters of the logical chain
       
   147 	@see TLogicalChainConfiguration
       
   148 	@param the logical chain from where the parameter will be copied
       
   149 	*/
       
   150 	virtual void CopySettings(const MLogicalChain& aChain) = 0;
       
   151 
       
   152 	/**
       
   153 	Creates a copy from the current object 
       
   154 	@return a copy from the current logical chain the ownership is transferred
       
   155 	*/
       
   156 	virtual MLogicalChain* CloneL() = 0;
       
   157 
       
   158 	/**
       
   159 	Deletes the logical chain cloned
       
   160 	*/
       
   161 	virtual void Release() = 0;
       
   162 
       
   163 	/**
       
   164 	Deletes the logical chain cloned
       
   165 	*/
       
   166 	virtual TAny* GetComponent(TUid aType) = 0;
       
   167 
       
   168 	// TODO: Remove those temporary workarounds for data connection
       
   169 	// When the MMRC server is fully implemented and 
       
   170 	// the Control mechanisms & Observation interface extension mechanisms are available
       
   171 	virtual void SetAdaptationSource(MMMFBufferSource& aSource) = 0;
       
   172 	virtual void SetAdaptationSink(MMMFBufferSink& aSink) = 0;
       
   173 	virtual void SetAdaptationGainControl(MAudioGainControl& aGain) = 0;
       
   174 	virtual void SetStreamPositionControl(MStreamPositionControl& aControl) = 0;
       
   175 	virtual void SetCustomInterfaceProvider(MCustomInterfaceSupport& aControl) = 0;
       
   176 	virtual void SetAdaptationStream(MConfigurationHelper& aCodec) = 0;
       
   177 	virtual void SetStreamBufferControl(MStreamBufferControl& aStreamBufferControl) =  0;
       
   178 	};
       
   179 
       
   180 #endif // MLOGICALCHAIN_H