devsound/devsoundrefplugin/src/swcodecwrapper/mmfswcodecwrapperCustomInterfaces.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2003-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 __MMFSWCODECWRAPPERCUSTOMINTERFACES_H__
       
    17 #define __MMFSWCODECWRAPPERCUSTOMINTERFACES_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  * mmfswcodecwrapper.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  * @released
       
    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 	void SetDevice(RMdaDevSound* iDevice);//not for use outside codec wrapper
       
    45 private:
       
    46 	TUint iVolume;
       
    47 	TUint iBytesPlayed;
       
    48 	RMdaDevSound* iDevice;
       
    49 	TTimeIntervalMicroSeconds iRampDuration;
       
    50 	};
       
    51 
       
    52 /**
       
    53  * Implementation of custom interface class for record functionality created by the 
       
    54  * CMMFSwCodecWrapper::CustomInterface() method.  It provides 
       
    55  * access to miscelaneous functionality such as volume settings
       
    56  * Ports of sw codec wrapper may do this differently eg via EAP
       
    57  * note don't use RMdaDevSound::TCurrentSoundFormatBuf so send
       
    58  * across the sample rate and channels because 1)it would mean
       
    59  * mmfswcodecwrapper.h would have to include mdasound.h and 2)
       
    60  * the buffer size and encoding members are not required 3)3rd party ports
       
    61  * may not use RMdaDevSound
       
    62  * Note also that this interface is just a simple interface to get
       
    63  * and set values.  No checking is perfomed on the values sent. (hence the
       
    64  * Set methods do not return an error code.)
       
    65  * @released
       
    66  */
       
    67 class TRecordCustomInterface : public MRecordCustomInterface
       
    68 	{
       
    69 public:
       
    70 	TRecordCustomInterface() : iGain(0), iBytesRecorded(0), iDataPath(NULL) {}
       
    71 	void SetGain(TUint aGain) {iGain = aGain;};
       
    72 	void SetDataPath(CMMFSwCodecRecordDataPath* aDataPath){iDataPath = aDataPath;};
       
    73 	TUint Gain() {return iGain;};
       
    74 	TUint BytesRecorded(); 
       
    75 private:
       
    76 	TUint iGain;
       
    77 	TUint iBytesRecorded;
       
    78 	CMMFSwCodecRecordDataPath* iDataPath;
       
    79 	};
       
    80 
       
    81 
       
    82 #endif
       
    83