kerneltest/e32test/multimedia/d_mmcsc.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2005-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 the License "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 // e32test\multimedia\d_mmcsc.h
       
    15 // The interface to a device driver which creates a shared chunk - for use with the sound driver tests.
       
    16 // This driver uses only generic kernel APIs and so need not be built from each variant.
       
    17 // 
       
    18 //
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @test
       
    24 */
       
    25 
       
    26 #if !defined(__D_MMCSC_H__)
       
    27 #define __D_MMCSC_H__
       
    28 
       
    29 #include <e32cmn.h>
       
    30 #ifndef __KERNEL_MODE__
       
    31 #include <e32std.h>
       
    32 #endif
       
    33 
       
    34 _LIT(KDevMmCScName,"MmCSc");
       
    35 
       
    36 const TInt KMmCScBufSize=153600;	// 150K
       
    37 const TInt KMmCScNumBuffers=8;
       
    38 
       
    39 struct SBufSpecList
       
    40 	{
       
    41 	/** The first entry of the buffer offset list. This list holds the offset from the start of the chunk
       
    42 	for each buffer. This list is only valid if the flag KScFlagBufOffsetListInUse is set in
       
    43 	TSharedChunkBufConfigBase::iFlags. */
       
    44 	TInt iBufferOffset;
       
    45 	TInt iBufferId;
       
    46 	};
       
    47 
       
    48 class TMmSharedChunkBufConfig : public TSharedChunkBufConfigBase
       
    49 	{
       
    50 public:
       
    51 	/** The buffer offset list. This holds the offset from the start of the chunk for each buffer. This list is
       
    52 	only valid if the flag KScFlagBufOffsetListInUse is set in TSharedChunkBufConfigBase::iFlags. */
       
    53 	struct SBufSpecList iSpec[KMmCScNumBuffers];
       
    54 	};
       
    55 
       
    56 class TCapsMmCScV01
       
    57 	{
       
    58 public:
       
    59 	TVersion iVersion;
       
    60 	};
       
    61 
       
    62 class RMmCreateSc : public RBusLogicalChannel
       
    63 	{
       
    64 public:
       
    65 	enum TControl
       
    66 		{ EGetChunkHandle,EGetBufInfo };
       
    67 #ifndef __KERNEL_MODE__
       
    68 public:
       
    69 	inline TInt Open()
       
    70 		{ return DoCreate(KDevMmCScName,TVersion(0,1,1),KNullUnit,NULL,NULL,EOwnerThread);}
       
    71 	inline TInt GetChunkHandle(RChunk& aChunk)
       
    72 		{ return(aChunk.SetReturnedHandle(DoControl(EGetChunkHandle)));}
       
    73 	inline TInt GetBufInfo(TDes8& aBufInfo)
       
    74 		{ return(DoControl(EGetBufInfo,(TAny*)&aBufInfo));}
       
    75 #endif
       
    76 	};
       
    77 
       
    78 #endif // __D_MMCSC_H__