CMixerThread.h
上传用户:snevogroup
上传日期:2008-06-06
资源大小:432k
文件大小:2k
- #ifndef __CMIXERTHREAD_H
- #define __CMIXERTHREAD_H
- #include "TAudioShared.h"
- #include <E32Base.h>
- #include <mdaaudiooutputStream.h>
- #include <mdacommonaudio.h>
- class CMixerThread : CBase, MMdaAudioOutputStreamCallback
- {
- // Construct and destruct
- public:
- static TInt ThreadFunction( TAny* aData); // Thread entry point
- ~CMixerThread();
- private:
- CMixerThread(TAny* aData);
- TInt Construct();
- void ConstructL();
- //////////////////////////////////////////////////////////////////////
- // Other Method
- private:
- static CMixerThread* Create(TAny* aData);
- static void ExcHandler(TExcType aExc);
- void HandleException(TExcType aExc);
- void StartMixer();
- void StopMixer();
- // MMdaAudioOutputStreamCallback
- void MaoscPlayComplete( TInt aError );
- void MaoscBufferCopied( TInt aError, const TDesC8& aBuffer );
- void MaoscOpenComplete( TInt aError );
- //
- void FillBuffer();
- //////////////////////////////////////////////////////////////////////
- // Data
- private:
- CTrapCleanup* iCleanupStack;
- CActiveScheduler* iActiveScheduler;
- CMdaAudioOutputStream* iStream;
- TMdaAudioDataSettings iSet;
- TInt16* iBuffer; // buffer to CMdaAudioOutput
- TInt* iMixBuffer; // 32-bit buffer to mixing
- TPtrC8 iBufferPtr; // pointer to iBuffer
-
- TInt iError; // contains CMdaAudioOutput errors
- TAudioShared& iShared; // reference to shared data with client
-
- TInt16* iAudioData[ KMaxChannels ]; // current sample data pointers
-
- TInt iAudioPos[ KMaxChannels ]; // These are shifted by KAudioShift
- TInt iAudioEnd[ KMaxChannels ];
- TInt iRepStart[ KMaxChannels ];
- TInt iRepEnd[ KMaxChannels ];
- };
- #endif