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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMFBTSWCODECRECORDDATAPATH_H__
17 #define __MMFBTSWCODECRECORDDATAPATH_H__
19 #include "mmfBtSwCodecDataPath.h"
21 class CMMFSwCodecRecordDataPath; //fwd ref
22 class CRoutingSoundRecordDevice; // fwd ref
25 * Active object used by the CMMFSwCodecPlayDataPath to get data from the sound
26 * driver. This particular active object encapsulates the asynchronous record
27 * function, where a buffer of data is received from the WINS audio device,
28 * and the active object's RunL is called when the buffer has been created by
29 * the WINS audio device.
32 class CDataPathRecorder : public CActive
35 CDataPathRecorder(CMMFSwCodecRecordDataPath& aParent, TInt aPriority);
38 void RecordData(CMMFDataBuffer& aData);
41 virtual TInt RunError(TInt aError);
42 virtual void DoCancel();
43 virtual void Error(TInt aError);
45 CMMFSwCodecRecordDataPath& iParent;
46 CMMFDataBuffer* iDataFromSource;
51 * Active object used by CMMFSwCodecPlayDataPath to listening for error messages
52 * from the WINS audio device. If this object's RunL is called, recording has
53 * been terminated for some reason. The active object then notifies its parent,
54 * so that proper cleanup and client notification can occur.
57 class CSoundDevRecordErrorReceiver : public CActive
60 CSoundDevRecordErrorReceiver(CMMFSwCodecRecordDataPath& aParent, TInt aPriority);
61 ~CSoundDevRecordErrorReceiver();
65 virtual void DoCancel();
67 CMMFSwCodecRecordDataPath& iParent;
72 * Derived class for play datapath internal to the Sw codec wrapper
75 class CMMFSwCodecRecordDataPath : public CMMFSwCodecDataPath
78 static CMMFSwCodecRecordDataPath* NewL(CRoutingSoundRecordDevice* aSoundDevice);
79 virtual ~CMMFSwCodecRecordDataPath();
80 virtual TInt SetObserver(MMMFHwDeviceObserver &aHwObserver);
81 virtual TInt AddCodec(CMMFSwCodec& aCodec);
82 virtual TInt Start(); //record
85 virtual void BufferFilledL(CMMFDataBuffer& aBuffer);
86 virtual void BufferEmptiedL(const CMMFDataBuffer& aBuffer);
87 virtual void SoundDeviceException(TInt aError);
88 virtual CRoutingSoundRecordDevice* Device();
89 virtual TUint RecordedBytesCount();
91 CMMFSwCodecRecordDataPath(CRoutingSoundRecordDevice* aSoundDevice) : iSoundDevice(aSoundDevice) {};
93 void FillSoundDeviceBufferL();
94 void FillSinkBufferL();
96 CDataPathRecorder* iAudioRecorder;
97 CSoundDevRecordErrorReceiver* iSoundDeviceErrorReceiver;
98 CRoutingSoundRecordDevice* iSoundDevice; // Not owned.
99 CMMFDataBuffer* iSinkBuffer;
100 CMMFDataBuffer* iSoundDeviceBuffer;
101 TUint iSinkBufferSize;
102 TUint iSoundDevBufferSize;
103 TUint iRecordedBytesCount;