baseport/syborg/soundsc/shared_sound.h
changeset 16 73107a0bc259
child 18 0b7d3b28f025
equal deleted inserted replaced
12:5c4b0c1fa5f8 16:73107a0bc259
       
     1 /*
       
     2 * Copyright (c) 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 the License "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 #ifndef __SYBORGSHARED_SOUND_H__
       
    19 #define __SYBORGSHARED_SOUND_H__
       
    20 
       
    21 #include <soundsc.h>
       
    22 
       
    23 #ifdef _DEBUG
       
    24 #define SYBORG_SOUND_DEBUG(x...) Kern::Printf(x)
       
    25 #else
       
    26 #define SYBORG_SOUND_DEBUG(x...)
       
    27 #endif
       
    28 
       
    29 class DDriverSyborgSoundScPddFactory;
       
    30 
       
    31 class DDriverSyborgSoundScPdd : public DSoundScPdd
       
    32 	{
       
    33 public:
       
    34 
       
    35 	DDriverSyborgSoundScPdd();
       
    36 	~DDriverSyborgSoundScPdd();
       
    37 	TInt DoCreate();
       
    38 	void GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo);
       
    39 	void Caps(TDes8& aCapsBuf) const;
       
    40 	TInt MaxTransferLen() const;
       
    41 	TInt SetConfig(const TDesC8& aConfigBuf);
       
    42 	TInt SetVolume(TInt aVolume);
       
    43 	TInt StartTransfer();
       
    44 	TInt TransferData(TUint aTransferID, TLinAddr aLinAddr, TPhysAddr aPhysAddr, TInt aNumBytes);
       
    45 	void StopTransfer();
       
    46 	TInt PauseTransfer();
       
    47 	TInt ResumeTransfer();
       
    48 	TInt PowerUp();
       
    49 	void PowerDown();
       
    50 	TInt CustomConfig(TInt aFunction, TAny* aParam);
       
    51 	void Callback(TUint aTransferID, TInt aTransferResult, TInt aBytesTransferred);
       
    52 
       
    53 	void SetCaps();
       
    54 	TDfcQue* DfcQ();
       
    55 	
       
    56 	TInt CalculateBufferTime(TInt aNumBytes);
       
    57 
       
    58 public:
       
    59 	
       
    60 	DDriverSyborgSoundScPddFactory*	iPhysicalDevice;
       
    61 	
       
    62 	class TTransferArrayInfo{
       
    63 
       
    64 public:
       
    65 	TUint 						iTransferID;
       
    66 	TLinAddr 					iLinAddr;
       
    67 	TInt 						iNumBytes;
       
    68 	TInt						iPlayTime;
       
    69 	};
       
    70 	
       
    71 	RArray<TTransferArrayInfo> iTransferArray;
       
    72 	
       
    73 	NTimer						iTimer;
       
    74 	
       
    75 	TInt						iUnitType; //Play or Record
       
    76 	
       
    77 private:
       
    78 
       
    79 	TSoundFormatsSupportedV02	iCaps;
       
    80 	
       
    81 	TCurrentSoundFormatV02		iConfig;
       
    82 	
       
    83 
       
    84 
       
    85 	};
       
    86 
       
    87 
       
    88 
       
    89 
       
    90 #endif