os/mm/devsound/sounddevbt/src/swcodecwrapper/mmfBtswcodecwrapperCustomInterfaces.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 "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 //
    15 
    16 #ifndef __MMFBTSWCODECWRAPPERCUSTOMINTERFACES_H__
    17 #define __MMFBTSWCODECWRAPPERCUSTOMINTERFACES_H__
    18 
    19 
    20 /**
    21  * Implementation of custom interface class for play functionality created by the 
    22  * CMMFSwCodecWrapper::CustomInterface() method.  It provides 
    23  * access to miscellaneous functionality such as volume settings
    24  * Ports of sw codec wrapper may do this differently eg via EAP
    25  * note don't use RMdaDevSound::TCurrentSoundFormatBuf so send
    26  * across the sample rate and channels because 1)it would mean
    27  * MmfBtSwCodecWrapper.h would have to include mdasound.h and 2)
    28  * the buffer size and encoding members are not required 3)3rd party ports
    29  * may not use RMdaDevSound
    30  * Note also that this interface is just a simple interface to get
    31  * and set values.  No checking is perfomed on the values sent (hence the
    32  * Set methods do not return an error code.)
    33  * @prototype
    34  */
    35 class TPlayCustomInterface : public MPlayCustomInterface
    36 	{
    37 public:
    38 	TPlayCustomInterface() : iVolume(0),iBytesPlayed(0),iDevice(NULL),iRampDuration(0) {}
    39 	void SetVolume(TUint aVolume);
    40 	TUint Volume() {return iVolume;};
    41 	TUint BytesPlayed();
    42 	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) {iRampDuration = aRampDuration;};
    43 	TTimeIntervalMicroSeconds& VolumeRamp() {return iRampDuration;};
    44 	TTaskConfig Caps();
    45 	void SetDevice(CRoutingSoundPlayDevice* iDevice);//not for use outside codec wrapper
    46 private:
    47 	TUint iVolume;
    48 	TUint iBytesPlayed;
    49 	CRoutingSoundPlayDevice* iDevice;
    50 	TTimeIntervalMicroSeconds iRampDuration;
    51 	};
    52 
    53 /**
    54  * Implementation of custom interface class for record functionality created by the 
    55  * CMMFSwCodecWrapper::CustomInterface() method.  It provides 
    56  * access to miscelaneous functionality such as volume settings
    57  * Ports of sw codec wrapper may do this differently eg via EAP
    58  * note don't use RMdaDevSound::TCurrentSoundFormatBuf so send
    59  * across the sample rate and channels because 1)it would mean
    60  * MmfBtSwCodecWrapper.h would have to include mdasound.h and 2)
    61  * the buffer size and encoding members are not required 3)3rd party ports
    62  * may not use RMdaDevSound
    63  * Note also that this interface is just a simple interface to get
    64  * and set values.  No checking is perfomed on the values sent. (hence the
    65  * Set methods do not return an error code.)
    66  * @prototype
    67  */
    68 class TRecordCustomInterface : public MRecordCustomInterface
    69 	{
    70 public:
    71 	TRecordCustomInterface() : iGain(0), iBytesRecorded(0), iDataPath(NULL) {}
    72 	void SetGain(TUint aGain) {iGain = aGain;};
    73 	void SetDataPath(CMMFSwCodecRecordDataPath* aDataPath){iDataPath = aDataPath;};
    74 	TUint Gain() {return iGain;};
    75 	TUint BytesRecorded(); 
    76 private:
    77 	TUint iGain;
    78 	TUint iBytesRecorded;
    79 	CMMFSwCodecRecordDataPath* iDataPath;
    80 	};
    81 
    82 
    83 #endif
    84