20
|
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 __BEAGLESHARED_SOUND_H__
|
|
19 |
#define __BEAGLESHARED_SOUND_H__
|
|
20 |
|
|
21 |
#include <soundsc.h>
|
|
22 |
|
|
23 |
#ifdef _DEBUG
|
|
24 |
#define BEAGLE_SOUND_DEBUG(x...) Kern::Printf(x)
|
|
25 |
#else
|
|
26 |
#define BEAGLE_SOUND_DEBUG(x...)
|
|
27 |
#endif
|
|
28 |
|
|
29 |
class DDriverBeagleSoundScPddFactory;
|
|
30 |
|
|
31 |
class DDriverBeagleSoundScPdd : public DSoundScPdd
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
|
|
35 |
DDriverBeagleSoundScPdd();
|
|
36 |
~DDriverBeagleSoundScPdd();
|
|
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 |
// There was a change in the signature for DfcQ() which
|
|
55 |
// is a pure virtual method in the parent.
|
|
56 |
// for Symbian^2
|
|
57 |
TDfcQue* DfcQ();
|
|
58 |
// for Symbian^3
|
|
59 |
TDfcQue* DfcQ(TInt aUnit);
|
|
60 |
|
|
61 |
TInt CalculateBufferTime(TInt aNumBytes);
|
|
62 |
|
|
63 |
public:
|
|
64 |
|
|
65 |
DDriverBeagleSoundScPddFactory* iPhysicalDevice;
|
|
66 |
|
|
67 |
class TTransferArrayInfo{
|
|
68 |
|
|
69 |
public:
|
|
70 |
TUint iTransferID;
|
|
71 |
TLinAddr iLinAddr;
|
|
72 |
TInt iNumBytes;
|
|
73 |
TInt iPlayTime;
|
|
74 |
};
|
|
75 |
|
|
76 |
RArray<TTransferArrayInfo> iTransferArray;
|
|
77 |
|
|
78 |
NTimer iTimer;
|
|
79 |
|
|
80 |
TInt iUnitType; //Play or Record
|
|
81 |
|
|
82 |
private:
|
|
83 |
|
|
84 |
TSoundFormatsSupportedV02 iCaps;
|
|
85 |
|
|
86 |
TCurrentSoundFormatV02 iConfig;
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
};
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
#endif
|