baseport/syborg/soundsc/shared_sound.h
author John Kern <johnk@symbian.org>
Thu, 12 Nov 2009 14:39:23 -0800
changeset 20 3bf560f85513
parent 15 0b7d3b28f025
child 21 8374da225e88
permissions -rw-r--r--
fix for bug 877
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     1
/*
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     8
*
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    11
*
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    12
* Contributors:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    13
*
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    14
* Description:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    15
*
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    16
*/
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    17
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    18
#ifndef __SYBORGSHARED_SOUND_H__
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    19
#define __SYBORGSHARED_SOUND_H__
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    20
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    21
#include <soundsc.h>
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    22
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    23
#ifdef _DEBUG
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    24
#define SYBORG_SOUND_DEBUG(x...) Kern::Printf(x)
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    25
#else
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    26
#define SYBORG_SOUND_DEBUG(x...)
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    27
#endif
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    28
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    29
class DDriverSyborgSoundScPddFactory;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    30
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    31
class DDriverSyborgSoundScPdd : public DSoundScPdd
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    32
	{
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    33
public:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    34
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    35
	DDriverSyborgSoundScPdd();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    36
	~DDriverSyborgSoundScPdd();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    37
	TInt DoCreate();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    38
	void GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    39
	void Caps(TDes8& aCapsBuf) const;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    40
	TInt MaxTransferLen() const;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    41
	TInt SetConfig(const TDesC8& aConfigBuf);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    42
	TInt SetVolume(TInt aVolume);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    43
	TInt StartTransfer();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    44
	TInt TransferData(TUint aTransferID, TLinAddr aLinAddr, TPhysAddr aPhysAddr, TInt aNumBytes);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    45
	void StopTransfer();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    46
	TInt PauseTransfer();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    47
	TInt ResumeTransfer();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    48
	TInt PowerUp();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    49
	void PowerDown();
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    50
	TInt CustomConfig(TInt aFunction, TAny* aParam);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    51
	void Callback(TUint aTransferID, TInt aTransferResult, TInt aBytesTransferred);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    52
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    53
	void SetCaps();
15
0b7d3b28f025 DfcQ() requires an argument
John Kern <johnk@symbian.org>
parents: 13
diff changeset
    54
	TDfcQue* DfcQ(TInt aUnit);
13
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    55
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    56
	TInt CalculateBufferTime(TInt aNumBytes);
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    57
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    58
public:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    59
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    60
	DDriverSyborgSoundScPddFactory*	iPhysicalDevice;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    61
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    62
	class TTransferArrayInfo{
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    63
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    64
public:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    65
	TUint 						iTransferID;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    66
	TLinAddr 					iLinAddr;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    67
	TInt 						iNumBytes;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    68
	TInt						iPlayTime;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    69
	};
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    70
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    71
	RArray<TTransferArrayInfo> iTransferArray;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    72
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    73
	NTimer						iTimer;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    74
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    75
	TInt						iUnitType; //Play or Record
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    76
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    77
private:
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    78
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    79
	TSoundFormatsSupportedV02	iCaps;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    80
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    81
	TCurrentSoundFormatV02		iConfig;
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    82
	
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    83
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    84
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    85
	};
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    86
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    87
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    88
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    89
73107a0bc259 Merged patch from Johnathan White (@accenture)
Martin Trojer <martin.trojer@nokia.com>
parents:
diff changeset
    90
#endif